HomeMathComputingArtsWordsLiteratureMusictwitter facebook webfeed

Adding Web Browser Keys to Emacs

Advertise Here For Profit

Xah Lee, 2010-12-20

Emacs has extensive documentation. The doc format is called “info”, and is a tree structure, very similar to how you browse a website.

To view the complete documentation index, press 【Ctrl+h i】. Once you are in the Info doc, you can use the mouse to navigate, or using keyboard.

Here's the most important navigation keys:

PurposeEmacs KeyWeb Browser key
BacklBackspace or 【Alt+
ForwardrShift+Backspace】 or 【Alt+
Go Up u
Focus on Next LinkTabTab
Visit LinkEnterEnter

Web browsers use the Backspace for moving to last viewed page. If you have 5 button mouse, by default the 4th and 5th button acts as backward and forward buttons

These keys don't work in emacs. If you use emacs in a graphical window, using the mouse's 4th and 5th button are very convenient. Here's how to add 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 and mouse buttons are added:
 【Backspace】 and <mouse-4> for `Info-history-back'
 【Shift+Backspace】 and <mouse-5> 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-4>") 'Info-history-back)
 (local-set-key (kbd "<mouse-5>") 'Info-history-forward)
  )

(add-hook 'Info-mode-hook 'browser-nav-keys)
blog comments powered by Disqus