[This answer is meant as a tutorial introduction to how one would debug problems like the OP's, so it is more detailed than the "answer" which is just the setting
of browse-url-browser-function
below. But I have always found answers of the sort "Do this
- problem solved" unsatisfactory: I like to understand what's going on. YMMV, in which case skip the long-winded explanations.]
org-open-at-point
calls org-link-open
which uses the variable org-link-parameters
to look up the :follow
property for the type of the link. In this case the type is https
and the :follow
property turns out to be an anonymous function that is set when the file ol.el[c]
(l.1349 in my version of the file) is loaded:
...
;;;; "http", "https", "mailto", "ftp", and "news" link types
(dolist (scheme '("ftp" "http" "https" "mailto" "news"))
(org-link-set-parameters scheme
:follow
(lambda (url arg)
(browse-url (concat scheme ":" url) arg))))
...
The upshot is that this anonymous (lambda
) function calls browse-url
. It is unlikely that the problem as described is caused by any of the above, so we concentrate on browse-url
.
Reading the doc string of browse-url
(C-h f browse-url
) uncovers the fact that it calls the function that is specified as the value of the variable browse-url-browser-function
. After prodding the OP with a question, we find out that the OP's setting of that variable was browse-url-default-browser
. Unfortunately for debugging purposes (remote debugging purposes, no less), that function pokes around all over the place until it finds something that it can use and then calls that something. So at that point, it was more expedient to suggest that the OP bypass that and set the browse-url-browser-function
variable directly to the function corresponding to the desired browser:
(setq browse-url-browser-function #'browse-url-firefox)
Setting that in the init file did the trick for the OP. Other "direct to external browser" function available include browse-url-chrome
and browse-url-mozilla
.
The only remaining mystery is why the default browser function did what the OP described. From the description, it seems that the culprit is browse-url-kde
. I have no way to test that, but a KDE user can confirm (or refute) that claim by evaluating the following (e.g. in the *scratch*
buffer - paste the expression and type C-j
after the closing paren):
(browse-url-kde "https://www.google.com")
If that does what the OP describes, it's arguably a bug in the browse-url-kde
function and should probably be reported (M-x report-emacs-bug
).
/var/tmp
?ESC ESC : (browse-url "https://www.google.com/") RET
?