chiark / gitweb /
el/dot-emacs.el: Force Hyperspec lookups to use w3m, if available.
[profile] / el / dot-emacs.el
index c0d2fe2b5f9e05438735ca3858a4c2ab3e4e068f..f1b75a75f21f5dbe5665025162540a856efaa5b3 100644 (file)
@@ -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.