From 06be62d091234d760106323539d456b14ecd30fa Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 19 Jun 2020 10:36:02 -0400 Subject: [PATCH] Set browse-url-generic-program --- emacs/init.org | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 1db0aa1..af5e1b9 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -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: #+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 () "Opens the URL at point in w3m" (interactive) (let ((browse-url-browser-function 'w3m-browse-url)) (if (eq major-mode 'org-mode) (org-open-at-point) - (browse-url-at-point)))) + (browse-url-at-point)))) (leader-def-key "awB" 'browse-url-at-point-w3m) #+END_SRC