summaryrefslogtreecommitdiff
path: root/lisp/info.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2004-10-28 09:02:04 +0000
committerJuri Linkov <juri@jurta.org>2004-10-28 09:02:04 +0000
commit02c9f5cd8af92935fa083a2f604be8f7edab03d0 (patch)
tree9df4cefa49374807364c96b1aa41106ccff679be /lisp/info.el
parent1bcd42e2fe8c27c18c8f08f6dfb04c6a98cca8e1 (diff)
downloademacs-02c9f5cd8af92935fa083a2f604be8f7edab03d0.tar.gz
(Info-file-list-for-emacs): Add ("Info" . "info")
to search `Info-...' commands in `info' manual. (Info-goto-emacs-command-node, Info-goto-emacs-key-command-node): Add 'info-file "emacs" property. (Info-find-emacs-command-nodes): Fix index line number regexp. Set real line number (instead of fake 0) in first element of the returned list. (Info-goto-emacs-command-node): Use line number of first element to set point in the first found Info node.
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el31
1 files changed, 21 insertions, 10 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 4fc7b5c9cf7..2e0ddd0fb02 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1980,7 +1980,7 @@ Because of ambiguities, this should be concatenated with something like
(if (match-beginning 5)
(string-to-number (match-string 5))
(buffer-substring (match-beginning 0) (1- (match-beginning 1)))))
-;;; Comment out the next line to use names of cross-references:
+;;; Uncomment next line to use names of cross-references in non-index nodes:
;;; (setq Info-point-loc
;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1))))
)
@@ -3214,7 +3214,7 @@ Allowed only if variable `Info-enable-edit' is non-nil."
(message "Tags may have changed. Use Info-tagify if necessary")))
(defvar Info-file-list-for-emacs
- '("ediff" "eudc" "forms" "gnus" "info" ("mh" . "mh-e")
+ '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e")
"sc" "message" ("dired" . "dired-x") "viper" "vip" "idlwave"
("c" . "ccmode") ("c++" . "ccmode") ("objc" . "ccmode")
("java" . "ccmode") ("idl" . "ccmode") ("pike" . "ccmode")
@@ -3245,11 +3245,13 @@ The `info-file' property of COMMAND says which Info manual to search.
If COMMAND has no property, the variable `Info-file-list-for-emacs'
defines heuristics for which Info manual to try.
The locations are of the format used in `Info-history', i.e.
-\(FILENAME NODENAME BUFFERPOS\)."
- (let ((where '())
+\(FILENAME NODENAME BUFFERPOS\), where BUFFERPOS is the line number
+in the first element of the returned list (which is treated specially in
+`Info-goto-emacs-command-node'), and 0 for the rest elements of a list."
+ (let ((where '()) line-number
(cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command))
"\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\."
- "\\([ \t]*(line[ \t]*[0-9]*)\\)?$"))
+ "\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?"))
(info-file "emacs")) ;default
;; Determine which info file this command is documented in.
(if (get command 'info-file)
@@ -3288,11 +3290,17 @@ The locations are of the format used in `Info-history', i.e.
(cons (list Info-current-file
(match-string-no-properties 2)
0)
- where)))
+ where))
+ (setq line-number (and (match-beginning 3)
+ (string-to-number (match-string 3)))))
(and (setq nodes (cdr nodes) node (car nodes))))
(Info-goto-node node)))
- where))
+ (if (and line-number where)
+ (cons (list (nth 0 (car where)) (nth 1 (car where)) line-number)
+ (cdr where))
+ where)))
+;;;###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.
@@ -3316,9 +3324,11 @@ COMMAND must be a symbol or string."
;; 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))
- (Info-find-node (car (car where))
- (car (cdr (car where)))))
+ (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
@@ -3332,6 +3342,7 @@ COMMAND must be a symbol or string."
(if (> num-matches 2) "them" "it")))))
(error "Couldn't find documentation for %s" command))))
+;;;###autoload (put 'Info-goto-emacs-key-command-node 'info-file "emacs")
;;;###autoload
(defun Info-goto-emacs-key-command-node (key)
"Go to the node in the Emacs manual which describes the command bound to KEY.