el/dot-emacs.el: Force Hyperspec lookups to use w3m, if available.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 3 Aug 2019 02:05:54 +0000 (03:05 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 3 Aug 2019 02:06:34 +0000 (03:06 +0100)
It's much more convenient to have the documentation in Emacs.

el/dot-emacs.el

index c0d2fe2..f1b75a7 100644 (file)
@@ -3905,6 +3905,16 @@ that character only to be normal punctuation.")
       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.