2014-08-18 find-function-view-mode

Tired of doing C-h f, then typing the function name and then C-x C-o TAB RET to go to the source, I finally put the find-function onto C-h C-f (replacing mostly useless Emacs FAQ) (I learned about find-function from the indispensable Emacs Redux post.) However, I usually don’t want to edit my Emacs’ guts in place, so I looked up the (two-line) source for find-function (guess how, ha, ha), and came up with this one:

(defun find-function-view-mode (fun)
  (interactive (find-function-read))
  (find-function-do-it fun nil 'switch-to-buffer)
  (view-mode 1))

(global-set-key (kbd "C-h C-f") 'find-function-view-mode)

Trivial, but very useful.

As a side note: I also added (global-set-key (kbd "C-z C-v") 'view-mode) to my C-z keymap. Being used to less (how metaphysical!), I like view-mode a lot. Give it a try if you happen to open files in Emacs just to look at them, not edit them.

CategoryEnglish, CategoryBlog, CategoryEmacs