• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching +defs:Info +defs:default +defs:directory +defs:list

28 ;; Note that nowadays we expect Info files to be made using makeinfo.
41 "Info subsystem."
46 (defvar Info-history nil
47 "Stack of Info nodes user has visited.
48 Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
50 (defvar Info-history-forward nil
51 "Stack of Info nodes user has visited with `Info-history-back' command.
52 Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).")
54 (defvar Info-history-list nil
55 "List of all Info nodes user has visited.
56 Each element of the list is a list (FILENAME NODENAME).")
58 (defcustom Info-enable-edit nil
59 "*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node.
60 This is convenient if you want to write Info files by hand.
62 It is better to write a Texinfo file and generate the Info file from that,
67 (defvar Info-enable-active-nodes nil
68 "Non-nil allows Info to execute Lisp code associated with nodes.
70 (put 'Info-enable-active-nodes 'risky-local-variable t)
76 "Face for Info node names."
88 (put 'Info-title-1-face 'face-alias 'info-title-1)
96 (put 'Info-title-2-face 'face-alias 'info-title-2)
104 (put 'Info-title-3-face 'face-alias 'info-title-3)
112 (put 'Info-title-4-face 'face-alias 'info-title-4)
121 "Face for headers in Info menus."
127 "Face for every third `*' in an Info menu."
133 "Face for unvisited Info cross-references."
138 "Face for visited Info cross-references."
142 (defcustom Info-fontify-visited-nodes t
148 (defcustom Info-fontify-maximum-menu-size 100000
154 (defcustom Info-use-header-line t
162 "Face for Info cross-references in a node header."
167 "Face for Info nodes in a node header."
170 (defvar Info-directory-list nil
171 "List of directories to search for Info documentation files.
172 If nil, meaning not yet initialized, Info uses the environment
173 variable INFOPATH to initialize it, or `Info-default-directory-list'
177 When `Info-directory-list' is initialized from the value of
178 `Info-default-directory-list', and Emacs is installed in one of the
179 standard directories, the directory of Info files that come with Emacs
180 is put last (so that local Info files override standard ones).
182 When `Info-directory-list' is initialized from the value of
183 `Info-default-directory-list', and Emacs is not installed in one
185 list is the directory where Emacs installs the Info files that
192 `Info-default-directory-list', set INFOPATH in the environment.
194 If you run the Emacs executable from the `src' directory in the Emacs
195 source tree, and INFOPATH is not defined, the `info' directory in the
196 source tree is used as the first element of `Info-directory-list', in
197 place of the installation Info directory. This is useful when you run
200 (defcustom Info-additional-directory-list nil
201 "List of additional directories to search for Info documentation files.
202 These directories are searched after those in `Info-directory-list'."
203 :type '(repeat directory)
206 (defcustom Info-scroll-prefer-subnodes nil
207 "*If non-nil, \\<Info-mode-map>\\[Info-scroll-up] in a menu visits subnodes.
210 appears on the screen, the next \\<Info-mode-map>\\[Info-scroll-up]
215 Info reader program, which visits the first subnode from the menu only
221 (defcustom Info-hide-note-references t
233 (defcustom Info-refill-paragraphs nil
235 This refilling may accidentally remove explicit line breaks in the Info
241 (defcustom Info-search-whitespace-regexp "\\s-+"
243 This applies to Info search for regular expressions.
250 (defcustom Info-isearch-search t
251 "*If non-nil, isearch in Info searches through multiple nodes.
252 Before leaving the initial Info node, where isearch was started,
260 Setting this option to nil restores the default isearch behavior
261 with wrapping around the current Info node."
266 (defvar Info-isearch-initial-node nil)
268 (defcustom Info-mode-hook
269 ;; Try to obey obsolete Info-fontify settings.
270 (unless (and (boundp 'Info-fontify) (null Info-fontify))
272 "Hooks run when `Info-mode' is called."
276 (defcustom Info-selection-hook nil
277 "Hooks run when `Info-select-node' is called."
281 (defvar Info-edit-mode-hook nil
282 "Hooks run when `Info-edit-mode' is called.")
284 (defvar Info-current-file nil
285 "Info file that Info is now looking at, or nil.
286 This is the name that was specified in Info, not the actual file name.
287 It doesn't contain directory names or file name extensions added by Info.")
289 (defvar Info-current-subfile nil
290 "Info subfile that is actually in the *info* buffer now.
291 It is nil if current Info file is not split into subfiles.")
293 (defvar Info-current-node nil
294 "Name of node that Info is now looking at, or nil.")
296 (defvar Info-tag-table-marker nil
297 "Marker pointing at beginning of current Info file's tag table.
300 (defvar Info-tag-table-buffer nil
303 (defvar Info-current-file-completions nil
304 "Cached completion list for current Info file.")
306 (defvar Info-file-supports-index-cookies nil
307 "Non-nil if current Info file supports index cookies.")
309 (defvar Info-index-alternatives nil
310 "List of possible matches for last `Info-index' command.")
312 (defvar Info-point-loc nil
318 (defvar Info-standalone nil
319 "Non-nil if Emacs was started solely as an Info browser.")
322 (defvar Info-suffix-list
323 ;; The MS-DOS list should work both when long file names are
370 STRING may be a list of strings. In that case, the first element is
375 be last in the list.")
402 (not (file-directory-p filename))))
405 "Insert the contents of an Info file in the current buffer.
407 (let* ((tail Info-suffix-list)
454 (default-directory (or (file-name-directory fullname)
455 default-directory)))
457 (setq decoder (list decoder)))
463 (defun Info-default-dirs ()
464 (let ((source (expand-file-name "info/" source-directory))
465 (sibling (if installation-directory
466 (expand-file-name "info/" installation-directory)
467 (if invocation-directory
470 invocation-directory)))
475 invocation-directory))
485 (if (or (member alternative Info-default-directory-list)
487 ;; and we must always find the Info dir at run time.
490 ;; Use invocation-directory for Info
491 ;; only if we used it for exec-directory also.
492 (not (string= exec-directory
494 installation-directory))))
496 Info-default-directory-list
497 ;; `alternative' contains the Info files that came with this
498 ;; version, so we should look there first. `Info-insert-dir'
499 ;; currently expects to find `alternative' first on the list.
503 Info-default-directory-list)))) ;; )))
506 "Initialize `Info-directory-list', if that hasn't been done yet."
507 (unless Info-directory-list
509 (setq Info-directory-list
510 (prune-directory-list
515 (Info-default-dirs))
517 (Info-default-dirs)))))))
521 "Like `info' but show the Info buffer in another window."
523 (list (read-file-name "Info file name: " nil nil t))))
532 "Enter Info, the documentation browser.
534 the default is the top-level directory of Info.
535 Called from a program, FILE-OR-NODE may specify an Info node of the form
537 Optional argument BUFFER specifies the Info buffer name;
538 the default buffer name is *info*. If BUFFER exists,
540 with the top-level Info directory.
544 A numeric prefix argument selects an Info buffer with the prefix number
545 appended to the Info buffer name.
547 The search path for Info files is in the variable `Info-directory-list'.
548 The top-level Info directory is made by combining all the files named `dir'
550 (interactive (list
552 (read-file-name "Info file name: " nil nil t))
556 (if (and buffer (not (eq major-mode 'Info-mode)))
557 (Info-mode))
563 (Info-goto-node
568 (null Info-history))
569 ;; If we just created the Info buffer, go to the directory.
570 (Info-directory))))
574 "Display the Emacs manual in Info mode."
580 "Run Emacs as a standalone Info reader.
582 In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
583 (setq Info-standalone t)
608 (defun Info-node-at-bob-matching (regexp)
617 (defun Info-find-file (filename &optional noerror)
632 ;; then just try current directory.
638 (if Info-additional-directory-list
639 (append Info-directory-list
640 Info-additional-directory-list)
641 Info-directory-list)))))
642 ;; Search the directory list for file FILENAME.
648 (let ((suffix-list Info-suffix-list)
652 (while (and suffix-list (not found))
655 temp (car (car suffix-list)) lfn))
659 temp-downcase (car (car suffix-list)) lfn))
665 temp (car (car suffix-list)) nil)))
667 (setq suffix-list (cdr suffix-list))))
673 (error "Info file %s does not exist" filename)))
677 (defun Info-find-node (filename nodename &optional no-going-back)
678 "Go to an Info node specified as separate FILENAME and NODENAME.
682 (setq filename (Info-find-file filename))
683 ;; Go into Info buffer.
684 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
687 Info-current-file
688 (setq Info-history
689 (cons (list Info-current-file Info-current-node (point))
690 Info-history)))
691 (Info-find-node-2 filename nodename no-going-back))
694 (defun Info-on-current-buffer (&optional nodename)
695 "Use Info mode to browse the current Info buffer.
699 (list (if current-prefix-arg
700 (completing-read "Node name: " (Info-build-node-completions)
704 (Info-mode)
705 (set (make-local-variable 'Info-current-file)
708 (concat default-directory (buffer-name))))
709 (Info-find-node-2 nil nodename))
715 (defun Info-revert-find-node (filename nodename)
716 "Go to an Info node FILENAME and NODENAME, re-reading disk contents.
720 (let ((old-filename Info-current-file)
721 (old-nodename Info-current-node)
725 (old-history Info-history)
726 (new-history (and Info-current-file
727 (list Info-current-file Info-current-node (point)))))
729 (Info-find-node filename nodename)
730 (setq Info-history old-history)
731 (if (and (equal old-filename Info-current-file)
732 (equal old-nodename Info-current-node))
743 (setq Info-history (cons new-history Info-history))))))
745 (defun Info-find-in-tag-table-1 (marker regexp case-fold)
751 If a match was found, value is a list (FOUND-ANCHOR POS MODE), where
763 (list (string-equal "Ref:" (match-string 1))
767 (defun Info-find-in-tag-table (marker regexp)
772 If a match was found, value is a list (FOUND-ANCHOR POS MODE), where
778 (let ((result (Info-find-in-tag-table-1 marker regexp nil)))
780 (setq result (Info-find-in-tag-table-1 marker regexp t)))
783 (defun Info-find-node-in-buffer-1 (regexp case-fold)
792 (when (Info-node-at-bob-matching regexp)
804 (defun Info-find-node-in-buffer (regexp)
811 (or (Info-find-node-in-buffer-1 regexp nil)
812 (Info-find-node-in-buffer-1 regexp t)))
814 (defun Info-find-node-2 (filename nodename &optional no-going-back)
816 (or (eq major-mode 'Info-mode)
817 (Info-mode))
819 (setq Info-current-node nil)
825 (equal Info-current-file filename)
827 (setq Info-current-file nil
828 Info-current-subfile nil
829 Info-current-file-completions nil
834 (Info-insert-dir))
843 (setq default-directory (file-name-directory filename))))
856 (set (make-local-variable 'Info-file-supports-index-cookies) found))
877 (or Info-tag-table-buffer
879 (setq Info-tag-table-buffer tagbuf)
886 (set-marker Info-tag-table-marker
888 (set-marker Info-tag-table-marker pos)))
889 (set-marker Info-tag-table-marker nil))
890 (setq Info-current-file
897 (progn (setq Info-current-node nodename)
898 (Info-set-mode-line))
921 (when (marker-position Info-tag-table-marker)
922 (let* ((m Info-tag-table-marker)
923 (found (Info-find-in-tag-table m regexp)))
931 (unless (eq (nth 2 found) 'Info-mode)
934 ;; Info-read-subfile. Thus the hackery above.
935 (setq guesspos (Info-read-subfile guesspos)))
950 (let ((pos (Info-find-node-in-buffer regexp)))
956 (let (Info-point-loc)
957 (Info-find-node-2
965 (Info-select-node)
968 (let ((new-history (list Info-current-file
971 (setq Info-history-list
973 (delete new-history Info-history-list))))
975 ((numberp Info-point-loc)
976 (forward-line (1- Info-point-loc))
977 (setq Info-point-loc nil))
978 ((stringp Info-point-loc)
979 (Info-find-index-name Info-point-loc)
980 (setq Info-point-loc nil))))))
983 (or Info-current-node no-going-back (null Info-history)
984 (let ((hist (car Info-history)))
985 (setq Info-history (cdr Info-history))
986 (Info-find-node (nth 0 hist) (nth 1 hist) t)
991 (defvar Info-dir-contents nil)
993 ;; Cache for the directory we decided to use for the default-directory
995 (defvar Info-dir-contents-directory nil)
998 ;; constructed Info-dir-contents.
999 (defvar Info-dir-file-attributes nil)
1001 (defvar Info-dir-file-name nil)
1003 ;; Construct the Info directory node by merging the files named `dir'
1005 ;; default-directory to the first directory we actually get any text
1007 (defun Info-insert-dir ()
1008 (if (and Info-dir-contents Info-dir-file-attributes
1021 Info-dir-file-attributes))))
1023 (insert Info-dir-contents)
1025 (let ((dirs (if Info-additional-directory-list
1026 (append Info-directory-list
1027 Info-additional-directory-list)
1028 Info-directory-list))
1036 ;; Search the directory list for the directory file.
1040 (member (directory-file-name truename) dirs-done)
1056 (cons (directory-file-name truename)
1061 (message "Composing main Info directory..."))
1066 (set (make-local-variable 'Info-dir-file-name)
1072 (set (make-local-variable 'Info-dir-contents-directory)
1073 (file-name-as-directory (car dirs))))
1077 (error "Can't find the Info directory node"))
1081 ;; The definition of `Info-directory-list' puts it first on that
1082 ;; list and so last in `buffers' at this point.
1087 ;; already saved its default directory to use as the default
1088 ;; directory for the whole concatenation.
1104 (setq nodename (Info-following-node-name))
1108 (push (list nodename other beg end) this-buffer-nodes)))
1112 (message "No `top' node in %s" Info-dir-file-name)))))
1150 (Info-dir-remove-duplicates)
1155 (message "Composing main Info directory...problems encountered, see `*Messages*'")
1156 (message "Composing main Info directory...done"))
1157 (set (make-local-variable 'Info-dir-contents) (buffer-string))
1158 (set (make-local-variable 'Info-dir-file-attributes) dir-file-attrs)))
1159 (setq default-directory Info-dir-contents-directory))
1161 (defvar Info-streamline-headings
1168 (defun Info-dir-remove-duplicates ()
1181 (dolist (x Info-streamline-headings)
1231 (defun Info-read-subfile (nodepos)
1232 ;; NODEPOS is either a position (in the Info file as a whole,
1238 (set-buffer (marker-buffer Info-tag-table-marker))
1261 ;; Assume previous buffer is in Info-mode.
1263 (or (equal Info-current-subfile lastfilename)
1270 (setq Info-current-subfile lastfilename)))
1280 (defun Info-unescape-quotes (value)
1291 ;; into the Info file for handling images.
1292 (defun Info-split-parameter-string (parameter-string)
1294 whitespace separated list of KEY=VALUE pairs. If VALUE contains
1305 (Info-unescape-quotes
1310 (defun Info-display-images-node ()
1320 (parameter-alist (Info-split-parameter-string (match-string 2)))
1324 (concat default-directory src))
1345 (defun Info-hide-cookies-node ()
1359 (defun Info-select-node ()
1360 "Select the Info node that point is in."
1369 (signal 'search-failed (list "\n\^_"))))
1372 (setq Info-current-node
1377 (Info-set-mode-line)
1392 (if Info-enable-active-nodes (eval active-expression))
1393 ;; Add a new unique history item to full history list
1394 (let ((new-history (list Info-current-file Info-current-node)))
1395 (setq Info-history-list
1396 (cons new-history (delete new-history Info-history-list)))
1397 (setq Info-history-forward nil))
1398 (if (not (eq Info-fontify-maximum-menu-size nil))
1399 (Info-fontify-node))
1400 (Info-display-images-node)
1401 (Info-hide-cookies-node)
1402 (run-hooks 'Info-selection-hook)))))
1404 (defvar Info-mode-line-node-keymap
1406 (define-key map [mode-line mouse-1] 'Info-mouse-scroll-up)
1407 (define-key map [mode-line mouse-3] 'Info-mouse-scroll-down)
1409 "Keymap to put on the Info node name in the mode line.")
1411 (defun Info-set-mode-line ()
1414 (list
1417 (if (stringp Info-current-file)
1419 "%" "%%" (file-name-nondirectory Info-current-file))
1420 (format "*%S*" Info-current-file))
1422 (if Info-current-node
1424 "%" "%%" Info-current-node)
1429 'local-map Info-mode-line-node-keymap)
1433 ;; Go to an Info node specified with a filename-and-nodename string
1439 (defun Info-goto-node (nodename &optional fork)
1440 "Go to Info node named NODENAME. Give just NODENAME or (FILENAME)NODENAME.
1441 If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file
1442 FILENAME; otherwise, NODENAME should be in the current Info file (or one of
1444 Completion is available, but only for node names in the current Info file.
1446 a new Info buffer.
1448 (interactive (list (Info-read-node-name "Go to node: ") current-prefix-arg))
1465 (Info-find-node (if (equal filename "") nil filename)
1468 (defvar Info-read-node-completion-table)
1470 (defun Info-read-node-name-2 (string path-and-suffixes action)
1471 "Virtual completion table for file names input in Info node names.
1476 (string-dir (file-name-directory string))
1479 (list (file-name-directory string))
1483 (setq dir default-directory))
1485 (when (file-directory-p dir)
1492 ;; But exclude subfiles of split Info files.
1508 ;; It does completion using the alist in Info-read-node-completion-table
1510 (defun Info-read-node-name-1 (string predicate code)
1517 (let ((comp (try-completion file 'Info-read-node-name-2
1518 (cons Info-directory-list
1519 (mapcar 'car Info-suffix-list)))))
1524 (all-completions file 'Info-read-node-name-2
1525 (cons Info-directory-list
1526 (mapcar 'car Info-suffix-list))))
1534 ;; Otherwise use Info-read-node-completion-table.
1536 (try-completion string Info-read-node-completion-table predicate))
1538 (all-completions string Info-read-node-completion-table predicate))
1540 (test-completion string Info-read-node-completion-table predicate))))
1542 ;; Arrange to highlight the proper letters in the completion list buffer.
1543 (put 'Info-read-node-name-1 'completion-base-size-function
1551 (defun Info-read-node-name (prompt &optional default)
1553 (Info-read-node-completion-table (Info-build-node-completions))
1554 (nodename (completing-read prompt 'Info-read-node-name-1 nil t)))
1556 (or default
1557 (Info-read-node-name prompt))
1560 (defun Info-build-node-completions ()
1561 (or Info-current-file-completions
1568 (or Info-tag-table-marker
1569 (error "No Info tags found"))
1570 (if (marker-buffer Info-tag-table-marker)
1571 (let ((marker Info-tag-table-marker))
1577 (cons (list (match-string-no-properties 2))
1582 (if (Info-node-at-bob-matching node-regexp)
1583 (setq compl (list (match-string-no-properties 1))))
1591 (cons (list (match-string-no-properties 1))
1594 (set (make-local-variable 'Info-current-file-completions) compl))))
1597 (defun Info-restore-point (hl)
1600 (if (and (equal (nth 0 (car hl)) Info-current-file)
1602 (string-equal (nth 1 (car hl)) Info-current-node))
1609 (defvar Info-search-history nil
1610 "The history list for `Info-search'.")
1612 (defvar Info-search-case-fold nil
1613 "The value of `case-fold-search' from previous `Info-search' command.")
1615 (defun Info-search (regexp &optional bound noerror count direction)
1618 (interactive (list (read-string
1619 (if Info-search-history
1620 (format "Regexp search%s (default %s): "
1622 (car Info-search-history))
1625 nil 'Info-search-history)))
1629 (setq regexp (car Info-search-history)))
1633 (onode Info-current-node)
1634 (ofile Info-current-file)
1639 (osubfile Info-current-subfile))
1640 (setq Info-search-case-fold case-fold-search)
1645 ;; Hide Info file header for backward search
1668 Info-search-whitespace-regexp)))
1676 (when (and isearch-mode Info-isearch-search
1677 (not Info-isearch-initial-node)
1681 (signal 'search-failed (list regexp "initial node")))
1685 (if (null Info-current-subfile)
1688 Info-search-whitespace-regexp)))
1695 (signal 'search-failed (list regexp)))
1700 (let ((list ()))
1702 (set-buffer (marker-buffer Info-tag-table-marker))
1715 ;; Make a list of all following subfiles.
1722 (setq list (cons (cons (+ (point-min)
1725 list))
1730 (setq list (nreverse list))))
1731 (while list
1732 (message "Searching subfile %s..." (cdr (car list)))
1733 (Info-read-subfile (car (car list)))
1735 ;; Hide Info file header for backward search
1742 (setq list (cdr list))
1761 Info-search-whitespace-regexp)))
1771 (setq list nil)))
1774 (signal 'search-failed (list regexp))))
1776 (progn (Info-read-subfile osubfile)
1778 (Info-select-node)
1781 (if (and (string= osubfile Info-current-subfile)
1788 (save-match-data (Info-select-node)))
1791 (or (and (string-equal onode Info-current-node)
1792 (equal ofile Info-current-file))
1795 (setq Info-history (cons (list ofile onode opoint)
1796 Info-history))))))
1798 (defun Info-search-case-sensitively ()
1802 (call-interactively 'Info-search)))
1804 (defun Info-search-next ()
1805 "Search for next regexp from a previous `Info-search' command."
1807 (let ((case-fold-search Info-search-case-fold))
1808 (if Info-search-history
1809 (Info-search (car Info-search-history))
1810 (call-interactively 'Info-search))))
1812 (defun Info-search-backward (regexp &optional bound noerror count)
1814 (interactive (list (read-string
1815 (if Info-search-history
1816 (format "Regexp search%s backward (default %s): "
1818 (car Info-search-history))
1821 nil 'Info-search-history)))
1822 (Info-search regexp bound noerror count 'backward))
1824 (defun Info-isearch-search ()
1825 (if Info-isearch-search
1828 (Info-search (concat "\\b" (replace-regexp-in-string
1836 (Info-search (if isearch-regexp string (regexp-quote string))
1843 (defun Info-isearch-wrap ()
1844 (if Info-isearch-search
1845 (if Info-isearch-initial-node
1847 (if isearch-forward (Info-top-node) (Info-final-node))
1849 (setq Info-isearch-initial-node Info-current-node)
1853 (defun Info-isearch-push-state ()
1855 (Info-isearch-pop-state cmd ',Info-current-file ',Info-current-node)))
1857 (defun Info-isearch-pop-state (cmd file node)
1858 (or (and (equal Info-current-file file)
1859 (equal Info-current-node node))
1860 (progn (Info-find-node file node) (sit-for 0))))
1862 (defun Info-isearch-start ()
1863 (setq Info-isearch-initial-node nil))
1866 (defun Info-extract-pointer (name &optional errorname)
1877 (concat name ":" (Info-following-node-name-re)) bound t)
1883 (defun Info-following-node-name-re (&optional allowedchars)
1898 (defun Info-following-node-name ()
1899 (and (looking-at (Info-following-node-name-re))
1902 (defun Info-next ()
1907 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
1908 (Info-goto-node (Info-extract-pointer "next"))))
1910 (defun Info-prev ()
1915 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
1916 (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous"))))
1918 (defun Info-up (&optional same-file)
1920 If SAME-FILE is non-nil, do not move to a different Info file."
1924 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
1925 (let ((old-node Info-current-node)
1926 (old-file Info-current-file)
1927 (node (Info-extract-pointer "up")) p)
1930 (error "Up node is in another Info file"))
1931 (Info-goto-node node)
1944 (Info-restore-point Info-history)))))
1946 (defun Info-history-back ()
1949 (or Info-history
1950 (error "This is the first Info node you looked at"))
1952 (cons (list Info-current-file Info-current-node (point))
1953 Info-history-forward))
1955 (setq filename (car (car Info-history)))
1956 (setq nodename (car (cdr (car Info-history))))
1957 (setq opoint (car (cdr (cdr (car Info-history)))))
1958 (setq Info-history (cdr Info-history))
1959 (Info-find-node filename nodename)
1960 (setq Info-history (cdr Info-history))
1961 (setq Info-history-forward history-forward)
1964 (defalias 'Info-last 'Info-history-back)
1966 (defun Info-history-forward ()
1969 (or Info-history-forward
1970 (error "This is the last Info node you looked at"))
1971 (let ((history-forward (cdr Info-history-forward))
1973 (setq filename (car (car Info-history-forward)))
1974 (setq nodename (car (cdr (car Info-history-forward))))
1975 (setq opoint (car (cdr (cdr (car Info-history-forward)))))
1976 (Info-find-node filename nodename)
1977 (setq Info-history-forward history-forward)
1981 (defun Info-directory ()
1982 "Go to the Info directory node."
1984 (Info-find-node "dir" "top"))
1987 (defun Info-history ()
1990 (let ((curr-file Info-current-file)
1991 (curr-node Info-current-node)
2000 (let ((hl (delete '("history" "Top") Info-history-list)))
2009 (propertize (or (file-name-directory file) "") 'invisible t)
2013 (Info-find-node 'history "Top")
2016 (defun Info-toc ()
2017 "Go to a node with table of contents of the current Info file.
2020 (if (stringp Info-current-file)
2021 (let ((curr-file (substring-no-properties Info-current-file))
2022 (curr-node (substring-no-properties Info-current-node))
2026 (node-list (Info-build-toc curr-file)))
2032 (Info-insert-toc
2033 (nth 2 (assoc "Top" node-list)) ; get Top nodes
2034 node-list 0 curr-file))
2036 (let ((Info-hide-note-references 'hide)
2037 (Info-fontify-visited-nodes nil))
2038 (Info-mode)
2039 (setq Info-current-file 'toc Info-current-node "Top")
2044 (Info-fontify-node)
2049 (Info-find-node 'toc "Top")
2052 (defun Info-insert-toc (nodes node-list level curr-file)
2056 (let ((node (assoc (car nodes) node-list)))
2057 (unless (member (nth 1 node) (list nil section))
2061 (Info-insert-toc (nth 2 node) node-list (1+ level) curr-file)
2064 (defun Info-build-toc (file)
2065 "Build table of contents from menus of Info FILE and its subfiles."
2067 (let* ((file (and (stringp file) (Info-find-file file)))
2068 (default-directory (or (and (stringp file)
2069 (file-name-directory file))
2070 default-directory))
2081 (let ((nodename (substring-no-properties (Info-following-node-name)))
2086 (when (and (not (Info-index-node nodename file))
2102 (Info-extract-menu-node-name))))
2106 (cons (list menu-node-name section) sections)))))
2113 (setq nodes (cons (list nodename
2133 (defun Info-follow-reference (footnotename &optional fork)
2137 a new Info buffer. If FORK is a string, it is the name to use for the
2142 completions default alt-default (start-point (point)) str i bol eol)
2153 ;; See if this one should be the default.
2154 (and (null default)
2157 (setq default t))
2158 ;; See if this one should be the alternate default.
2159 (and (null alt-default)
2162 (setq alt-default t))
2168 ;; Record as a completion and perhaps as default.
2169 (if (eq default t) (setq default str))
2170 (if (eq alt-default t) (setq alt-default str))
2174 ;; If no good default was found, try an alternate.
2175 (or default
2176 (setq default alt-default))
2177 ;; If only one cross-reference found, then make it default.
2179 (setq default (car completions)))
2181 (let ((input (completing-read (if default
2183 "Follow reference named (default "
2184 default "): ")
2187 (list (if (equal input "")
2188 default input) current-prefix-arg))
2221 (setq target (Info-extract-menu-node-name t))))
2226 (Info-goto-node target fork)))
2228 (defconst Info-menu-entry-name-re "\\(?:[^:]\\|:[^:,.;() \t\n]\\)*"
2229 ;; We allow newline because this is also used in Info-follow-reference,
2233 `:' and `Info-following-node-name-re'.")
2235 (defun Info-extract-menu-node-name (&optional multi-line index-node)
2237 (when (looking-at (concat Info-menu-entry-name-re ":\\(:\\|"
2238 (Info-following-node-name-re
2248 (setq Info-point-loc
2254 ;;; (setq Info-point-loc
2265 ;;(defun Info-menu-item-sequence (list)
2266 ;; (while list
2267 ;; (Info-menu (car list))
2268 ;; (setq list (cdr list))))
2270 (defvar Info-complete-menu-buffer)
2271 (defvar Info-complete-next-re nil)
2272 (defvar Info-complete-nodes nil)
2273 (defvar Info-complete-cache nil)
2275 (defconst Info-node-spec-re
2276 (concat (Info-following-node-name-re "^.,:") "[,:.]")
2279 (defun Info-complete-menu-item (string predicate action)
2281 ;; - `Info-complete-menu-buffer' which contains the buffer in which
2283 ;; - `Info-complete-next-re' which, if non-nil, indicates that we should
2285 ;; nodes' names match `Info-complete-next-re'. This feature is currently
2287 ;; - `Info-complete-nodes' which, if non-nil, indicates that we should
2289 ;; only used for completion in Info-index.
2291 ;; Note that `Info-complete-menu-buffer' could be current already,
2294 (set-buffer Info-complete-menu-buffer)
2297 (orignode Info-current-node)
2306 Info-menu-entry-name-re "\\):" Info-node-spec-re))
2308 (complete-nodes Info-complete-nodes))
2310 (if (and (equal (nth 0 Info-complete-cache) Info-current-file)
2311 (equal (nth 1 Info-complete-cache) Info-current-node)
2312 (equal (nth 2 Info-complete-cache) Info-complete-next-re)
2313 (equal (nth 5 Info-complete-cache) Info-complete-nodes)
2314 (let ((prev (nth 3 Info-complete-cache)))
2317 ;; We can reuse the previous list.
2318 (setq completions (nth 4 Info-complete-cache))
2326 (or (and Info-complete-next-re
2327 (setq nextnode (Info-extract-pointer "next" t))
2328 (string-match Info-complete-next-re nextnode))
2332 (Info-goto-node nextnode))
2334 (unless (equal Info-current-node orignode)
2335 (Info-goto-node orignode))
2337 (set (make-local-variable 'Info-complete-cache)
2338 (list Info-current-file Info-current-node
2339 Info-complete-next-re string completions
2340 Info-complete-nodes)))
2346 (defun Info-menu (menu-item &optional fork)
2349 Completion is allowed, and the default menu item is the one point is on.
2351 a new Info buffer. If FORK is a string, it is the name to use for the
2355 ;; If point is within a menu item, use that item as the default
2356 (default nil)
2371 Info-menu-entry-name-re
2373 (setq default (match-string-no-properties 1))))))
2377 (Info-complete-menu-buffer (current-buffer)))
2378 (completing-read (if default
2379 (format "Menu item (default %s): "
2380 default)
2382 'Info-complete-menu-item nil t)))
2387 (if default
2388 (setq item default)
2391 (list item current-prefix-arg))))
2394 (Info-goto-node (Info-extract-menu-item menu-item) (if fork menu-item)))
2396 (defun Info-extract-menu-item (menu-item)
2409 (Info-extract-menu-node-name nil (Info-index-node))))))
2412 (defun Info-extract-menu-counting (count)
2424 (Info-extract-menu-node-name nil (Info-index-node))))))
2426 (defun Info-nth-menu-item ()
2430 (Info-goto-node
2431 (Info-extract-menu-counting
2434 (defun Info-top-node ()
2437 (Info-goto-node "Top"))
2439 (defun Info-final-node ()
2442 (Info-goto-node "Top")
2443 (let ((Info-history nil)
2446 (Info-goto-node (Info-extract-menu-counting nil))
2449 (while (Info-forward-node t t) nil)
2451 (while (and (not (Info-index-node))
2453 (Info-goto-node (Info-extract-menu-counting nil)))))
2455 (defun Info-forward-node (&optional not-down no-error)
2467 (not (Info-index-node)))
2468 (Info-goto-node (Info-extract-menu-counting 1))
2471 (Info-next)
2475 (not (string-equal (downcase (Info-extract-pointer "up"))
2477 (let ((old-node Info-current-node))
2478 (Info-up)
2479 (let (Info-history success)
2481 (setq success (Info-forward-node t no-error))
2482 (or success (Info-goto-node old-node))))))
2486 (defun Info-backward-node ()
2489 (let ((prevnode (Info-extract-pointer "prev[ious]*" t))
2490 (upnode (Info-extract-pointer "up" t))
2499 (Info-up))
2503 (Info-prev)
2504 (let (Info-history)
2505 (while (and (not (Info-index-node))
2507 (Info-goto-node (Info-extract-menu-counting nil)))))
2511 (defun Info-exit ()
2512 "Exit Info by selecting some other buffer."
2514 (if Info-standalone
2518 (defun Info-next-menu-item ()
2528 (Info-extract-menu-node-name)))))
2529 (if node (Info-goto-node node)
2532 (defun Info-last-menu-item ()
2544 (Info-goto-node (save-excursion
2546 (Info-extract-menu-node-name)))))
2548 (defmacro Info-no-error (&rest body)
2549 (list 'condition-case nil (cons 'progn (append body '(t))) '(error nil)))
2551 (defun Info-next-preorder ()
2554 (cond ((Info-no-error (Info-next-menu-item)))
2555 ((Info-no-error (Info-next)))
2556 ((Info-no-error (Info-up t))
2562 (Info-next-preorder))
2566 (defun Info-last-preorder ()
2569 (cond ((Info-no-error
2570 (Info-last-menu-item)
2575 (while (Info-no-error
2576 (Info-last-menu-item)
2581 ((and (Info-no-error (Info-extract-pointer "prev"))
2582 (not (equal (Info-extract-pointer "up")
2583 (Info-extract-pointer "prev"))))
2584 (Info-no-error (Info-prev))
2586 (while (Info-no-error
2587 (Info-last-menu-item)
2592 ((Info-no-error (Info-up t))
2599 (defun Info-scroll-up ()
2600 "Scroll one screenful forward in Info, considering all nodes as one sequence.
2603 `Info-scroll-prefer-subnodes' is nil.
2606 `Info-scroll-prefer-subnodes' is non-nil and to the first subnode otherwise;
2608 and so on. If `Info-scroll-prefer-subnodes' is non-nil and point is inside
2620 (if (and Info-scroll-prefer-subnodes
2627 (Info-scroll-prefer-subnodes (Info-next-preorder))
2628 ((Info-no-error (Info-goto-node (Info-extract-menu-counting 1))))
2629 (t (Info-next-preorder)))
2632 (defun Info-mouse-scroll-up (e)
2633 "Scroll one screenful forward in Info, using the mouse.
2634 See `Info-scroll-up'."
2639 (Info-scroll-up)))
2641 (defun Info-scroll-down ()
2642 "Scroll one screenful back in Info, considering all nodes as one sequence.
2643 If point is within the menu of a node, and `Info-scroll-prefer-subnodes'
2654 (and Info-scroll-prefer-subnodes
2664 (Info-last-preorder)
2667 (defun Info-mouse-scroll-down (e)
2668 "Scroll one screenful backward in Info, using the mouse.
2669 See `Info-scroll-down'."
2674 (Info-scroll-down)))
2676 (defun Info-next-reference (&optional recur)
2694 (Info-next-reference t))
2698 (defun Info-prev-reference (&optional recur)
2715 (Info-prev-reference t))
2720 (defvar Info-index-nodes nil
2721 "Alist of cached index node names of visited Info files.
2724 (defun Info-index-nodes (&optional file)
2725 "Return a list of names of all index nodes in Info FILE.
2726 If FILE is omitted, it defaults to the current Info file.
2727 First look in a list of cached index node names. Then scan Info
2732 (or file (setq file Info-current-file))
2733 (or (assoc file Info-index-nodes)
2734 ;; Skip virtual Info files
2736 (setq Info-index-nodes (cons (cons file nil) Info-index-nodes)))
2738 (if Info-file-supports-index-cookies
2740 (let* ((default-directory (or (and (stringp file)
2741 (file-name-directory
2742 (setq file (Info-find-file file))))
2743 default-directory))
2744 Info-history Info-history-list Info-fontify-maximum-menu-size
2756 (setq nodes (cons (Info-following-node-name) nodes))))
2771 Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
2775 Info-history Info-history-list Info-fontify-maximum-menu-size
2779 (Info-mode)
2780 (Info-find-node file "Top")
2784 (setq nodes (list (Info-extract-menu-node-name)))
2785 (Info-goto-node (car nodes))
2786 (while (and (setq node (Info-extract-pointer "next" t))
2789 (Info-goto-node node))))
2793 Info-index-nodes (cons (cons file nodes) Info-index-nodes)))
2796 (setq Info-index-nodes (cons (cons file nil) Info-index-nodes)))
2797 (cdr (assoc file Info-index-nodes)))
2799 (defun Info-index-node (&optional node file)
2801 If NODE is nil, check the current Info node.
2802 If FILE is nil, check the current Info file."
2803 (if (or (and node (not (equal node Info-current-node)))
2804 (assoc (or file Info-current-file) Info-index-nodes))
2805 (member (or node Info-current-node) (Info-index-nodes file))
2808 (if Info-file-supports-index-cookies
2818 (string-match "\\<Index\\>" (or node Info-current-node ""))))))
2820 (defun Info-goto-index ()
2822 (let ((node (car (Info-index-nodes))))
2824 (Info-goto-node node)))
2827 (defun Info-index (topic)
2831 Use the \\<Info-mode-map>\\[Info-index-next] command to see the other matches.
2834 (list
2836 (Info-complete-menu-buffer (clone-buffer))
2837 (Info-complete-nodes (Info-index-nodes))
2838 (Info-history-list nil))
2839 (if (equal Info-current-file "dir")
2840 (error "The Info directory node has no index; use m to select a manual"))
2842 (with-current-buffer Info-complete-menu-buffer
2843 (Info-goto-index)
2844 (completing-read "Index topic: " 'Info-complete-menu-item))
2845 (kill-buffer Info-complete-menu-buffer)))))
2846 (if (equal Info-current-file "dir")
2847 (error "The Info directory node has no index; use m to select a manual"))
2853 (let ((orignode Info-current-node)
2856 node (nodes (Info-index-nodes))
2857 (ohist-list Info-history-list)
2859 (Info-goto-index)
2863 ;; We bind Info-history to nil for internal node-switches so
2865 ;; Info-goto-index call, above, we do update the history
2867 (Info-history nil)
2873 (push (list (match-string-no-properties 1)
2875 Info-current-node
2880 (Info-goto-node node))
2883 (Info-goto-node orignode)
2889 (setq Info-history-list ohist-list)
2890 (setq Info-index-alternatives (nconc exact (nreverse matches)))
2891 (Info-index-next 0)))))
2893 (defun Info-index-next (num)
2894 "Go to the next matching index item from the last \\<Info-mode-map>\\[Info-index] command."
2896 (or Info-index-alternatives
2899 (setq num (+ num (length Info-index-alternatives))))
2901 (setq Info-index-alternatives
2902 (nconc (cdr Info-index-alternatives)
2903 (list (car Info-index-alternatives)))
2905 (Info-goto-node (nth 1 (car Info-index-alternatives)))
2906 (if (> (nth 3 (car Info-index-alternatives)) 0)
2907 (forward-line (1- (nth 3 (car Info-index-alternatives))))
2909 (let ((name (car (car Info-index-alternatives))))
2910 (Info-find-index-name name)))
2912 (car (car Info-index-alternatives))
2913 (nth 2 (car Info-index-alternatives))
2914 (if (cdr Info-index-alternatives)
2916 (length Info-index-alternatives)
2918 'Info-index-next overriding-local-map
2922 (defun Info-find-index-name (name)
2940 (Info-find-index-name (match-string 1 name))))
2946 "Grovel indices of all known Info files on your system for STRING.
2952 (ohist Info-history)
2953 (ohist-list Info-history-list)
2954 (current-node Info-current-node)
2955 (current-file Info-current-file)
2957 (let ((Info-fontify-maximum-menu-size nil))
2958 (Info-directory)
2960 ;; as the first Info command, i.e. info-apropos loads info.el. In that
2964 (setq current-file Info-current-file)
2965 (setq current-node Info-current-node))
2970 ;; add-to-list makes sure we don't have duplicates in `manuals',
2972 (add-to-list 'manuals (match-string 1)))
2976 (if (setq nodes (Info-index-nodes (Info-find-file manual)))
2978 (Info-find-node manual (car nodes))
2984 (cons (list manual
2990 (Info-goto-node node))))
2995 (Info-find-node current-file current-node)
2996 (setq Info-history ohist
2997 Info-history-list ohist-list)
3014 (Info-find-node 'apropos "Index")
3015 (setq Info-complete-cache nil)))))
3017 (defun Info-undefined ()
3018 "Make command be undefined in Info."
3022 (defun Info-help ()
3023 "Enter the Info tutorial."
3026 (Info-find-node "info"
3031 (defun Info-summary ()
3032 "Display a brief summary of all Info commands."
3038 (insert (documentation 'Info-mode))
3044 "Type Space to return to Info"))
3046 (progn (setq unread-command-events (list ch)) nil)
3052 (defun Info-get-token (pos start all &optional errorstring)
3093 (defun Info-mouse-follow-nearest-node (click)
3094 "\\<Info-mode-map>Follow a node reference near point.
3095 Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], \\[Info-prev] or \\[Info-up] command, depending on where you click.
3099 (and (not (Info-try-follow-nearest-node))
3101 (Info-next-preorder)))
3103 (defun Info-follow-nearest-node (&optional fork)
3109 a new Info buffer.
3112 (or (Info-try-follow-nearest-node fork)
3120 (Info-goto-node
3121 (Info-extract-menu-item (match-string-no-properties 1)) fork)
3126 (defun Info-try-follow-nearest-node (&optional fork)
3128 If FORK is non-nil, it i spassed to `Info-goto-node'."
3131 ((Info-get-token (point) "[hf]t?tp://" "[hf]t?tp://\\([^ \t\n\"`({<>})']+\\)")
3134 ((setq node (Info-get-token (point) "\\*note[ \n\t]+"
3136 (Info-follow-reference node fork))
3138 ((setq node (Info-get-token (point) "\\* +" "\\* +\\([^:]*\\)::"))
3139 (Info-goto-node node fork))
3141 ((Info-get-token (point) "\\* +" "\\* +\\(.*\\): ")
3144 (setq node (Info-extract-menu-node-name nil (Info-index-node)))
3145 (Info-goto-node node fork))
3146 ((setq node (Info-get-token (point) "Up: " "Up: \\([^,\n\t]*\\)"))
3147 (Info-goto-node node fork))
3148 ((setq node (Info-get-token (point) "Next: " "Next: \\([^,\n\t]*\\)"))
3149 (Info-goto-node node fork))
3150 ((setq node (Info-get-token (point) "File: " "File: \\([^,\n\t]*\\)"))
3151 (Info-goto-node "Top" fork))
3152 ((setq node (Info-get-token (point) "Prev: " "Prev: \\([^,\n\t]*\\)"))
3153 (Info-goto-node node fork)))
3157 (defvar Info-mode-map nil
3158 "Keymap containing Info commands.")
3159 (if Info-mode-map
3161 (setq Info-mode-map (make-keymap))
3162 (suppress-keymap Info-mode-map)
3163 (define-key Info-mode-map "." 'beginning-of-buffer)
3164 (define-key Info-mode-map " " 'Info-scroll-up)
3165 (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node)
3166 (define-key Info-mode-map "\t" 'Info-next-reference)
3167 (define-key Info-mode-map "\e\t" 'Info-prev-reference)
3168 (define-key Info-mode-map [(shift tab)] 'Info-prev-reference)
3169 (define-key Info-mode-map [backtab] 'Info-prev-reference)
3170 (define-key Info-mode-map "1" 'Info-nth-menu-item)
3171 (define-key Info-mode-map "2" 'Info-nth-menu-item)
3172 (define-key Info-mode-map "3" 'Info-nth-menu-item)
3173 (define-key Info-mode-map "4" 'Info-nth-menu-item)
3174 (define-key Info-mode-map "5" 'Info-nth-menu-item)
3175 (define-key Info-mode-map "6" 'Info-nth-menu-item)
3176 (define-key Info-mode-map "7" 'Info-nth-menu-item)
3177 (define-key Info-mode-map "8" 'Info-nth-menu-item)
3178 (define-key Info-mode-map "9" 'Info-nth-menu-item)
3179 (define-key Info-mode-map "0" 'undefined)
3180 (define-key Info-mode-map "?" 'Info-summary)
3181 (define-key Info-mode-map "]" 'Info-forward-node)
3182 (define-key Info-mode-map "[" 'Info-backward-node)
3183 (define-key Info-mode-map "<" 'Info-top-node)
3184 (define-key Info-mode-map ">" 'Info-final-node)
3185 (define-key Info-mode-map "b" 'beginning-of-buffer)
3186 (define-key Info-mode-map "d" 'Info-directory)
3187 (define-key Info-mode-map "e" 'Info-edit)
3188 (define-key Info-mode-map "f" 'Info-follow-reference)
3189 (define-key Info-mode-map "g" 'Info-goto-node)
3190 (define-key Info-mode-map "h" 'Info-help)
3191 (define-key Info-mode-map "i" 'Info-index)
3192 (define-key Info-mode-map "l" 'Info-history-back)
3193 (define-key Info-mode-map "L" 'Info-history)
3194 (define-key Info-mode-map "m" 'Info-menu)
3195 (define-key Info-mode-map "n" 'Info-next)
3196 (define-key Info-mode-map "p" 'Info-prev)
3197 (define-key Info-mode-map "q" 'Info-exit)
3198 (define-key Info-mode-map "r" 'Info-history-forward)
3199 (define-key Info-mode-map "s" 'Info-search)
3200 (define-key Info-mode-map "S" 'Info-search-case-sensitively)
3202 (define-key Info-mode-map "\M-s" 'Info-search)
3203 (define-key Info-mode-map "\M-n" 'clone-buffer)
3204 (define-key Info-mode-map "t" 'Info-top-node)
3205 (define-key Info-mode-map "T" 'Info-toc)
3206 (define-key Info-mode-map "u" 'Info-up)
3208 (define-key Info-mode-map "w" 'Info-copy-current-node-name)
3209 (define-key Info-mode-map "c" 'Info-copy-current-node-name)
3210 ;; `^' for consistency with `dired-up-directory'.
3211 (define-key Info-mode-map "^" 'Info-up)
3212 (define-key Info-mode-map "," 'Info-index-next)
3213 (define-key Info-mode-map "\177" 'Info-scroll-down)
3214 (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
3215 (define-key Info-mode-map [follow-link] 'mouse-face)
3218 (defun Info-check-pointer (item)
3221 (Info-extract-pointer item)
3225 Info-mode-menu Info-mode-map
3226 "Menu for Info files."
3227 '("Info"
3228 ["Up" Info-up :active (Info-check-pointer "up")
3229 :help "Go up in the Info tree"]
3230 ["Next" Info-next :active (Info-check-pointer "next")
3232 ["Previous" Info-prev :active (Info-check-pointer "prev[ious]*")
3234 ["Backward" Info-backward-node
3236 ["Forward" Info-forward-node
3240 ["Top" Info-top-node
3242 ["Final Node" Info-final-node
3246 ["Search..." Info-search
3247 :help "Search for regular expression in this Info file"]
3248 ["Search Next" Info-search-next
3250 ["Go to Node..." Info-goto-node
3252 ["Back in history" Info-history-back :active Info-history
3254 ["Forward in history" Info-history-forward :active Info-history-forward
3256 ["History" Info-history :active Info-history-list
3258 ["Table of Contents" Info-toc
3261 ["Lookup a String..." Info-index
3263 ["Next Matching Item" Info-index-next :active Info-index-alternatives
3267 ["Copy Node Name" Info-copy-current-node-name
3269 ["Clone Info buffer" clone-buffer
3270 :help "Create a twin copy of the current Info buffer."]
3271 ["Exit" Info-exit :help "Stop reading Info"]))
3277 (tool-bar-local-item-from-menu 'Info-history-back "left-arrow" map Info-mode-map)
3278 (tool-bar-local-item-from-menu 'Info-history-forward "right-arrow" map Info-mode-map)
3279 (tool-bar-local-item-from-menu 'Info-prev "prev-node" map Info-mode-map)
3280 (tool-bar-local-item-from-menu 'Info-next "next-node" map Info-mode-map)
3281 (tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map)
3282 (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map)
3283 (tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map)
3284 (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map)
3285 (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map)
3286 (tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map)
3289 (defvar Info-menu-last-node nil)
3291 ;; Value is a list, (FILE-NAME NODE-NAME).
3293 (defun Info-menu-update ()
3294 "Update the Info menu for the current node."
3296 (if (or (not (eq major-mode 'Info-mode))
3297 (equal (list Info-current-file Info-current-node)
3298 Info-menu-last-node))
3301 (let* ((Info-complete-menu-buffer (current-buffer))
3303 (Info-complete-menu-item "" nil t)
3312 (Info-menu ,current)
3316 (setq entries (cons ["Other..." Info-menu t] entries)))
3318 (setq entries (list ["No menu" nil nil] nil :active)))
3319 (easy-menu-change '("Info") "Menu Item" (nreverse entries)))
3320 ;; Update reference menu. Code stolen from `Info-follow-reference'.
3341 (Info-follow-reference ,current)
3345 (setq entries (cons ["Other..." Info-follow-reference t]
3348 (setq entries (list ["No references" nil nil] nil :active)))
3349 (easy-menu-change '("Info") "Reference" (nreverse entries)))
3351 (setq Info-menu-last-node (list Info-current-file Info-current-node)))
3357 (defun Info-copy-current-node-name (&optional arg)
3358 "Put the name of the current Info node into the kill ring.
3359 The name of the Info file is prepended to the node name in parentheses.
3362 (unless Info-current-node
3363 (error "No current Info node"))
3364 (let ((node (if (stringp Info-current-file)
3365 (concat "(" (file-name-nondirectory Info-current-file) ")"
3366 Info-current-node))))
3369 (unless (stringp Info-current-file)
3370 (setq node (format "(Info-find-node '%S '%S)"
3371 Info-current-file Info-current-node)))
3377 ;; Info mode is suitable only for specially formatted data.
3378 (put 'Info-mode 'mode-class 'special)
3379 (put 'Info-mode 'no-clone-indirect t)
3385 (defun Info-mode ()
3386 "Info mode provides commands for browsing through the Info documentation tree.
3387 Documentation in Info is divided into \"nodes\", each of which discusses
3389 topics. Info has commands to follow the references and show you other nodes.
3391 \\<Info-mode-map>\
3392 \\[Info-help] Invoke the Info tutorial.
3393 \\[Info-exit] Quit Info: reselect previously selected buffer.
3396 \\[Info-mouse-follow-nearest-node]
3400 \\[Info-follow-nearest-node] Follow a node reference near point, like \\[Info-mouse-follow-nearest-node].
3401 \\[Info-next] Move to the \"next\" node of this node.
3402 \\[Info-prev] Move to the \"previous\" node of this node.
3403 \\[Info-up] Move \"up\" from this node.
3404 \\[Info-menu] Pick menu item specified by name (or abbreviation).
3406 \\[Info-directory] Go to the Info directory node.
3407 \\[Info-top-node] Go to the Top node of this file.
3408 \\[Info-final-node] Go to the final node in this file.
3409 \\[Info-backward-node] Go backward one node, considering all nodes as forming one sequence.
3410 \\[Info-forward-node] Go forward one node, considering all nodes as forming one sequence.
3411 \\[Info-next-reference] Move cursor to next cross-reference or menu item.
3412 \\[Info-prev-reference] Move cursor to previous cross-reference or menu item.
3413 \\[Info-follow-reference] Follow a cross reference. Reads name of reference.
3414 \\[Info-history-back] Move back in history to the last node you were at.
3415 \\[Info-history-forward] Move forward in history to the node you returned from after using \\[Info-history-back].
3416 \\[Info-history] Go to menu of visited nodes.
3417 \\[Info-toc] Go to table of contents of the current Info file.
3420 \\[Info-scroll-up] Normally, scroll forward a full screen.
3425 \\[Info-scroll-down] Normally, scroll backward. If the beginning of the buffer is
3431 \\[Info-search] Search through this Info file for specified regexp,
3433 \\[Info-search-case-sensitively] Search through this Info file for specified regexp case-sensitively.
3434 \\[Info-search-next] Search for another occurrence of regexp
3435 from a previous \\<Info-mode-map>\\[Info-search] command.
3436 \\[Info-index] Search for a topic in this manual's Index and go to index entry.
3437 \\[Info-index-next] (comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command.
3439 \\[Info-goto-node] Move to node specified by name.
3443 \\[Info-copy-current-node-name] Put name of current Info node in the kill ring.
3444 \\[clone-buffer] Select a new cloned Info buffer in another window.
3445 \\[universal-argument] \\[info] Move to new Info file with completion.
3446 \\[universal-argument] N \\[info] Select Info buffer with prefix number in the name *info*<N>."
3448 (setq major-mode 'Info-mode)
3449 (setq mode-name "Info")
3451 (use-local-map Info-mode-map)
3452 (add-hook 'activate-menubar-hook 'Info-menu-update nil t)
3457 (make-local-variable 'Info-current-file)
3458 (make-local-variable 'Info-current-subfile)
3459 (make-local-variable 'Info-current-node)
3460 (make-local-variable 'Info-tag-table-marker)
3461 (setq Info-tag-table-marker (make-marker))
3462 (make-local-variable 'Info-tag-table-buffer)
3463 (setq Info-tag-table-buffer nil)
3464 (make-local-variable 'Info-history)
3465 (make-local-variable 'Info-history-forward)
3466 (make-local-variable 'Info-index-alternatives)
3468 (if Info-use-header-line
3478 (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)
3479 (add-hook 'kill-buffer-hook 'Info-kill-buffer nil t)
3480 (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
3482 (add-hook 'isearch-mode-hook 'Info-isearch-start nil t)
3484 'Info-isearch-search)
3486 'Info-isearch-wrap)
3488 'Info-isearch-push-state)
3490 Info-search-whitespace-regexp)
3491 (Info-set-mode-line)
3492 (run-mode-hooks 'Info-mode-hook))
3494 ;; When an Info buffer is killed, make sure the associated tags buffer
3496 (defun Info-kill-buffer ()
3497 (and (eq major-mode 'Info-mode)
3498 Info-tag-table-buffer
3499 (kill-buffer Info-tag-table-buffer)))
3501 (defun Info-clone-buffer-hook ()
3502 (when (bufferp Info-tag-table-buffer)
3503 (setq Info-tag-table-buffer
3504 (with-current-buffer Info-tag-table-buffer (clone-buffer))))
3505 (let ((m Info-tag-table-marker))
3507 (setq Info-tag-table-marker
3508 (if (and (marker-position m) (bufferp Info-tag-table-buffer))
3509 (with-current-buffer Info-tag-table-buffer
3513 (defvar Info-edit-map (let ((map (make-sparse-keymap)))
3515 (define-key map "\C-c\C-c" 'Info-cease-edit)
3517 "Local keymap used within `e' command of Info.")
3519 ;; Info-edit mode is suitable only for specially formatted data.
3520 (put 'Info-edit-mode 'mode-class 'special)
3522 (defun Info-edit-mode ()
3523 "Major mode for editing the contents of an Info node.
3524 Like text mode with the addition of `Info-cease-edit'
3525 which returns to Info mode for browsing.
3526 \\{Info-edit-map}"
3527 (use-local-map Info-edit-map)
3528 (setq major-mode 'Info-edit-mode)
3529 (setq mode-name "Info Edit")
3534 (run-mode-hooks 'Info-edit-mode-hook))
3536 (defun Info-edit ()
3537 "Edit the contents of this Info node.
3538 Allowed only if variable `Info-enable-edit' is non-nil."
3540 (or Info-enable-edit
3541 (error "Editing Info nodes is not enabled"))
3542 (Info-edit-mode)
3544 "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info")))
3546 (defun Info-cease-edit ()
3547 "Finish editing Info node; switch back to Info proper."
3553 (use-local-map Info-mode-map)
3554 (setq major-mode 'Info-mode)
3555 (setq mode-name "Info")
3556 (Info-set-mode-line)
3559 (and (marker-position Info-tag-table-marker)
3561 (message "Tags may have changed. Use Info-tagify if necessary")))
3564 (defvar Info-file-list-for-emacs
3565 '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e")
3585 "List of Info files that describe Emacs commands.
3586 An element can be a file name, or a list of the form (PREFIX . FILE)
3590 (defun Info-find-emacs-command-nodes (command)
3591 "Return a list of locations documenting COMMAND.
3592 The `info-file' property of COMMAND says which Info manual to search.
3593 If COMMAND has no property, the variable `Info-file-list-for-emacs'
3594 defines heuristics for which Info manual to try.
3595 The locations are of the format used in `Info-history', i.e.
3597 in the first element of the returned list (which is treated specially in
3598 `Info-goto-emacs-command-node'), and 0 for the rest elements of a list."
3603 (info-file "emacs")) ;default
3604 ;; Determine which Info file this command is documented in.
3609 (let ((file-list Info-file-list-for-emacs))
3610 (while file-list
3611 (let* ((elt (car file-list))
3620 (setq info-file file file-list nil))
3621 (setq file-list (cdr file-list))))))
3622 (Info-find-node info-file "Top")
3623 ;; Bind Info-history to nil, to prevent the index nodes from
3625 (let ((Info-history nil)
3626 (Info-history-list nil)
3627 node (nodes (Info-index-nodes)))
3628 (Info-goto-node (car nodes))
3634 (cons (list Info-current-file
3641 (Info-goto-node node)))
3643 (cons (list (nth 0 (car where)) (nth 1 (car where)) line-number)
3647 ;;;###autoload (put 'Info-goto-emacs-command-node 'info-file "emacs")
3649 (defun Info-goto-emacs-command-node (command)
3650 "Go to the Info node in the Emacs manual for command COMMAND.
3653 the variable `Info-file-list-for-emacs'.
3660 (signal 'wrong-type-argument (list 'commandp command)))
3661 (let ((where (Info-find-emacs-command-nodes command)))
3664 ;; Get Info running, and pop to it in another window.
3667 (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
3668 ;; Bind Info-history to nil, to prevent the last Index node
3669 ;; visited by Info-find-emacs-command-nodes from being
3671 (let ((Info-history nil) (Info-history-list nil)
3673 (Info-find-node (nth 0 (car where)) (nth 1 (car where)))
3678 ;; (car where) will be pushed onto Info-history
3681 (setq Info-history (nconc (cdr where) Info-history))
3685 (substitute-command-keys "\\[Info-history-back]")
3689 ;;;###autoload (put 'Info-goto-emacs-key-command-node 'info-file "emacs")
3691 (defun Info-goto-emacs-key-command-node (key)
3697 the variable `Info-file-list-for-emacs'."
3704 (Info-goto-emacs-command-node
3707 (Info-goto-emacs-command-node command)))))
3710 (defvar Info-next-link-keymap
3712 (define-key keymap [header-line mouse-1] 'Info-next)
3713 (define-key keymap [header-line mouse-2] 'Info-next)
3715 (define-key keymap [mouse-2] 'Info-next)
3720 (defvar Info-prev-link-keymap
3722 (define-key keymap [header-line mouse-1] 'Info-prev)
3723 (define-key keymap [header-line mouse-2] 'Info-prev)
3725 (define-key keymap [mouse-2] 'Info-prev)
3730 (defvar Info-up-link-keymap
3732 (define-key keymap [header-line mouse-1] 'Info-up)
3733 (define-key keymap [header-line mouse-2] 'Info-up)
3735 (define-key keymap [mouse-2] 'Info-up)
3740 (defun Info-fontify-node ()
3750 (and Info-fontify-visited-nodes
3752 Info-fontify-maximum-menu-size
3753 (< (- (point-max) (point-min)) Info-fontify-maximum-menu-size)))
3780 ((string-equal (downcase tag) "prev") Info-prev-link-keymap)
3781 ((string-equal (downcase tag) "next") Info-next-link-keymap)
3782 ((string-equal (downcase tag) "up" ) Info-up-link-keymap))))))
3783 (when Info-use-header-line
3849 (when Info-hide-note-references
3850 (when (not (eq Info-hide-note-references 'hide))
3884 (list
3898 (if (and Info-fontify-visited-nodes
3913 Info-current-file))
3914 (hl Info-history-list)
3940 (when (memq Info-hide-note-references '(t hide))
3944 (if (and (match-string 6) (not (eq Info-hide-note-references 'hide)))
3959 (when (and Info-refill-paragraphs Info-hide-note-references)
3965 Info-refill-paragraphs
3988 Info-fontify-maximum-menu-size
3989 (< (- (point-max) (point)) Info-fontify-maximum-menu-size))
3993 (concat "^\\* Menu:\\|\\(?:^\\* +\\(" Info-menu-entry-name-re "\\)\\(:"
3994 Info-node-spec-re "\\([ \t]*\\)\\)\\)")
4006 (list
4017 (if (and Info-fontify-visited-nodes
4027 Info-current-file))
4028 (hl Info-history-list)
4046 (memq Info-hide-note-references '(t hide))
4047 (not (Info-index-node)))
4085 (when (and not-fontified-p (Info-index-node))
4104 ;; current Info node.
4107 (defvar Info-speedbar-key-map nil
4110 (defun Info-install-speedbar-variables ()
4111 "Install those variables used by speedbar to enhance Info."
4112 (if Info-speedbar-key-map
4114 (setq Info-speedbar-key-map (speedbar-make-specialized-keymap))
4117 (define-key Info-speedbar-key-map "e" 'speedbar-edit-line)
4118 (define-key Info-speedbar-key-map "\C-m" 'speedbar-edit-line)
4119 (define-key Info-speedbar-key-map "+" 'speedbar-expand-line)
4120 (define-key Info-speedbar-key-map "-" 'speedbar-contract-line)
4123 (speedbar-add-expansion-list '("Info" Info-speedbar-menu-items
4124 Info-speedbar-key-map
4125 Info-speedbar-hierarchy-buttons)))
4127 (defvar Info-speedbar-menu-items
4140 (Info-install-speedbar-variables)
4141 (add-hook 'speedbar-load-hook 'Info-install-speedbar-variables))
4143 ;;; Info hierarchy display method
4145 (defun Info-speedbar-browser ()
4146 "Initialize speedbar to display an Info node browser.
4152 ;; Now, throw us into Info mode on speedbar.
4153 (speedbar-change-initial-expansion-list "Info")
4156 (defun Info-speedbar-hierarchy-buttons (directory depth &optional node)
4157 "Display an Info directory hierarchy in speedbar.
4158 DIRECTORY is the current directory in the attached frame.
4165 (looking-at "Info Nodes:"))))
4168 ;; We cannot use the generic list code, that depends on all leaves
4171 (speedbar-with-writable (insert "Info Nodes:\n")))
4176 (Info-speedbar-fetch-file-nodes (or node '"(dir)top"))))
4181 (speedbar-make-tag-line 'bracket ?+ 'Info-speedbar-expand-node
4184 'Info-speedbar-goto-node
4190 (defun Info-speedbar-goto-node (text node indent)
4207 (Info-find-node (match-string 1 node) (match-string 2 node))
4209 ;; the old default method. Once we are in info mode, it makes
4211 (if (string= speedbar-initial-expansion-list-name "Info")
4212 (speedbar-change-initial-expansion-list
4213 speedbar-previously-used-expansion-list-name)))))
4215 (defun Info-speedbar-expand-node (text token indent)
4225 (Info-speedbar-hierarchy-buttons nil (1+ indent) token)))
4234 (defun Info-speedbar-fetch-file-nodes (nodespec)
4238 ;; Set up a buffer we can use to fake-out Info.
4240 (if (not (equal major-mode 'Info-mode))
4241 (Info-mode))
4245 (Info-find-node (match-string 1 nodespec) (match-string 2 nodespec)))
4268 ;;; Info mode node listing
4270 (defun Info-speedbar-buttons (buffer)
4271 "Create a speedbar display to help navigation in an Info file.
4275 (not (looking-at "Info Nodes:"))))
4277 (Info-speedbar-hierarchy-buttons nil 0))
4283 "^No current Info node$"
4295 "^This is the \\(?:first\\|last\\) Info node you looked at$"
4297 (add-to-list 'debug-ignored-errors mess))
4301 (defun Info-desktop-buffer-misc-data (desktop-dirname)
4303 (unless (member Info-current-file '(apropos history toc nil))
4304 (list Info-current-file Info-current-node)))
4306 (defun Info-restore-desktop-buffer (desktop-buffer-file-name
4309 "Restore an Info buffer specified in a desktop file."
4315 (Info-mode))
4316 (Info-find-node first second)
4319 (add-to-list 'desktop-buffer-mode-handlers
4320 '(Info-mode . Info-restore-desktop-buffer))