Function: Info-goto-emacs-command-node

Info-goto-emacs-command-node is an autoloaded, interactive and byte-compiled function defined in info.el.gz.

Signature

(Info-goto-emacs-command-node COMMAND)

Documentation

Go to the Info node in the Emacs manual for command COMMAND.

The command is found by looking up in Emacs manual's indices or in another manual found via COMMAND's info-file property or the variable Info-file-list-for-emacs. COMMAND must be a symbol or string.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/info.el.gz
;;;###autoload (put 'Info-goto-emacs-command-node 'info-file "emacs")
;;;###autoload
(defun Info-goto-emacs-command-node (command)
  "Go to the Info node in the Emacs manual for command COMMAND.
The command is found by looking up in Emacs manual's indices
or in another manual found via COMMAND's `info-file' property or
the variable `Info-file-list-for-emacs'.
COMMAND must be a symbol or string."
  (interactive "CFind documentation for command: ")
  ;; If command is given as a string, convert it to a symbol.
  (if (stringp command)
      (setq command (intern command)))
  (or (commandp command)
      (signal 'wrong-type-argument (list 'commandp command)))
  (let ((where (Info-find-emacs-command-nodes command)))
    (if where
	(let ((num-matches (length where)))
	  ;; Get Info running, and pop to it in another window.
	  (save-window-excursion
	    (info))
	  (or (derived-mode-p 'Info-mode) (pop-to-buffer "*info*"))
	  ;; Bind Info-history to nil, to prevent the last Index node
	  ;; visited by Info-find-emacs-command-nodes from being
	  ;; pushed onto the history.
	  (let ((Info-history nil) (Info-history-list nil)
		(line-number (nth 2 (car where))))
	    (Info-find-node (nth 0 (car where)) (nth 1 (car where)))
	    (if (and (integerp line-number) (> line-number 0))
		(forward-line (1- line-number))))
	  (if (> num-matches 1)
	      (progn
		;; (car where) will be pushed onto Info-history
		;; when/if they go to another node.  Put the other
		;; nodes that were found on the history.
		(setq Info-history (nconc (cdr where) Info-history))
		(message "Found %d other entr%s.  Use %s to see %s."
			 (1- num-matches)
			 (if (> num-matches 2) "ies" "y")
			 (substitute-command-keys "\\[Info-history-back]")
			 (if (> num-matches 2) "them" "it")))))
      (error "Couldn't find documentation for %s" command))))