More Info
17 Mar 2015I really liked Marcin Borkowski's post on Info dispatch,
where he describes how to open several *info*
buffers for the most commonly used manuals.
However, as I tried to call one of these functions today, I forgot the key binding.
Hydra to the rescue!
Here's what I've come up with:
(defun ora-open-info (topic bname)
"Open info on TOPIC in BNAME."
(if (get-buffer bname)
(progn
(switch-to-buffer bname)
(unless (string-match topic Info-current-file)
(Info-goto-node (format "(%s)" topic))))
(info topic bname)))
(defhydra hydra-info-to (:hint nil :color teal)
"
_o_rg e_l_isp _e_macs _h_yperspec"
("o" (ora-open-info "org" "*org info*"))
("l" (ora-open-info "elisp" "*elisp info*"))
("e" (ora-open-info "emacs" "*emacs info*"))
("h" (ora-open-info "gcl" "*hyperspec*")))
(define-key Info-mode-map "t" 'hydra-info-to/body)
The Plan
I already have the <f1> i key binding hard wired to my fingers. So after I'm in any Info buffer, I plan to press t and get this dispatch:
Getting the Hyperspec
I've heard people lauding HTML while dumping on Info. I'd suggest them to compare the Common Lisp Hyperspec web site to this info file extracted from there. Their contents are identical, but it's easier and more pleasant to use Info.
After I downloaded the file, I extracted it to ./etc/info/gcl.info
, where .
is my emacs-d
.
Then I just added this directory to the Info path:
(setq Info-additional-directory-list
(list (expand-file-name "etc/info/" emacs-d)))
Outro
Reading Info is pleasant and educational. In case you're new to Info, there's Info for Info. In Info format! Just press <f1> i h.