Wednesday, November 08, 2006

Unix man page lookup (Wednesday Emacs blogging)

Today's a quick one:

; man page lookup (by default, f1 is help, but I
; already know how to bring that up using C-h)
(define-key global-map [f1]
  (lambda () (interactive)
    (manual-entry (current-word))))

As the comment implies, by default f1's bound to Emacs help. But of course, longtime Emacs users know how to acces the rich interactive help system using C-h; C-h ? ? gives you a list of the main C-h functions, but here are some favorites that I hit reflexively almost once a day:

C-h a
"Apropos" help: looks up anything (including both functions and variables) matching a substring
C-h b
List all key bindings in the current mode
C-h k keystroke
Look up the function bound to this keystroke

So, what do you really need that f1 help for? Looking up a Unix manpage on the current word is much more useful, especially in M-x shell mode or other modes where you're editing shell commands.

1 comment:

  1. Hi,

    Just found your post by google blog alerts.

    Good article, thanks, and I like your Wednesday Emacs Blogging.

    As a longtime Emacs user, I'm trying using Emacs for just everething, including reading man pages and info manuals.