@@ -30,10 +30,16 @@ Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
"Non-nil allows Info to execute Lisp code associated with nodes.
The Lisp code is executed when the node is selected.")
(defvarInfo-directory-listt
(defvarInfo-default-directory-listnil
"List of default directories to search for Info documentation files.
This value is used as the default for `Info-directory-list'. It is set
in paths.el.")
(defvarInfo-directory-listnil
"List of directories to search for Info documentation files.
t means not yet initialized. In this case, Info uses the environment
variable INFODIR to initialize it.")
nil means not yet initialized. In this case, Info uses the environment
variable INFODIR to initialize it, or `Info-default-directory-list'
if there is no INFODIR variable in the environment.")
(defvarInfo-current-filenil
"Info file that Info is now looking at, or nil.")
...
...
@@ -59,15 +65,19 @@ In interactive use, a prefix argument directs this command
to read a file name from the minibuffer."
(interactive(ifcurrent-prefix-arg
(list(read-file-name"Info file name: "nilnilt))))
(if(eqInfo-directory-listt)
(let((path(getenv"INFOPATH"))
list)
(andpath
(while(>(lengthpath)0)
(let((idx(or(string-match":"path)(lengthpath))))
(setqlist(cons(substringpath0idx)list)
path(substringpath(min(1+idx)(lengthpath)))))))
(setqInfo-directory-list(nreverselist))))
(orInfo-directory-list
(setqInfo-directory-list
(let((path(getenv"INFOPATH")))
(ifpath
(let((listnil)
idx)
(while(>(lengthpath)0)
(setqidx(or(string-match":"path)(lengthpath))
list(cons(substringpath0idx)list)
path(substringpath(min(1+idx)
(lengthpath)))))
(nreverselist))
Info-default-directory-list))))
(iffile
(Info-goto-node(concat"("file")"))
(if(get-buffer"*info*")
...
...
@@ -299,6 +309,14 @@ to read a file name from the minibuffer."
(Info-find-node(if(equalfilename"")nilfilename)
(if(equalnodename"")"Top"nodename))))
(defunInfo-restore-point(hl)
"If this node has been visited, restore the point value when we left."
(ifhl
(if(and(equal(nth0(carhl))Info-current-file)
(equal(nth1(carhl))Info-current-node))
(goto-char(nth2(carhl)))
(Info-restore-point(cdrhl)))))
(defvarInfo-last-searchnil
"Default regexp for \\<info-mode-map>\\[Info-search] command to search for.")
...
...
@@ -407,7 +425,8 @@ to read a file name from the minibuffer."
(defunInfo-up()
"Go to the superior node of this node."
(interactive)
(Info-goto-node(Info-extract-pointer"up")))
(Info-goto-node(Info-extract-pointer"up"))
(Info-restore-pointInfo-history))
(defunInfo-last()
"Go back to the last node visited."
...
...
@@ -536,9 +555,9 @@ Completion is allowed, and the menu item point is on is the default."
default)
"Menu item: ")
completionsnilt)))
;; we rely on the bug (which RMS won't change for his own reasons)
;; that ;; completing-read accepts an input of "" even when the
;; require-match argument is true and "" is not a valid possibility
;; we rely on the fact that completing-read accepts an input
;; of "" even when the require-match argument is true and ""
;; is not a valid possibility
(if(string=item"")
(ifdefault
(setqitemdefault)
...
...
@@ -736,14 +755,14 @@ SIG optional fourth argument, controls action on no match
(t
(error"No %s around position %d"errorstringpos))))))
(defunInfo-follow-nearest-node(event)
(defunInfo-follow-nearest-node(click)
"\\<Info-mode-map>Follow a node reference near point. Like \\[Info-menu], \\Info-follow-reference], \\[Info-next], \\[Info-previous] or \\Info-up] command.
At end of the node's text, moves to the next node."