diff options
| author | Juri Linkov | 2005-08-09 08:43:02 +0000 |
|---|---|---|
| committer | Juri Linkov | 2005-08-09 08:43:02 +0000 |
| commit | 185cff95450bac41a0e590d558c7be152e732790 (patch) | |
| tree | 7f5abbcf68e2813c2616345863dda287e2af2795 | |
| parent | 5a9807a8bda5980633db765300dad40ee3aed2c6 (diff) | |
| download | emacs-185cff95450bac41a0e590d558c7be152e732790.tar.gz emacs-185cff95450bac41a0e590d558c7be152e732790.zip | |
Replace `info' with upper-case `Info' where appropriate.
(info-title-1, info-title-2, info-title-3, info-title-4)
(info-menu-header): Move up face definitions.
(info-menu-star): Rename from `info-menu-5'.
(Info-fontify-node): Replace `info-menu-5' with `info-menu-star'.
(Info-fontify-visited-nodes): Fix docstring.
(Info-hide-note-references): Fix docstring.
(Info-up, Info-next-reference, Info-prev-reference): Put cursor on
menu items in the same way as on cross-references.
(info-apropos): Fix sorting order and formatting to be like in the
stand-alone Info browser. Display error messages for 1 sec.
(Info-mode-map): Move down `c' key binding. Bind `^' to `Info-up'.
(Info-mode-menu): Remove item for `Info-search-case-sensitively'
from the menu bar.
(Info-insert-dir): Restore point after calling `insert-buffer-substring'.
| -rw-r--r-- | lisp/info.el | 211 |
1 files changed, 111 insertions, 100 deletions
diff --git a/lisp/info.el b/lisp/info.el index 4fdae4b6321..2d03190b606 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | ;;; Commentary: | 26 | ;;; Commentary: |
| 27 | 27 | ||
| 28 | ;; Note that nowadays we expect info files to be made using makeinfo. | 28 | ;; Note that nowadays we expect Info files to be made using makeinfo. |
| 29 | ;; In particular we make these assumptions: | 29 | ;; In particular we make these assumptions: |
| 30 | ;; - a menu item MAY contain colons but not colon-space ": " | 30 | ;; - a menu item MAY contain colons but not colon-space ": " |
| 31 | ;; - a menu item ending with ": " (but not ":: ") is an index entry | 31 | ;; - a menu item ending with ": " (but not ":: ") is an index entry |
| @@ -44,20 +44,20 @@ | |||
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | (defvar Info-history nil | 46 | (defvar Info-history nil |
| 47 | "Stack of info nodes user has visited. | 47 | "Stack of Info nodes user has visited. |
| 48 | Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).") | 48 | Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).") |
| 49 | 49 | ||
| 50 | (defvar Info-history-forward nil | 50 | (defvar Info-history-forward nil |
| 51 | "Stack of info nodes user has visited with `Info-history-back' command. | 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).") | 52 | Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).") |
| 53 | 53 | ||
| 54 | (defvar Info-history-list nil | 54 | (defvar Info-history-list nil |
| 55 | "List of all info nodes user has visited. | 55 | "List of all Info nodes user has visited. |
| 56 | Each element of the list is a list (FILENAME NODENAME).") | 56 | Each element of the list is a list (FILENAME NODENAME).") |
| 57 | 57 | ||
| 58 | (defcustom Info-enable-edit nil | 58 | (defcustom Info-enable-edit nil |
| 59 | "*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node. | 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. | 60 | This is convenient if you want to write Info files by hand. |
| 61 | However, we recommend that you not do this. | 61 | However, we recommend that you not do this. |
| 62 | It is better to write a Texinfo file and generate the Info file from that, | 62 | It is better to write a Texinfo file and generate the Info file from that, |
| 63 | because that gives you a printed manual as well." | 63 | because that gives you a printed manual as well." |
| @@ -76,11 +76,57 @@ The Lisp code is executed when the node is selected.") | |||
| 76 | "Face for Info node names." | 76 | "Face for Info node names." |
| 77 | :group 'info) | 77 | :group 'info) |
| 78 | 78 | ||
| 79 | (defface info-menu-5 | 79 | (defface info-title-1 |
| 80 | '((((type tty pc) (class color) (background light)) | ||
| 81 | :foreground "green" :weight bold) | ||
| 82 | (((type tty pc) (class color) (background dark)) | ||
| 83 | :foreground "yellow" :weight bold) | ||
| 84 | (t :height 1.2 :inherit info-title-2)) | ||
| 85 | "Face for info titles at level 1." | ||
| 86 | :group 'info) | ||
| 87 | ;; backward-compatibility alias | ||
| 88 | (put 'Info-title-1-face 'face-alias 'info-title-1) | ||
| 89 | |||
| 90 | (defface info-title-2 | ||
| 91 | '((((type tty pc) (class color)) :foreground "lightblue" :weight bold) | ||
| 92 | (t :height 1.2 :inherit info-title-3)) | ||
| 93 | "Face for info titles at level 2." | ||
| 94 | :group 'info) | ||
| 95 | ;; backward-compatibility alias | ||
| 96 | (put 'Info-title-2-face 'face-alias 'info-title-2) | ||
| 97 | |||
| 98 | (defface info-title-3 | ||
| 99 | '((((type tty pc) (class color)) :weight bold) | ||
| 100 | (t :height 1.2 :inherit info-title-4)) | ||
| 101 | "Face for info titles at level 3." | ||
| 102 | :group 'info) | ||
| 103 | ;; backward-compatibility alias | ||
| 104 | (put 'Info-title-3-face 'face-alias 'info-title-3) | ||
| 105 | |||
| 106 | (defface info-title-4 | ||
| 107 | '((((type tty pc) (class color)) :weight bold) | ||
| 108 | (t :weight bold :inherit variable-pitch)) | ||
| 109 | "Face for info titles at level 4." | ||
| 110 | :group 'info) | ||
| 111 | ;; backward-compatibility alias | ||
| 112 | (put 'Info-title-4-face 'face-alias 'info-title-4) | ||
| 113 | |||
| 114 | (defface info-menu-header | ||
| 115 | '((((type tty pc)) | ||
| 116 | :underline t | ||
| 117 | :weight bold) | ||
| 118 | (t | ||
| 119 | :inherit variable-pitch | ||
| 120 | :weight bold)) | ||
| 121 | "Face for headers in Info menus." | ||
| 122 | :group 'info) | ||
| 123 | |||
| 124 | (defface info-menu-star | ||
| 80 | '((((class color)) :foreground "red1") | 125 | '((((class color)) :foreground "red1") |
| 81 | (t :underline t)) | 126 | (t :underline t)) |
| 82 | "Face for every third `*' in an Info menu." | 127 | "Face for every third `*' in an Info menu." |
| 83 | :group 'info) | 128 | :group 'info) |
| 129 | (put 'info-menu-5 'face-alias 'info-menu-star) | ||
| 84 | 130 | ||
| 85 | (defface info-xref | 131 | (defface info-xref |
| 86 | '((((min-colors 88) | 132 | '((((min-colors 88) |
| @@ -101,7 +147,7 @@ The Lisp code is executed when the node is selected.") | |||
| 101 | :group 'info) | 147 | :group 'info) |
| 102 | 148 | ||
| 103 | (defcustom Info-fontify-visited-nodes t | 149 | (defcustom Info-fontify-visited-nodes t |
| 104 | "*Non-nil means to fontify visited nodes in a different face." | 150 | "*Non-nil to fontify references to visited nodes in `info-xref-visited' face." |
| 105 | :version "22.1" | 151 | :version "22.1" |
| 106 | :type 'boolean | 152 | :type 'boolean |
| 107 | :group 'info) | 153 | :group 'info) |
| @@ -165,6 +211,7 @@ These directories are searched after those in `Info-directory-list'." | |||
| 165 | 211 | ||
| 166 | (defcustom Info-scroll-prefer-subnodes nil | 212 | (defcustom Info-scroll-prefer-subnodes nil |
| 167 | "*If non-nil, \\<Info-mode-map>\\[Info-scroll-up] in a menu visits subnodes. | 213 | "*If non-nil, \\<Info-mode-map>\\[Info-scroll-up] in a menu visits subnodes. |
| 214 | |||
| 168 | If this is non-nil, and you scroll far enough in a node that its menu | 215 | If this is non-nil, and you scroll far enough in a node that its menu |
| 169 | appears on the screen, the next \\<Info-mode-map>\\[Info-scroll-up] | 216 | appears on the screen, the next \\<Info-mode-map>\\[Info-scroll-up] |
| 170 | moves to a subnode indicated by the following menu item. This means | 217 | moves to a subnode indicated by the following menu item. This means |
| @@ -180,7 +227,8 @@ when you hit the end of the current node." | |||
| 180 | (defcustom Info-hide-note-references t | 227 | (defcustom Info-hide-note-references t |
| 181 | "*If non-nil, hide the tag and section reference in *note and * menu items. | 228 | "*If non-nil, hide the tag and section reference in *note and * menu items. |
| 182 | If value is non-nil but not `hide', also replaces the \"*note\" with \"see\". | 229 | If value is non-nil but not `hide', also replaces the \"*note\" with \"see\". |
| 183 | If value is non-nil but not t or `hide', the reference section is still shown." | 230 | If value is non-nil but not t or `hide', the reference section is still shown. |
| 231 | `nil' completely disables this feature." | ||
| 184 | :version "22.1" | 232 | :version "22.1" |
| 185 | :type '(choice (const :tag "No hiding" nil) | 233 | :type '(choice (const :tag "No hiding" nil) |
| 186 | (const :tag "Replace tag and hide reference" t) | 234 | (const :tag "Replace tag and hide reference" t) |
| @@ -190,7 +238,7 @@ If value is non-nil but not t or `hide', the reference section is still shown." | |||
| 190 | 238 | ||
| 191 | (defcustom Info-refill-paragraphs nil | 239 | (defcustom Info-refill-paragraphs nil |
| 192 | "*If non-nil, attempt to refill paragraphs with hidden references. | 240 | "*If non-nil, attempt to refill paragraphs with hidden references. |
| 193 | This refilling may accidentally remove explicit line breaks in the info | 241 | This refilling may accidentally remove explicit line breaks in the Info |
| 194 | file, so be prepared for a few surprises if you enable this feature." | 242 | file, so be prepared for a few surprises if you enable this feature." |
| 195 | :version "22.1" | 243 | :version "22.1" |
| 196 | :type 'boolean | 244 | :type 'boolean |
| @@ -247,7 +295,7 @@ Can also be t when using `Info-on-current-buffer'.") | |||
| 247 | 295 | ||
| 248 | (defvar Info-current-subfile nil | 296 | (defvar Info-current-subfile nil |
| 249 | "Info subfile that is actually in the *info* buffer now. | 297 | "Info subfile that is actually in the *info* buffer now. |
| 250 | nil if current info file is not split into subfiles.") | 298 | nil if current Info file is not split into subfiles.") |
| 251 | 299 | ||
| 252 | (defvar Info-current-node nil | 300 | (defvar Info-current-node nil |
| 253 | "Name of node that Info is now looking at, or nil.") | 301 | "Name of node that Info is now looking at, or nil.") |
| @@ -357,7 +405,7 @@ be last in the list.") | |||
| 357 | (not (file-directory-p filename)))) | 405 | (not (file-directory-p filename)))) |
| 358 | 406 | ||
| 359 | (defun info-insert-file-contents (filename &optional visit) | 407 | (defun info-insert-file-contents (filename &optional visit) |
| 360 | "Insert the contents of an info file in the current buffer. | 408 | "Insert the contents of an Info file in the current buffer. |
| 361 | Do the right thing if the file has been compressed or zipped." | 409 | Do the right thing if the file has been compressed or zipped." |
| 362 | (let* ((tail Info-suffix-list) | 410 | (let* ((tail Info-suffix-list) |
| 363 | (lfn (if (fboundp 'msdos-long-file-names) | 411 | (lfn (if (fboundp 'msdos-long-file-names) |
| @@ -632,12 +680,12 @@ just return nil (no error)." | |||
| 632 | filename))) | 680 | filename))) |
| 633 | 681 | ||
| 634 | (defun Info-find-node (filename nodename &optional no-going-back) | 682 | (defun Info-find-node (filename nodename &optional no-going-back) |
| 635 | "Go to an info node specified as separate FILENAME and NODENAME. | 683 | "Go to an Info node specified as separate FILENAME and NODENAME. |
| 636 | NO-GOING-BACK is non-nil if recovering from an error in this function; | 684 | NO-GOING-BACK is non-nil if recovering from an error in this function; |
| 637 | it says do not attempt further (recursive) error recovery." | 685 | it says do not attempt further (recursive) error recovery." |
| 638 | (info-initialize) | 686 | (info-initialize) |
| 639 | (setq filename (Info-find-file filename)) | 687 | (setq filename (Info-find-file filename)) |
| 640 | ;; Go into info buffer. | 688 | ;; Go into Info buffer. |
| 641 | (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")) | 689 | (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")) |
| 642 | ;; Record the node we are leaving. | 690 | ;; Record the node we are leaving. |
| 643 | (if (and Info-current-file (not no-going-back)) | 691 | (if (and Info-current-file (not no-going-back)) |
| @@ -647,7 +695,7 @@ it says do not attempt further (recursive) error recovery." | |||
| 647 | (Info-find-node-2 filename nodename no-going-back)) | 695 | (Info-find-node-2 filename nodename no-going-back)) |
| 648 | 696 | ||
| 649 | (defun Info-on-current-buffer (&optional nodename) | 697 | (defun Info-on-current-buffer (&optional nodename) |
| 650 | "Use the `Info-mode' to browse the current info buffer. | 698 | "Use the `Info-mode' to browse the current Info buffer. |
| 651 | If a prefix arg is provided, it queries for the NODENAME which | 699 | If a prefix arg is provided, it queries for the NODENAME which |
| 652 | else defaults to \"Top\"." | 700 | else defaults to \"Top\"." |
| 653 | (interactive | 701 | (interactive |
| @@ -665,7 +713,7 @@ else defaults to \"Top\"." | |||
| 665 | ;; makeinfo-buffer) out of the way of normal operations. | 713 | ;; makeinfo-buffer) out of the way of normal operations. |
| 666 | ;; | 714 | ;; |
| 667 | (defun Info-revert-find-node (filename nodename) | 715 | (defun Info-revert-find-node (filename nodename) |
| 668 | "Go to an info node FILENAME and NODENAME, re-reading disk contents. | 716 | "Go to an Info node FILENAME and NODENAME, re-reading disk contents. |
| 669 | When *info* is already displaying FILENAME and NODENAME, the window position | 717 | When *info* is already displaying FILENAME and NODENAME, the window position |
| 670 | is preserved, if possible." | 718 | is preserved, if possible." |
| 671 | (pop-to-buffer "*info*") | 719 | (pop-to-buffer "*info*") |
| @@ -1028,7 +1076,7 @@ a case-insensitive match is tried." | |||
| 1028 | ;; Insert the entire original dir file as a start; note that we've | 1076 | ;; Insert the entire original dir file as a start; note that we've |
| 1029 | ;; already saved its default directory to use as the default | 1077 | ;; already saved its default directory to use as the default |
| 1030 | ;; directory for the whole concatenation. | 1078 | ;; directory for the whole concatenation. |
| 1031 | (insert-buffer-substring buffer) | 1079 | (goto-char (prog1 (point) (insert-buffer-substring buffer))) |
| 1032 | 1080 | ||
| 1033 | ;; Look at each of the other buffers one by one. | 1081 | ;; Look at each of the other buffers one by one. |
| 1034 | (dolist (other others) | 1082 | (dolist (other others) |
| @@ -1287,7 +1335,7 @@ any double quotes or backslashes must be escaped (\\\",\\\\)." | |||
| 1287 | (set-buffer-modified-p nil))) | 1335 | (set-buffer-modified-p nil))) |
| 1288 | 1336 | ||
| 1289 | (defun Info-select-node () | 1337 | (defun Info-select-node () |
| 1290 | "Select the info node that point is in." | 1338 | "Select the Info node that point is in." |
| 1291 | ;; Bind this in case the user sets it to nil. | 1339 | ;; Bind this in case the user sets it to nil. |
| 1292 | (let ((case-fold-search t)) | 1340 | (let ((case-fold-search t)) |
| 1293 | (save-excursion | 1341 | (save-excursion |
| @@ -1343,20 +1391,20 @@ any double quotes or backslashes must be escaped (\\\",\\\\)." | |||
| 1343 | ") " | 1391 | ") " |
| 1344 | (or Info-current-node "")))))) | 1392 | (or Info-current-node "")))))) |
| 1345 | 1393 | ||
| 1346 | ;; Go to an info node specified with a filename-and-nodename string | 1394 | ;; Go to an Info node specified with a filename-and-nodename string |
| 1347 | ;; of the sort that is found in pointers in nodes. | 1395 | ;; of the sort that is found in pointers in nodes. |
| 1348 | 1396 | ||
| 1349 | ;; Don't autoload this function: the correct entry point for other packages | 1397 | ;; Don't autoload this function: the correct entry point for other packages |
| 1350 | ;; to use is `info'. --Stef | 1398 | ;; to use is `info'. --Stef |
| 1351 | ;; ;;;###autoload | 1399 | ;; ;;;###autoload |
| 1352 | (defun Info-goto-node (nodename &optional fork) | 1400 | (defun Info-goto-node (nodename &optional fork) |
| 1353 | "Go to info node named NODENAME. Give just NODENAME or (FILENAME)NODENAME. | 1401 | "Go to Info node named NODENAME. Give just NODENAME or (FILENAME)NODENAME. |
| 1354 | If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file | 1402 | If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file |
| 1355 | FILENAME; otherwise, NODENAME should be in the current Info file (or one of | 1403 | FILENAME; otherwise, NODENAME should be in the current Info file (or one of |
| 1356 | its sub-files). | 1404 | its sub-files). |
| 1357 | Completion is available, but only for node names in the current Info file. | 1405 | Completion is available, but only for node names in the current Info file. |
| 1358 | If FORK is non-nil (interactively with a prefix arg), show the node in | 1406 | If FORK is non-nil (interactively with a prefix arg), show the node in |
| 1359 | a new info buffer. | 1407 | a new Info buffer. |
| 1360 | If FORK is a string, it is the name to use for the new buffer." | 1408 | If FORK is a string, it is the name to use for the new buffer." |
| 1361 | (interactive (list (Info-read-node-name "Go to node: ") current-prefix-arg)) | 1409 | (interactive (list (Info-read-node-name "Go to node: ") current-prefix-arg)) |
| 1362 | (info-initialize) | 1410 | (info-initialize) |
| @@ -1402,7 +1450,7 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." | |||
| 1402 | ;; include it. | 1450 | ;; include it. |
| 1403 | (and (or (null (file-name-extension file)) | 1451 | (and (or (null (file-name-extension file)) |
| 1404 | (string-match suffix file)) | 1452 | (string-match suffix file)) |
| 1405 | ;; But exclude subfiles of split info files. | 1453 | ;; But exclude subfiles of split Info files. |
| 1406 | (not (string-match "-[0-9]+\\'" file)) | 1454 | (not (string-match "-[0-9]+\\'" file)) |
| 1407 | ;; And exclude backup files. | 1455 | ;; And exclude backup files. |
| 1408 | (not (string-match "~\\'" file)) | 1456 | (not (string-match "~\\'" file)) |
| @@ -1822,7 +1870,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." | |||
| 1822 | (concat "\n\\* +\\(" (regexp-quote old-node) | 1870 | (concat "\n\\* +\\(" (regexp-quote old-node) |
| 1823 | ":\\|[^:]+: +" (regexp-quote old-node) "\\)")) | 1871 | ":\\|[^:]+: +" (regexp-quote old-node) "\\)")) |
| 1824 | nil t)) | 1872 | nil t)) |
| 1825 | (beginning-of-line) | 1873 | (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2))) |
| 1826 | (goto-char p) | 1874 | (goto-char p) |
| 1827 | (Info-restore-point Info-history)))) | 1875 | (Info-restore-point Info-history)))) |
| 1828 | 1876 | ||
| @@ -2011,7 +2059,7 @@ Table of contents is created from the tree structure of menus." | |||
| 2011 | "Follow cross reference named FOOTNOTENAME to the node it refers to. | 2059 | "Follow cross reference named FOOTNOTENAME to the node it refers to. |
| 2012 | FOOTNOTENAME may be an abbreviation of the reference name. | 2060 | FOOTNOTENAME may be an abbreviation of the reference name. |
| 2013 | If FORK is non-nil (interactively with a prefix arg), show the node in | 2061 | If FORK is non-nil (interactively with a prefix arg), show the node in |
| 2014 | a new info buffer. If FORK is a string, it is the name to use for the | 2062 | a new Info buffer. If FORK is a string, it is the name to use for the |
| 2015 | new buffer." | 2063 | new buffer." |
| 2016 | (interactive | 2064 | (interactive |
| 2017 | (let ((completion-ignore-case t) | 2065 | (let ((completion-ignore-case t) |
| @@ -2222,7 +2270,7 @@ Because of ambiguities, this should be concatenated with something like | |||
| 2222 | The menu item should one of those listed in the current node's menu. | 2270 | The menu item should one of those listed in the current node's menu. |
| 2223 | Completion is allowed, and the default menu item is the one point is on. | 2271 | Completion is allowed, and the default menu item is the one point is on. |
| 2224 | If FORK is non-nil (interactively with a prefix arg), show the node in | 2272 | If FORK is non-nil (interactively with a prefix arg), show the node in |
| 2225 | a new info buffer. If FORK is a string, it is the name to use for the | 2273 | a new Info buffer. If FORK is a string, it is the name to use for the |
| 2226 | new buffer." | 2274 | new buffer." |
| 2227 | (interactive | 2275 | (interactive |
| 2228 | (let ((completions '()) | 2276 | (let ((completions '()) |
| @@ -2547,7 +2595,9 @@ parent node." | |||
| 2547 | (if (looking-at "\\* Menu:") | 2595 | (if (looking-at "\\* Menu:") |
| 2548 | (if recur | 2596 | (if recur |
| 2549 | (error "No cross references in this node") | 2597 | (error "No cross references in this node") |
| 2550 | (Info-next-reference t))))) | 2598 | (Info-next-reference t)) |
| 2599 | (if (looking-at "^\\* ") | ||
| 2600 | (forward-char 2))))) | ||
| 2551 | 2601 | ||
| 2552 | (defun Info-prev-reference (&optional recur) | 2602 | (defun Info-prev-reference (&optional recur) |
| 2553 | "Move cursor to the previous cross-reference or menu item in the node." | 2603 | "Move cursor to the previous cross-reference or menu item in the node." |
| @@ -2566,7 +2616,9 @@ parent node." | |||
| 2566 | (if (looking-at "\\* Menu:") | 2616 | (if (looking-at "\\* Menu:") |
| 2567 | (if recur | 2617 | (if recur |
| 2568 | (error "No cross references in this node") | 2618 | (error "No cross references in this node") |
| 2569 | (Info-prev-reference t))))) | 2619 | (Info-prev-reference t)) |
| 2620 | (if (looking-at "^\\* ") | ||
| 2621 | (forward-char 2))))) | ||
| 2570 | 2622 | ||
| 2571 | (defvar Info-index-nodes nil | 2623 | (defvar Info-index-nodes nil |
| 2572 | "Alist of cached index node names of visited Info files. | 2624 | "Alist of cached index node names of visited Info files. |
| @@ -2800,25 +2852,29 @@ Build a menu of the possible matches." | |||
| 2800 | (goto-char (point-min)) | 2852 | (goto-char (point-min)) |
| 2801 | (re-search-forward "\\* Menu: *\n" nil t) | 2853 | (re-search-forward "\\* Menu: *\n" nil t) |
| 2802 | (while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t) | 2854 | (while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t) |
| 2803 | (add-to-list 'manuals (match-string 1))) | 2855 | (setq manuals (cons (match-string 1) manuals))) |
| 2804 | (dolist (manual manuals) | 2856 | (dolist (manual (nreverse manuals)) |
| 2805 | (message "Searching %s" manual) | 2857 | (message "Searching %s" manual) |
| 2806 | (if (setq nodes (Info-index-nodes (Info-find-file manual))) | 2858 | (condition-case err |
| 2807 | (condition-case nil | 2859 | (if (setq nodes (Info-index-nodes (Info-find-file manual))) |
| 2808 | (save-excursion | 2860 | (save-excursion |
| 2809 | (Info-find-node manual (car nodes)) | 2861 | (Info-find-node manual (car nodes)) |
| 2810 | (while | 2862 | (while |
| 2811 | (progn | 2863 | (progn |
| 2812 | (goto-char (point-min)) | 2864 | (goto-char (point-min)) |
| 2813 | (while (re-search-forward pattern nil t) | 2865 | (while (re-search-forward pattern nil t) |
| 2814 | (add-to-list 'matches | 2866 | (setq matches |
| 2815 | (list manual | 2867 | (cons (list manual |
| 2816 | (match-string-no-properties 1) | 2868 | (match-string-no-properties 1) |
| 2817 | (match-string-no-properties 2) | 2869 | (match-string-no-properties 2) |
| 2818 | (match-string-no-properties 3)))) | 2870 | (match-string-no-properties 3)) |
| 2871 | matches))) | ||
| 2819 | (setq nodes (cdr nodes) node (car nodes))) | 2872 | (setq nodes (cdr nodes) node (car nodes))) |
| 2820 | (Info-goto-node node))) | 2873 | (Info-goto-node node)))) |
| 2821 | (error nil))))) | 2874 | (error |
| 2875 | (message "%s" (if (eq (car-safe err) 'error) | ||
| 2876 | (nth 1 err) err)) | ||
| 2877 | (sit-for 1 t))))) | ||
| 2822 | (Info-goto-node (concat "(" current-file ")" current-node)) | 2878 | (Info-goto-node (concat "(" current-file ")" current-node)) |
| 2823 | (setq Info-history ohist | 2879 | (setq Info-history ohist |
| 2824 | Info-history-list ohist-list) | 2880 | Info-history-list ohist-list) |
| @@ -2828,8 +2884,8 @@ Build a menu of the possible matches." | |||
| 2828 | (with-current-buffer (get-buffer-create " *info-apropos*") | 2884 | (with-current-buffer (get-buffer-create " *info-apropos*") |
| 2829 | (erase-buffer) | 2885 | (erase-buffer) |
| 2830 | (insert "\n\^_\nFile: apropos, Node: Index, Up: (dir)\n") | 2886 | (insert "\n\^_\nFile: apropos, Node: Index, Up: (dir)\n") |
| 2831 | (insert "* Menu: \nNodes whose indices contain \"" string "\"\n\n") | 2887 | (insert "* Menu: \nNodes whose indices contain `" string "':\n\n") |
| 2832 | (dolist (entry matches) | 2888 | (dolist (entry (nreverse matches)) |
| 2833 | (insert | 2889 | (insert |
| 2834 | (format "* %-38s (%s)%s.%s\n" | 2890 | (format "* %-38s (%s)%s.%s\n" |
| 2835 | (concat (nth 1 entry) " [" (nth 0 entry) "]:") | 2891 | (concat (nth 1 entry) " [" (nth 0 entry) "]:") |
| @@ -3002,7 +3058,6 @@ if point is in a menu item description, follow that menu item." | |||
| 3002 | (define-key Info-mode-map "<" 'Info-top-node) | 3058 | (define-key Info-mode-map "<" 'Info-top-node) |
| 3003 | (define-key Info-mode-map ">" 'Info-final-node) | 3059 | (define-key Info-mode-map ">" 'Info-final-node) |
| 3004 | (define-key Info-mode-map "b" 'beginning-of-buffer) | 3060 | (define-key Info-mode-map "b" 'beginning-of-buffer) |
| 3005 | (define-key Info-mode-map "c" 'Info-copy-current-node-name) | ||
| 3006 | (define-key Info-mode-map "d" 'Info-directory) | 3061 | (define-key Info-mode-map "d" 'Info-directory) |
| 3007 | (define-key Info-mode-map "e" 'Info-edit) | 3062 | (define-key Info-mode-map "e" 'Info-edit) |
| 3008 | (define-key Info-mode-map "f" 'Info-follow-reference) | 3063 | (define-key Info-mode-map "f" 'Info-follow-reference) |
| @@ -3024,8 +3079,11 @@ if point is in a menu item description, follow that menu item." | |||
| 3024 | (define-key Info-mode-map "t" 'Info-top-node) | 3079 | (define-key Info-mode-map "t" 'Info-top-node) |
| 3025 | (define-key Info-mode-map "T" 'Info-toc) | 3080 | (define-key Info-mode-map "T" 'Info-toc) |
| 3026 | (define-key Info-mode-map "u" 'Info-up) | 3081 | (define-key Info-mode-map "u" 'Info-up) |
| 3027 | ;; For consistency with dired-copy-filename-as-kill. | 3082 | ;; `w' for consistency with `dired-copy-filename-as-kill'. |
| 3028 | (define-key Info-mode-map "w" 'Info-copy-current-node-name) | 3083 | (define-key Info-mode-map "w" 'Info-copy-current-node-name) |
| 3084 | (define-key Info-mode-map "c" 'Info-copy-current-node-name) | ||
| 3085 | ;; `^' for consistency with `dired-up-directory'. | ||
| 3086 | (define-key Info-mode-map "^" 'Info-up) | ||
| 3029 | (define-key Info-mode-map "," 'Info-index-next) | 3087 | (define-key Info-mode-map "," 'Info-index-next) |
| 3030 | (define-key Info-mode-map "\177" 'Info-scroll-down) | 3088 | (define-key Info-mode-map "\177" 'Info-scroll-down) |
| 3031 | (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node) | 3089 | (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node) |
| @@ -3040,7 +3098,7 @@ if point is in a menu item description, follow that menu item." | |||
| 3040 | 3098 | ||
| 3041 | (easy-menu-define | 3099 | (easy-menu-define |
| 3042 | Info-mode-menu Info-mode-map | 3100 | Info-mode-menu Info-mode-map |
| 3043 | "Menu for info files." | 3101 | "Menu for Info files." |
| 3044 | '("Info" | 3102 | '("Info" |
| 3045 | ["Up" Info-up :active (Info-check-pointer "up") | 3103 | ["Up" Info-up :active (Info-check-pointer "up") |
| 3046 | :help "Go up in the Info tree"] | 3104 | :help "Go up in the Info tree"] |
| @@ -3062,8 +3120,6 @@ if point is in a menu item description, follow that menu item." | |||
| 3062 | ("Reference" ["You should never see this" report-emacs-bug t]) | 3120 | ("Reference" ["You should never see this" report-emacs-bug t]) |
| 3063 | ["Search..." Info-search | 3121 | ["Search..." Info-search |
| 3064 | :help "Search for regular expression in this Info file"] | 3122 | :help "Search for regular expression in this Info file"] |
| 3065 | ["Search Case-Sensitively..." Info-search-case-sensitively | ||
| 3066 | :help "Search for regular expression case sensitively"] | ||
| 3067 | ["Search Next" Info-search-next | 3123 | ["Search Next" Info-search-next |
| 3068 | :help "Search for another occurrence of regular expression"] | 3124 | :help "Search for another occurrence of regular expression"] |
| 3069 | ["Go to Node..." Info-goto-node | 3125 | ["Go to Node..." Info-goto-node |
| @@ -3175,12 +3231,12 @@ if point is in a menu item description, follow that menu item." | |||
| 3175 | 3231 | ||
| 3176 | 3232 | ||
| 3177 | (defun Info-copy-current-node-name (&optional arg) | 3233 | (defun Info-copy-current-node-name (&optional arg) |
| 3178 | "Put the name of the current info node into the kill ring. | 3234 | "Put the name of the current Info node into the kill ring. |
| 3179 | The name of the info file is prepended to the node name in parentheses. | 3235 | The name of the Info file is prepended to the node name in parentheses. |
| 3180 | With a zero prefix arg, put the name inside a function call to `info'." | 3236 | With a zero prefix arg, put the name inside a function call to `info'." |
| 3181 | (interactive "P") | 3237 | (interactive "P") |
| 3182 | (unless Info-current-node | 3238 | (unless Info-current-node |
| 3183 | (error "No current info node")) | 3239 | (error "No current Info node")) |
| 3184 | (let ((node (concat "(" (file-name-nondirectory | 3240 | (let ((node (concat "(" (file-name-nondirectory |
| 3185 | (or (and (stringp Info-current-file) | 3241 | (or (and (stringp Info-current-file) |
| 3186 | Info-current-file) | 3242 | Info-current-file) |
| @@ -3246,7 +3302,7 @@ Moving within a node: | |||
| 3246 | \\[beginning-of-buffer] Go to beginning of node. | 3302 | \\[beginning-of-buffer] Go to beginning of node. |
| 3247 | 3303 | ||
| 3248 | Advanced commands: | 3304 | Advanced commands: |
| 3249 | \\[Info-copy-current-node-name] Put name of current info node in the kill ring. | 3305 | \\[Info-copy-current-node-name] Put name of current Info node in the kill ring. |
| 3250 | \\[clone-buffer] Select a new cloned Info buffer in another window. | 3306 | \\[clone-buffer] Select a new cloned Info buffer in another window. |
| 3251 | \\[Info-edit] Edit contents of selected node. | 3307 | \\[Info-edit] Edit contents of selected node. |
| 3252 | 1 .. 9 Pick first ... ninth item in node's menu. | 3308 | 1 .. 9 Pick first ... ninth item in node's menu. |
| @@ -3356,7 +3412,7 @@ which returns to Info mode for browsing. | |||
| 3356 | Allowed only if variable `Info-enable-edit' is non-nil." | 3412 | Allowed only if variable `Info-enable-edit' is non-nil." |
| 3357 | (interactive) | 3413 | (interactive) |
| 3358 | (or Info-enable-edit | 3414 | (or Info-enable-edit |
| 3359 | (error "Editing info nodes is not enabled")) | 3415 | (error "Editing Info nodes is not enabled")) |
| 3360 | (Info-edit-mode) | 3416 | (Info-edit-mode) |
| 3361 | (message "%s" (substitute-command-keys | 3417 | (message "%s" (substitute-command-keys |
| 3362 | "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info"))) | 3418 | "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info"))) |
| @@ -3418,7 +3474,7 @@ in the first element of the returned list (which is treated specially in | |||
| 3418 | "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\." | 3474 | "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\." |
| 3419 | "\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?")) | 3475 | "\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?")) |
| 3420 | (info-file "emacs")) ;default | 3476 | (info-file "emacs")) ;default |
| 3421 | ;; Determine which info file this command is documented in. | 3477 | ;; Determine which Info file this command is documented in. |
| 3422 | (if (get command 'info-file) | 3478 | (if (get command 'info-file) |
| 3423 | (setq info-file (get command 'info-file)) | 3479 | (setq info-file (get command 'info-file)) |
| 3424 | ;; If it doesn't say explicitly, test its name against | 3480 | ;; If it doesn't say explicitly, test its name against |
| @@ -3527,51 +3583,6 @@ the variable `Info-file-list-for-emacs'." | |||
| 3527 | (t | 3583 | (t |
| 3528 | (Info-goto-emacs-command-node command))))) | 3584 | (Info-goto-emacs-command-node command))))) |
| 3529 | 3585 | ||
| 3530 | (defface info-title-1 | ||
| 3531 | '((((type tty pc) (class color) (background light)) | ||
| 3532 | :foreground "green" :weight bold) | ||
| 3533 | (((type tty pc) (class color) (background dark)) | ||
| 3534 | :foreground "yellow" :weight bold) | ||
| 3535 | (t :height 1.2 :inherit info-title-2)) | ||
| 3536 | "Face for info titles at level 1." | ||
| 3537 | :group 'info) | ||
| 3538 | ;; backward-compatibility alias | ||
| 3539 | (put 'Info-title-1-face 'face-alias 'info-title-1) | ||
| 3540 | |||
| 3541 | (defface info-title-2 | ||
| 3542 | '((((type tty pc) (class color)) :foreground "lightblue" :weight bold) | ||
| 3543 | (t :height 1.2 :inherit info-title-3)) | ||
| 3544 | "Face for info titles at level 2." | ||
| 3545 | :group 'info) | ||
| 3546 | ;; backward-compatibility alias | ||
| 3547 | (put 'Info-title-2-face 'face-alias 'info-title-2) | ||
| 3548 | |||
| 3549 | (defface info-title-3 | ||
| 3550 | '((((type tty pc) (class color)) :weight bold) | ||
| 3551 | (t :height 1.2 :inherit info-title-4)) | ||
| 3552 | "Face for info titles at level 3." | ||
| 3553 | :group 'info) | ||
| 3554 | ;; backward-compatibility alias | ||
| 3555 | (put 'Info-title-3-face 'face-alias 'info-title-3) | ||
| 3556 | |||
| 3557 | (defface info-title-4 | ||
| 3558 | '((((type tty pc) (class color)) :weight bold) | ||
| 3559 | (t :weight bold :inherit variable-pitch)) | ||
| 3560 | "Face for info titles at level 4." | ||
| 3561 | :group 'info) | ||
| 3562 | ;; backward-compatibility alias | ||
| 3563 | (put 'Info-title-4-face 'face-alias 'info-title-4) | ||
| 3564 | |||
| 3565 | (defface info-menu-header | ||
| 3566 | '((((type tty pc)) | ||
| 3567 | :underline t | ||
| 3568 | :weight bold) | ||
| 3569 | (t | ||
| 3570 | :inherit variable-pitch | ||
| 3571 | :weight bold)) | ||
| 3572 | "Face for headers in Info menus." | ||
| 3573 | :group 'info) | ||
| 3574 | |||
| 3575 | (defun Info-escape-percent (string) | 3586 | (defun Info-escape-percent (string) |
| 3576 | "Double all occurrences of `%' in STRING. | 3587 | "Double all occurrences of `%' in STRING. |
| 3577 | 3588 | ||
| @@ -3868,7 +3879,7 @@ Preserve text properties." | |||
| 3868 | (if (and (<= n 9) (zerop (% n 3))) ; visual aids to help with 1-9 keys | 3879 | (if (and (<= n 9) (zerop (% n 3))) ; visual aids to help with 1-9 keys |
| 3869 | (put-text-property (match-beginning 0) | 3880 | (put-text-property (match-beginning 0) |
| 3870 | (1+ (match-beginning 0)) | 3881 | (1+ (match-beginning 0)) |
| 3871 | 'font-lock-face 'info-menu-5))) | 3882 | 'font-lock-face 'info-menu-star))) |
| 3872 | (when not-fontified-p | 3883 | (when not-fontified-p |
| 3873 | (add-text-properties | 3884 | (add-text-properties |
| 3874 | (match-beginning 1) (match-end 1) | 3885 | (match-beginning 1) (match-end 1) |
| @@ -3962,7 +3973,7 @@ Preserve text properties." | |||
| 3962 | 3973 | ||
| 3963 | ;;; Speedbar support: | 3974 | ;;; Speedbar support: |
| 3964 | ;; These functions permit speedbar to display the "tags" in the | 3975 | ;; These functions permit speedbar to display the "tags" in the |
| 3965 | ;; current info node. | 3976 | ;; current Info node. |
| 3966 | (eval-when-compile (require 'speedbar)) | 3977 | (eval-when-compile (require 'speedbar)) |
| 3967 | 3978 | ||
| 3968 | (defvar Info-speedbar-key-map nil | 3979 | (defvar Info-speedbar-key-map nil |
| @@ -4004,7 +4015,7 @@ Preserve text properties." | |||
| 4004 | ;;; Info hierarchy display method | 4015 | ;;; Info hierarchy display method |
| 4005 | ;;;###autoload | 4016 | ;;;###autoload |
| 4006 | (defun Info-speedbar-browser () | 4017 | (defun Info-speedbar-browser () |
| 4007 | "Initialize speedbar to display an info node browser. | 4018 | "Initialize speedbar to display an Info node browser. |
| 4008 | This will add a speedbar major display mode." | 4019 | This will add a speedbar major display mode." |
| 4009 | (interactive) | 4020 | (interactive) |
| 4010 | (require 'speedbar) | 4021 | (require 'speedbar) |
| @@ -4145,7 +4156,7 @@ BUFFER is the buffer speedbar is requesting buttons for." | |||
| 4145 | "^No `.*' in index$" | 4156 | "^No `.*' in index$" |
| 4146 | "^No cross-reference named" | 4157 | "^No cross-reference named" |
| 4147 | "^No cross.references in this node$" | 4158 | "^No cross.references in this node$" |
| 4148 | "^No current info node$" | 4159 | "^No current Info node$" |
| 4149 | "^No menu in this node$" | 4160 | "^No menu in this node$" |
| 4150 | "^No more items in menu$" | 4161 | "^No more items in menu$" |
| 4151 | "^No more nodes$" | 4162 | "^No more nodes$" |
| @@ -4172,7 +4183,7 @@ BUFFER is the buffer speedbar is requesting buttons for." | |||
| 4172 | (defun Info-restore-desktop-buffer (desktop-buffer-file-name | 4183 | (defun Info-restore-desktop-buffer (desktop-buffer-file-name |
| 4173 | desktop-buffer-name | 4184 | desktop-buffer-name |
| 4174 | desktop-buffer-misc) | 4185 | desktop-buffer-misc) |
| 4175 | "Restore an info buffer specified in a desktop file." | 4186 | "Restore an Info buffer specified in a desktop file." |
| 4176 | (let ((first (nth 0 desktop-buffer-misc)) | 4187 | (let ((first (nth 0 desktop-buffer-misc)) |
| 4177 | (second (nth 1 desktop-buffer-misc))) | 4188 | (second (nth 1 desktop-buffer-misc))) |
| 4178 | (when (and first second) | 4189 | (when (and first second) |