Set browse-url-generic-program
This commit is contained in:
parent
41e481abd4
commit
06be62d091
@ -4298,13 +4298,18 @@ Browsing the web from Emacs. Relies on having [[http://w3m.sourceforge.net/][w3m
|
|||||||
I mostly want `browse-url-at-point` to open stuff in Firefox, but in some cases I want it within Emacs:
|
I mostly want `browse-url-at-point` to open stuff in Firefox, but in some cases I want it within Emacs:
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq browse-url-generic-program
|
||||||
|
(cond
|
||||||
|
((executable-find "open") "open")
|
||||||
|
((executable-fine "xdg-open" "xdg-open"))))
|
||||||
|
|
||||||
(defun browse-url-at-point-w3m ()
|
(defun browse-url-at-point-w3m ()
|
||||||
"Opens the URL at point in w3m"
|
"Opens the URL at point in w3m"
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((browse-url-browser-function 'w3m-browse-url))
|
(let ((browse-url-browser-function 'w3m-browse-url))
|
||||||
(if (eq major-mode 'org-mode)
|
(if (eq major-mode 'org-mode)
|
||||||
(org-open-at-point)
|
(org-open-at-point)
|
||||||
(browse-url-at-point))))
|
(browse-url-at-point))))
|
||||||
|
|
||||||
(leader-def-key "awB" 'browse-url-at-point-w3m)
|
(leader-def-key "awB" 'browse-url-at-point-w3m)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
Loading…
Reference in New Issue
Block a user