Function: find-function-do-it
find-function-do-it is a byte-compiled function defined in
find-func.el.gz.
Signature
(find-function-do-it SYMBOL TYPE SWITCH-FN)
Documentation
Find Emacs Lisp SYMBOL in a buffer and display it.
TYPE is nil to search for a function definition,
or else defvar or defface.
The variable find-function-recenter-line controls how
to recenter the display. SWITCH-FN is the function to call
to display and select the buffer.
See also find-function-after-hook.
Set mark before moving, if the buffer already existed.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/find-func.el.gz
(defun find-function-do-it (symbol type switch-fn)
"Find Emacs Lisp SYMBOL in a buffer and display it.
TYPE is nil to search for a function definition,
or else `defvar' or `defface'.
The variable `find-function-recenter-line' controls how
to recenter the display. SWITCH-FN is the function to call
to display and select the buffer.
See also `find-function-after-hook'.
Set mark before moving, if the buffer already existed."
(let* ((orig-point (point))
(orig-buffers (buffer-list))
(buffer-point (save-excursion
(find-definition-noselect symbol type)))
(new-buf (car buffer-point))
(new-point (cdr buffer-point)))
(when buffer-point
(when (memq new-buf orig-buffers)
(push-mark orig-point))
(funcall switch-fn new-buf)
(when new-point (goto-char new-point))
(recenter find-function-recenter-line)
(run-hooks 'find-function-after-hook))))