Skip to content

Instantly share code, notes, and snippets.

@aarvid
Created September 4, 2017 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarvid/46644bf304f01f130c990b035c8b513a to your computer and use it in GitHub Desktop.
Save aarvid/46644bf304f01f130c990b035c8b513a to your computer and use it in GitHub Desktop.
hyperspec other window, q to close.
(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)))))
(when (one-window-p) ; <== Inserted code here
(split-window)) ; <==
(other-window 1) ; <==
ad-do-it))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment