From: Mark Wooding Date: Sat, 3 Aug 2019 02:05:54 +0000 (+0100) Subject: el/dot-emacs.el: Force Hyperspec lookups to use w3m, if available. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/36cd5c10a2bb53a0300eb9f1deae427e71f63f0c?ds=sidebyside el/dot-emacs.el: Force Hyperspec lookups to use w3m, if available. It's much more convenient to have the documentation in Emacs. --- diff --git a/el/dot-emacs.el b/el/dot-emacs.el index c0d2fe2..f1b75a7 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -3905,6 +3905,16 @@ (setq lisp-simple-loop-indentation 2 lisp-loop-keyword-indentation 6 lisp-loop-forms-indentation 6) +(defmacro mdw-advise-hyperspec-lookup (func args) + `(defadvice ,func (around mdw-browse-w3m ,args activate compile) + (if (fboundp 'w3m) + (let ((browse-url-browser-function #'mdw-w3m-browse-url)) + ad-do-it) + ad-do-it))) +(mdw-advise-hyperspec-lookup hyperspec-lookup (symbol)) +(mdw-advise-hyperspec-lookup hyperspec-lookup-format (char)) +(mdw-advise-hyperspec-lookup hyperspec-lookup-reader-macro (char)) + (defun mdw-fontify-lispy () ;; Set fill prefix.