Emacs: View Info Page Tutorial

Buy Xah Emacs Tutorial. Master emacs benefits for life.
, , …,

This page shows you how to read “info” documents in emacs.

emacs info 2014-01-19
emacs M-x info.

Emacs has extensive documentation, in a format called Texinfo. The Texinfo document has a tree structure, and allow embedded links, similar to HTML.

To view info doc index, call infoCtrl+h i】. Once you are in the Info doc, you can use the mouse or keyboard to navigate.

Info-mode Keys

Here's the most important info keys:

emacs info keys
PurposeKey
goto Next LinkTab ↹
Visit LinkEnter ↵
emacs info keys for navigation
PurposeKey
Back (last node)l
Forwardr
parent node (up) u
previous nodep
next noden
emacs info keys
PurposeKey
search s
quit infoq
emacs info help keys
PurposeKey
view helph
list keysCtrl+h m

2 great commands for searching info is:

They don't have keys. You might want to set 【Ctrl+h 4】 or 【Ctrl+h 5】 for them. The elisp one is more useful. 〔➤ Emacs: How to Define Keys

Open a Info File

If you have a info file, you can open it in info by first call universal-argumentCtrl+u】 then infoCtrl+h i】. Emacs will prompt for a path.

Alternatively, type this lisp expression then evaluate it:

(info "/home/john/Downloads/xyz.info")

(To eval lisp code, select it, then call eval-region) 〔➤ Emacs: How to Evaluate Emacs Lisp Code

Adding Web Browser Backspace Key

Web browsers on Windows 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 add-browser-backspace-key-to-Info-mode ()
  "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'."
  (progn
    (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. http://xahlee.info/mswin/Firefox_set_backspace_previous_page.html
  )

(add-hook 'Info-mode-hook 'add-browser-backspace-key-to-Info-mode)

〔➤ Firefox: Set Backspace Key to Go Back To Previous Page

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-keyCtrl+h k】, then press the mouse button. Emacs might say:

<mouse-8> … undefined

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

(defun add-mouse-back-button-to-Info-mode ()
  "Add some browser styled nav keys for `Info-mode'."
  (local-set-key (kbd "<mouse-8>") 'Info-history-back))

(add-hook 'Info-mode-hook 'add-mouse-back-button-to-Info-mode)

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.

See:

For more about how to set mouse buttons, see: Emacs: How to Set Mouse Buttons.

Like it? Buy Xah Emacs Tutorial.