;; info.el --- info package for Emacs
;; Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Maintainer: FSF
(let (same-window-buffer-names same-window-regexps)
(info file-or-node)))
-;;;###autoload (add-hook 'same-window-regexps "\\*info\\*\\(\\|<[0-9]+>\\)")
+;;;###autoload (add-hook 'same-window-regexps (purecopy "\\*info\\*\\(\\|<[0-9]+>\\)"))
-;;;###autoload (put 'info 'info-file "emacs")
+;;;###autoload (put 'info 'info-file (purecopy "emacs"))
;;;###autoload
(defun info (&optional file-or-node buffer)
"Enter Info, the documentation browser.
(cond
((functionp virtual-fun)
(let ((filename (or filename Info-current-file)))
- (setq buffer-file-name nil)
(setq buffer-read-only nil)
+ (setq Info-current-file filename
+ Info-current-subfile nil
+ Info-current-file-completions nil
+ buffer-file-name nil)
(erase-buffer)
- (setq Info-current-file filename)
(Info-virtual-call virtual-fun filename nodename no-going-back)
(set-marker Info-tag-table-marker nil)
(setq buffer-read-only t)
(equal Info-current-file filename))))
;; Switch files if necessary
(let ((inhibit-read-only t))
- (if (and Info-current-node-virtual (null filename))
- (setq filename Info-current-file))
+ (when Info-current-node-virtual
+ ;; When moving from a virtual node.
+ (set (make-local-variable 'Info-current-node-virtual) nil)
+ (if (null filename)
+ (setq filename Info-current-file)))
(setq Info-current-file nil
Info-current-subfile nil
Info-current-file-completions nil
"\\(\0[\0-\37][[][^\0]*\0[\0-\37][]]\n?\\)"
nil t)
(let* ((start (match-beginning 1)))
- (if (not (get-text-property start 'invisible))
+ (if (and (not (get-text-property start 'invisible))
+ (not (get-text-property start 'display)))
(put-text-property start (point) 'invisible t)))))
(set-buffer-modified-p nil)))
nextnode)
(goto-char (point-min))
(search-forward "\n* Menu:")
- (if (not (memq action '(nil t)))
- (re-search-forward
- (concat "\n\\* +" (regexp-quote string) ":") nil t)
+ (cond
+ ((eq (car-safe action) 'boundaries) nil)
+ ((eq action 'lambda)
+ (re-search-forward
+ (concat "\n\\* +" (regexp-quote string) ":") nil t))
+ (t
(let ((pattern (concat "\n\\* +\\("
(regexp-quote string)
- Info-menu-entry-name-re "\\):" Info-node-spec-re))
+ Info-menu-entry-name-re "\\):"
+ Info-node-spec-re))
completions
(complete-nodes Info-complete-nodes))
;; Check the cache.
(list Info-current-file Info-current-node
Info-complete-next-re string completions
Info-complete-nodes)))
- (if action
- (all-completions string completions predicate)
- (try-completion string completions predicate))))))))
+ (complete-with-action action completions string predicate))))))))
(defun Info-menu (menu-item &optional fork)
a new Info buffer. If FORK is a string, it is the name to use for the
new buffer."
(interactive
- (let ((completions '())
- ;; If point is within a menu item, use that item as the default
+ (let (;; If point is within a menu item, use that item as the default
(default nil)
(p (point))
beg
- (last nil)
(case-fold-search t))
(save-excursion
(goto-char (point-min))
(setq file (Info-find-file file))))
default-directory))
Info-history Info-history-list Info-fontify-maximum-menu-size
- (main-file file) subfiles nodes node)
+ (main-file file) subfiles nodes)
(condition-case nil
(with-temp-buffer
(while (or main-file subfiles)
(Info-goto-node (car nodes))
(while (and (setq node (Info-extract-pointer "next" t))
(string-match "\\<Index\\>" node))
- (setq nodes (cons node nodes))
+ (push node nodes)
(Info-goto-node node))))
(error nil))
(if nodes
:help "Look for a string in the index items"]
["Next Matching Item" Info-index-next :active Info-index-alternatives
:help "Look for another occurrence of previous item"]
+ ["Lookup a string and display index of results..." Info-virtual-index
+ :help "Look for a string in the index items and display node with results"]
["Lookup a string in all indices..." info-apropos
:help "Look for a string in the indices of all manuals"])
["Copy Node Name" Info-copy-current-node-name
\\[isearch-forward], \\[isearch-forward-regexp] Use Isearch to search through multiple Info nodes.
\\[Info-index] Search for a topic in this manual's Index and go to index entry.
\\[Info-index-next] (comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command.
+\\[Info-virtual-index] Look for a string and display the index node with results.
\\[info-apropos] Look for a string in the indices of all manuals.
\\[Info-goto-node] Move to node specified by name.
You may include a filename as well, as (FILENAME)NODENAME.
(cdr where))
where)))
-;;;###autoload (put 'Info-goto-emacs-command-node 'info-file "emacs")
+;;;###autoload (put 'Info-goto-emacs-command-node 'info-file (purecopy "emacs"))
;;;###autoload
(defun Info-goto-emacs-command-node (command)
"Go to the Info node in the Emacs manual for command COMMAND.
(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 (put 'Info-goto-emacs-key-command-node 'info-file (purecopy "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.
(let ((command (key-binding key)))
(cond ((null command)
(message "%s is undefined" (key-description key)))
- ((and (interactive-p)
+ ((and (called-interactively-p 'interactive)
(eq command 'execute-extended-command))
(Info-goto-emacs-command-node
(read-command "Find documentation for command: ")))
(declare-function bookmark-get-bookmark-record "bookmark" (bmk))
(defun Info-bookmark-make-record ()
+ "This implements the `bookmark-make-record-function' type (which see)
+for Info nodes."
`(,Info-current-node
,@(bookmark-make-record-default 'point-only)
(filename . ,Info-current-file)
;;;###autoload
(defun Info-bookmark-jump (bmk)
- ;; This implements the `handler' function interface for record type returned
- ;; by `Info-bookmark-make-record', which see.
+ "This implements the `handler' function interface for the record
+type returned by `Info-bookmark-make-record', which see."
(let* ((file (bookmark-prop-get bmk 'filename))
(info-node (bookmark-prop-get bmk 'info-node))
(buf (save-window-excursion ;FIXME: doesn't work with frames!