Function: help-follow-symbol

help-follow-symbol is an interactive and byte-compiled function defined in help-mode.el.gz.

Signature

(help-follow-symbol &optional POS)

Documentation

In help buffer, show docs for symbol at POS, defaulting to point.

Show all docs for that symbol as either a variable, function or face.

Probably introduced at or before Emacs version 27.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/help-mode.el.gz
(defun help-follow-symbol (&optional pos)
  "In help buffer, show docs for symbol at POS, defaulting to point.
Show all docs for that symbol as either a variable, function or face."
  (interactive "d")
  (unless pos
    (setq pos (point)))
  ;; check if the symbol under point is a function, variable or face
  (let ((sym
	 (intern
	  (save-excursion
	    (goto-char pos) (skip-syntax-backward "w_")
	    (buffer-substring (point)
			      (progn (skip-syntax-forward "w_")
				     (point)))))))
    (if (or (boundp sym)
	    (get sym 'variable-documentation)
	    (fboundp sym) (facep sym))
        (help-do-xref pos #'describe-symbol (list sym))
      (user-error "No symbol here"))))