[slime-devel] Hyperspec lookups with w3m in Slime

Mark Triggs mark at dishevelled.net
Thu Jul 15 16:23:13 UTC 2004


d95-bli at nada.kth.se (Björn Lindberg) writes:

> I would much prefer if the behaviour was closer to the one for C-c C-d
> C-d, where the description pops up in another window, and an effort is
> made upon exit to restore the windows to what they were before.

I've had the following fragment in my ~/.emacs for a while with no
obvious side-effects or respiratory trouble:

(defadvice common-lisp-hyperspec
  (around hyperspec-lookup-w3m () activate)
  (let* ((window-configuration (current-window-configuration))
         (browse-url-browser-function
          `(lambda (url new-window)
             (w3m-browse-url url nil)
             (let ((hs-map (copy-keymap w3m-mode-map)))
               (define-key hs-map (kbd "q")
                 (lambda ()
                   (interactive)
                   (kill-buffer nil)
                   (set-window-configuration ,window-configuration)))
               (use-local-map hs-map)))))
    ad-do-it))

Of course, your mileage may vary :o)

Cheers,

Mark

-- 
Mark Triggs
<mark at dishevelled.net>




More information about the slime-devel mailing list