Function: Info-revert-find-node

Info-revert-find-node is a byte-compiled function defined in info.el.gz.

Signature

(Info-revert-find-node FILENAME NODENAME)

Documentation

Go to an Info node FILENAME and NODENAME, re-reading disk contents.

When *info* is already displaying FILENAME and NODENAME, the window position is preserved, if possible.

Source Code

;; Defined in /usr/src/emacs/lisp/info.el.gz
(defun Info-revert-find-node (filename nodename)
  "Go to an Info node FILENAME and NODENAME, re-reading disk contents.
When *info* is already displaying FILENAME and NODENAME, the window position
is preserved, if possible."
  (or (derived-mode-p 'Info-mode) (info-pop-to-buffer filename))
  (let ((old-filename Info-current-file)
	(old-nodename Info-current-node)
	(window-selected (eq (selected-window) (get-buffer-window)))
	(pcolumn      (current-column))
	(pline        (count-lines (point-min) (line-beginning-position)))
	(wline        (count-lines (point-min) (window-start)))
	(new-history  (and Info-current-file
			   (list Info-current-file Info-current-node (point)))))
    ;; When `Info-current-file' is nil, `Info-find-node-2' rereads the file.
    (setq Info-current-file nil)
    (Info-find-node filename nodename)
    (if (and (equal old-filename Info-current-file)
	     (equal old-nodename Info-current-node))
	(progn
	  ;; note goto-line is no good, we want to measure from point-min
	  (when window-selected
	    (goto-char (point-min))
	    (forward-line wline)
	    (set-window-start (selected-window) (point)))
	  (goto-char (point-min))
	  (forward-line pline)
	  (move-to-column pcolumn))
      ;; only add to the history when coming from a different file+node
      (if new-history
	  (setq Info-history (cons new-history Info-history))))))