Emacs: Info-mode Keys, and Adding Web Browser Keys to Info

, , …,

This page shows you the keyboard shortcuts for navigating emacs's “Info-mode”, and how to set web browser keys for it.

emacs info 2014-01-19
emacs info

Emacs has extensive documentation, in a format called Texinfo. It is a tree structure, very similar to how you browse a website. To view the complete documentation index, call infoF1 i】. Once you are in the Info doc, you can use the mouse or keyboard to navigate.

Here's the most important navigation keys:

emacs info keys
PurposeEmacs KeySimilar Key in Web Browser
Back (last node)l⌫ Backspace or 【Alt+
Forwardr⇧ Shift+⌫ Backspace】 or 【Alt+
Focus on Next LinkTab ↹Tab ↹
Visit LinkEnter ↵Enter ↵
search sCtrl+f

Other important keys:

emacs info keys for navigation
PurposeEmacs Key
parent node (up) u
previous nodep
next noden


emacs info nav keys
PurposeEmacs Key
view helph
list keysF1 m

Setting Emacs Info to Use Web Browser Keys

Web browsers on Windows & Mac use the ⌫ Backspace for moving to last viewed page.

Here's how to add the backspace key to emacs. Put the following in your emacs init file.

(defun browser-nav-keys ()
  "Add some browser styled nav keys for Info-mode.
  The following keys are added:
 【Backspace】 for `Info-history-back'
 【Shift+Backspace】 for `Info-history-forward'."
    (local-set-key (kbd "<backspace>") 'Info-history-back)
    (local-set-key (kbd "<S-backspace>") 'Info-history-forward)
    ;; (local-set-key (kbd "<mouse-8>") 'Info-history-back) 5-button mouse. the mouse numbering depends on your OS and mouse. Call “describe-key” then press mouse button to find out
  ;; note: on Linux Firefox, you have to turn on Backspace key for previous page. In the preference. That key isn't supported in Mac's Safari neither until i think 2008 or so.

(add-hook 'Info-mode-hook 'browser-nav-keys)

5 Buttons Mouse, Setting Forward/Backward Thumb Buttons for Info

if you have 5-buttons mouse, you can also make the 4th button do “previous page”. The button syntax is different depending on your mouse and whether you are on {Linux, Mac, Microsoft Windows}. Here's how.

① call describe-keyF1 k】, then press the mouse button. Emacs might say:

<mouse-8> … undefined

② add the following in your info key function given above.

(local-set-key (kbd "<mouse-8>") 'Info-history-back)

I recommend you get a 5-buttons mouse, because the extra buttons lets you do lots of things. You do use mouse a lot, because 50% of time you spend in browser even for coding, and in browser the mouse is most efficient.


blog comments powered by Disqus