Function: help-setup-xref
help-setup-xref is an autoloaded and byte-compiled function defined in
help-mode.el.gz.
Signature
(help-setup-xref ITEM INTERACTIVE-P)
Documentation
Invoked from commands using the "*Help*" buffer to install some xref info.
ITEM is a (FUNCTION . ARGS) pair appropriate for recreating the help buffer after following a reference. INTERACTIVE-P is non-nil if the calling command was invoked interactively. In this case the stack of items for help buffer "back" buttons is cleared.
This should be called very early, before the output buffer is cleared, because we want to record the "previous" position of point so we can restore it properly when going back.
Source Code
;; Defined in /usr/src/emacs/lisp/help-mode.el.gz
;;;###autoload
(defun help-setup-xref (item interactive-p)
"Invoked from commands using the \"*Help*\" buffer to install some xref info.
ITEM is a (FUNCTION . ARGS) pair appropriate for recreating the help
buffer after following a reference. INTERACTIVE-P is non-nil if the
calling command was invoked interactively. In this case the stack of
items for help buffer \"back\" buttons is cleared.
This should be called very early, before the output buffer is cleared,
because we want to record the \"previous\" position of point so we can
restore it properly when going back."
(with-current-buffer (help-buffer)
;; Disable `outline-minor-mode' in a reused Help buffer
;; created by `describe-bindings' that enables this mode.
(when (bound-and-true-p outline-minor-mode)
(outline-minor-mode -1)
(mapc #'kill-local-variable
'(outline-search-function
outline-regexp
outline-heading-end-regexp
outline-level
outline-minor-mode-cycle
outline-minor-mode-highlight
outline-minor-mode-use-buttons
outline-default-state
outline-default-rules)))
(when help-xref-stack-item
(push (cons (point) help-xref-stack-item) help-xref-stack)
(setq help-xref-forward-stack nil))
(when interactive-p
(let ((tail (nthcdr 10 help-xref-stack)))
;; Truncate the stack.
(if tail (setcdr tail nil))))
(setq help-xref-stack-item item)))