comparison lisp/info.el @ 90043:e24e2e78deda

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-69 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-643 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-649 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-651 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-655 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-656 Update from CVS: lisp/man.el (Man-xref-normal-file): Fix help-echo. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-657 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-658 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-659 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-661 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-667 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-61 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-68 Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 04 Nov 2004 08:55:40 +0000
parents 0fe073a08cef c7ff2d3a33ee
children cb7f41387eb3
comparison
equal deleted inserted replaced
90042:003d95404d71 90043:e24e2e78deda
1978 (if index-node 1978 (if index-node
1979 (setq Info-point-loc 1979 (setq Info-point-loc
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 )
1987 (replace-regexp-in-string 1987 (replace-regexp-in-string
1988 "[ \n]+" " " 1988 "[ \n]+" " "
3212 (and (marker-position Info-tag-table-marker) 3212 (and (marker-position Info-tag-table-marker)
3213 (buffer-modified-p) 3213 (buffer-modified-p)
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")
3221 ("skeleton" . "autotype") ("auto-insert" . "autotype") 3221 ("skeleton" . "autotype") ("auto-insert" . "autotype")
3222 ("copyright" . "autotype") ("executable" . "autotype") 3222 ("copyright" . "autotype") ("executable" . "autotype")
3243 "Return a list of locations documenting COMMAND. 3243 "Return a list of locations documenting COMMAND.
3244 The `info-file' property of COMMAND says which Info manual to search. 3244 The `info-file' property of COMMAND says which Info manual to search.
3245 If COMMAND has no property, the variable `Info-file-list-for-emacs' 3245 If COMMAND has no property, the variable `Info-file-list-for-emacs'
3246 defines heuristics for which Info manual to try. 3246 defines heuristics for which Info manual to try.
3247 The locations are of the format used in `Info-history', i.e. 3247 The 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 '()) 3249 in 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)
3256 (setq info-file (get command 'info-file)) 3258 (setq info-file (get command 'info-file))
3257 ;; If it doesn't say explicitly, test its name against 3259 ;; If it doesn't say explicitly, test its name against
3286 (while (re-search-forward cmd-desc nil t) 3288 (while (re-search-forward cmd-desc nil t)
3287 (setq where 3289 (setq where
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)
3295 3299 (cons (list (nth 0 (car where)) (nth 1 (car where)) line-number)
3300 (cdr where))
3301 where)))
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.
3299 The command is found by looking up in Emacs manual's indices 3307 The command is found by looking up in Emacs manual's indices
3300 or in another manual found via COMMAND's `info-file' property or 3308 or in another manual found via COMMAND's `info-file' property or
3314 (info)) 3322 (info))
3315 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")) 3323 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
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
3325 ;; when/if they go to another node. Put the other 3335 ;; when/if they go to another node. Put the other
3326 ;; nodes that were found on the history. 3336 ;; nodes that were found on the history.
3330 (if (> num-matches 2) "ies" "y") 3340 (if (> num-matches 2) "ies" "y")
3331 (substitute-command-keys "\\[Info-last]") 3341 (substitute-command-keys "\\[Info-last]")
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.
3338 KEY is a string. 3349 KEY is a string.
3339 Interactively, if the binding is `execute-extended-command', a command is read. 3350 Interactively, if the binding is `execute-extended-command', a command is read.