aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2004-10-28 09:02:04 +0000
committerJuri Linkov2004-10-28 09:02:04 +0000
commit02c9f5cd8af92935fa083a2f604be8f7edab03d0 (patch)
tree9df4cefa49374807364c96b1aa41106ccff679be
parent1bcd42e2fe8c27c18c8f08f6dfb04c6a98cca8e1 (diff)
downloademacs-02c9f5cd8af92935fa083a2f604be8f7edab03d0.tar.gz
emacs-02c9f5cd8af92935fa083a2f604be8f7edab03d0.zip
(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.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/info.el31
2 files changed, 38 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 072a498ed70..83a01bdd2ed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,20 @@
12004-10-28 Juri Linkov <juri@jurta.org>
2
3 * info.el (Info-file-list-for-emacs): Add ("Info" . "info")
4 to search `Info-...' commands in `info' manual.
5 (Info-goto-emacs-command-node, Info-goto-emacs-key-command-node):
6 Add 'info-file "emacs" property.
7 (Info-find-emacs-command-nodes): Fix index line number regexp.
8 Set real line number (instead of fake 0) in first element of the
9 returned list.
10 (Info-goto-emacs-command-node): Use line number of first element
11 to set point in the first found Info node.
12
13 * progmodes/grep.el (grep-regexp-alist): Move match highlighting
14 code to `grep-mode-font-lock-keywords'.
15 (grep-mode-font-lock-keywords): Delete grep markers instead
16 of making them invisible.
17
12004-10-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 182004-10-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 19
3 * mail/emacsbug.el (report-emacs-bug): Insert x-server-vendor 20 * mail/emacsbug.el (report-emacs-bug): Insert x-server-vendor
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
1980 (if (match-beginning 5) 1980 (if (match-beginning 5)
1981 (string-to-number (match-string 5)) 1981 (string-to-number (match-string 5))
1982 (buffer-substring (match-beginning 0) (1- (match-beginning 1))))) 1982 (buffer-substring (match-beginning 0) (1- (match-beginning 1)))))
1983;;; Comment out the next line to use names of cross-references: 1983;;; Uncomment next line to use names of cross-references in non-index nodes:
1984;;; (setq Info-point-loc 1984;;; (setq Info-point-loc
1985;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1)))) 1985;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1))))
1986 ) 1986 )
@@ -3214,7 +3214,7 @@ Allowed only if variable `Info-enable-edit' is non-nil."
3214 (message "Tags may have changed. Use Info-tagify if necessary"))) 3214 (message "Tags may have changed. Use Info-tagify if necessary")))
3215 3215
3216(defvar Info-file-list-for-emacs 3216(defvar Info-file-list-for-emacs
3217 '("ediff" "eudc" "forms" "gnus" "info" ("mh" . "mh-e") 3217 '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e")
3218 "sc" "message" ("dired" . "dired-x") "viper" "vip" "idlwave" 3218 "sc" "message" ("dired" . "dired-x") "viper" "vip" "idlwave"
3219 ("c" . "ccmode") ("c++" . "ccmode") ("objc" . "ccmode") 3219 ("c" . "ccmode") ("c++" . "ccmode") ("objc" . "ccmode")
3220 ("java" . "ccmode") ("idl" . "ccmode") ("pike" . "ccmode") 3220 ("java" . "ccmode") ("idl" . "ccmode") ("pike" . "ccmode")
@@ -3245,11 +3245,13 @@ The `info-file' property of COMMAND says which Info manual to search.
3245If COMMAND has no property, the variable `Info-file-list-for-emacs' 3245If COMMAND has no property, the variable `Info-file-list-for-emacs'
3246defines heuristics for which Info manual to try. 3246defines heuristics for which Info manual to try.
3247The locations are of the format used in `Info-history', i.e. 3247The locations are of the format used in `Info-history', i.e.
3248\(FILENAME NODENAME BUFFERPOS\)." 3248\(FILENAME NODENAME BUFFERPOS\), where BUFFERPOS is the line number
3249 (let ((where '()) 3249in the first element of the returned list (which is treated specially in
3250`Info-goto-emacs-command-node'), and 0 for the rest elements of a list."
3251 (let ((where '()) line-number
3250 (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command)) 3252 (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command))
3251 "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\." 3253 "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\."
3252 "\\([ \t]*(line[ \t]*[0-9]*)\\)?$")) 3254 "\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?"))
3253 (info-file "emacs")) ;default 3255 (info-file "emacs")) ;default
3254 ;; Determine which info file this command is documented in. 3256 ;; Determine which info file this command is documented in.
3255 (if (get command 'info-file) 3257 (if (get command 'info-file)
@@ -3288,11 +3290,17 @@ The locations are of the format used in `Info-history', i.e.
3288 (cons (list Info-current-file 3290 (cons (list Info-current-file
3289 (match-string-no-properties 2) 3291 (match-string-no-properties 2)
3290 0) 3292 0)
3291 where))) 3293 where))
3294 (setq line-number (and (match-beginning 3)
3295 (string-to-number (match-string 3)))))
3292 (and (setq nodes (cdr nodes) node (car nodes)))) 3296 (and (setq nodes (cdr nodes) node (car nodes))))
3293 (Info-goto-node node))) 3297 (Info-goto-node node)))
3294 where)) 3298 (if (and line-number where)
3299 (cons (list (nth 0 (car where)) (nth 1 (car where)) line-number)
3300 (cdr where))
3301 where)))
3295 3302
3303;;;###autoload (put 'Info-goto-emacs-command-node 'info-file "emacs")
3296;;;###autoload 3304;;;###autoload
3297(defun Info-goto-emacs-command-node (command) 3305(defun Info-goto-emacs-command-node (command)
3298 "Go to the Info node in the Emacs manual for command COMMAND. 3306 "Go to the Info node in the Emacs manual for command COMMAND.
@@ -3316,9 +3324,11 @@ COMMAND must be a symbol or string."
3316 ;; Bind Info-history to nil, to prevent the last Index node 3324 ;; Bind Info-history to nil, to prevent the last Index node
3317 ;; visited by Info-find-emacs-command-nodes from being 3325 ;; visited by Info-find-emacs-command-nodes from being
3318 ;; pushed onto the history. 3326 ;; pushed onto the history.
3319 (let ((Info-history nil) (Info-history-list nil)) 3327 (let ((Info-history nil) (Info-history-list nil)
3320 (Info-find-node (car (car where)) 3328 (line-number (nth 2 (car where))))
3321 (car (cdr (car where))))) 3329 (Info-find-node (nth 0 (car where)) (nth 1 (car where)))
3330 (if (and (integerp line-number) (> line-number 0))
3331 (forward-line (1- line-number))))
3322 (if (> num-matches 1) 3332 (if (> num-matches 1)
3323 (progn 3333 (progn
3324 ;; (car where) will be pushed onto Info-history 3334 ;; (car where) will be pushed onto Info-history
@@ -3332,6 +3342,7 @@ COMMAND must be a symbol or string."
3332 (if (> num-matches 2) "them" "it"))))) 3342 (if (> num-matches 2) "them" "it")))))
3333 (error "Couldn't find documentation for %s" command)))) 3343 (error "Couldn't find documentation for %s" command))))
3334 3344
3345;;;###autoload (put 'Info-goto-emacs-key-command-node 'info-file "emacs")
3335;;;###autoload 3346;;;###autoload
3336(defun Info-goto-emacs-key-command-node (key) 3347(defun Info-goto-emacs-key-command-node (key)
3337 "Go to the node in the Emacs manual which describes the command bound to KEY. 3348 "Go to the node in the Emacs manual which describes the command bound to KEY.