diff options
| author | Gerd Moellmann | 2000-06-05 19:22:40 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-06-05 19:22:40 +0000 |
| commit | 760d5cb38e21d41eb1dbcae844e0133b46989d32 (patch) | |
| tree | ac408b476698017f740ac978be6c1025b720dbca | |
| parent | 6a93695f4b618b6a1efd85f91e5d98da140fbb84 (diff) | |
| download | emacs-760d5cb38e21d41eb1dbcae844e0133b46989d32.tar.gz emacs-760d5cb38e21d41eb1dbcae844e0133b46989d32.zip | |
Bind case-fold-search to t when searching in case
a user sets it to nil in a hook.
| -rw-r--r-- | lisp/info.el | 370 |
1 files changed, 194 insertions, 176 deletions
diff --git a/lisp/info.el b/lisp/info.el index 4a2cca279c4..494570bb50e 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -354,12 +354,12 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." | |||
| 354 | ;; The return value is the value of point at the beginning of matching | 354 | ;; The return value is the value of point at the beginning of matching |
| 355 | ;; REGERXP, if the function succeeds, nil otherwise. | 355 | ;; REGERXP, if the function succeeds, nil otherwise. |
| 356 | (defun Info-node-at-bob-matching (regexp) | 356 | (defun Info-node-at-bob-matching (regexp) |
| 357 | (and (bobp) ; are we at beginning of buffer? | 357 | (and (bobp) ; are we at beginning of buffer? |
| 358 | (looking-at "\^_") ; does it begin with node delimiter? | 358 | (looking-at "\^_") ; does it begin with node delimiter? |
| 359 | (let (beg) | 359 | (let (beg) |
| 360 | (forward-line 1) | 360 | (forward-line 1) |
| 361 | (setq beg (point)) | 361 | (setq beg (point)) |
| 362 | (forward-line 1) ; does the line after delimiter match REGEXP? | 362 | (forward-line 1) ; does the line after delimiter match REGEXP? |
| 363 | (re-search-backward regexp beg t)))) | 363 | (re-search-backward regexp beg t)))) |
| 364 | 364 | ||
| 365 | ;; Go to an info node specified as separate filename and nodename. | 365 | ;; Go to an info node specified as separate filename and nodename. |
| @@ -686,6 +686,8 @@ else defaults to `Top'." | |||
| 686 | ;; Look at each of the other buffers one by one. | 686 | ;; Look at each of the other buffers one by one. |
| 687 | (while others | 687 | (while others |
| 688 | (let ((other (car others)) | 688 | (let ((other (car others)) |
| 689 | ;; Bind this in case the user sets it to nil. | ||
| 690 | (case-fold-search t) | ||
| 689 | this-buffer-nodes) | 691 | this-buffer-nodes) |
| 690 | ;; In each, find all the menus. | 692 | ;; In each, find all the menus. |
| 691 | (save-excursion | 693 | (save-excursion |
| @@ -712,8 +714,9 @@ else defaults to `Top'." | |||
| 712 | (setq problems t) | 714 | (setq problems t) |
| 713 | (message "No `top' node in %s" Info-dir-file-name)))) | 715 | (message "No `top' node in %s" Info-dir-file-name)))) |
| 714 | (setq others (cdr others))) | 716 | (setq others (cdr others))) |
| 715 | ;; Add to the main menu a menu item for each other node. | 717 | ;; Add to the main menu a menu item for each other node. |
| 716 | (re-search-forward "^\\* Menu:") | 718 | (let ((case-fold-search t) |
| 719 | (re-search-forward "^\\* Menu:"))) | ||
| 717 | (forward-line 1) | 720 | (forward-line 1) |
| 718 | (let ((menu-items '("top")) | 721 | (let ((menu-items '("top")) |
| 719 | (nodes nodes) | 722 | (nodes nodes) |
| @@ -734,7 +737,8 @@ else defaults to `Top'." | |||
| 734 | ;; Now take each node of each of the other buffers | 737 | ;; Now take each node of each of the other buffers |
| 735 | ;; and merge it into the main buffer. | 738 | ;; and merge it into the main buffer. |
| 736 | (while nodes | 739 | (while nodes |
| 737 | (let ((nodename (car (car nodes)))) | 740 | (let ((case-fold-search t) |
| 741 | (nodename (car (car nodes)))) | ||
| 738 | (goto-char (point-min)) | 742 | (goto-char (point-min)) |
| 739 | ;; Find the like-named node in the main buffer. | 743 | ;; Find the like-named node in the main buffer. |
| 740 | (if (re-search-forward (concat "^\^_.*\n.*Node: " | 744 | (if (re-search-forward (concat "^\^_.*\n.*Node: " |
| @@ -817,36 +821,36 @@ else defaults to `Top'." | |||
| 817 | ;; Bind this in case the user sets it to nil. | 821 | ;; Bind this in case the user sets it to nil. |
| 818 | (let ((case-fold-search t)) | 822 | (let ((case-fold-search t)) |
| 819 | (save-excursion | 823 | (save-excursion |
| 820 | ;; Find beginning of node. | 824 | ;; Find beginning of node. |
| 821 | (if (search-backward "\n\^_" nil 'move) | 825 | (if (search-backward "\n\^_" nil 'move) |
| 822 | (forward-line 2) | 826 | (forward-line 2) |
| 823 | (if (looking-at "\^_") | 827 | (if (looking-at "\^_") |
| 824 | (forward-line 1) | 828 | (forward-line 1) |
| 825 | (signal 'search-failed (list "\n\^_")))) | 829 | (signal 'search-failed (list "\n\^_")))) |
| 826 | ;; Get nodename spelled as it is in the node. | 830 | ;; Get nodename spelled as it is in the node. |
| 827 | (re-search-forward "Node:[ \t]*") | 831 | (re-search-forward "Node:[ \t]*") |
| 828 | (setq Info-current-node | 832 | (setq Info-current-node |
| 829 | (buffer-substring-no-properties (point) | 833 | (buffer-substring-no-properties (point) |
| 830 | (progn | 834 | (progn |
| 831 | (skip-chars-forward "^,\t\n") | 835 | (skip-chars-forward "^,\t\n") |
| 832 | (point)))) | 836 | (point)))) |
| 833 | (Info-set-mode-line) | 837 | (Info-set-mode-line) |
| 834 | ;; Find the end of it, and narrow. | 838 | ;; Find the end of it, and narrow. |
| 835 | (beginning-of-line) | 839 | (beginning-of-line) |
| 836 | (let (active-expression) | 840 | (let (active-expression) |
| 837 | (narrow-to-region (point) | 841 | (narrow-to-region (point) |
| 838 | (if (re-search-forward "\n[\^_\f]" nil t) | 842 | (if (re-search-forward "\n[\^_\f]" nil t) |
| 839 | (prog1 | 843 | (prog1 |
| 840 | (1- (point)) | 844 | (1- (point)) |
| 841 | (if (looking-at "[\n\^_\f]*execute: ") | 845 | (if (looking-at "[\n\^_\f]*execute: ") |
| 842 | (progn | 846 | (progn |
| 843 | (goto-char (match-end 0)) | 847 | (goto-char (match-end 0)) |
| 844 | (setq active-expression | 848 | (setq active-expression |
| 845 | (read (current-buffer)))))) | 849 | (read (current-buffer)))))) |
| 846 | (point-max))) | 850 | (point-max))) |
| 847 | (if Info-enable-active-nodes (eval active-expression)) | 851 | (if Info-enable-active-nodes (eval active-expression)) |
| 848 | (if Info-fontify (Info-fontify-node)) | 852 | (if Info-fontify (Info-fontify-node)) |
| 849 | (run-hooks 'Info-selection-hook))))) | 853 | (run-hooks 'Info-selection-hook))))) |
| 850 | 854 | ||
| 851 | (defun Info-set-mode-line () | 855 | (defun Info-set-mode-line () |
| 852 | (setq mode-line-buffer-identification | 856 | (setq mode-line-buffer-identification |
| @@ -870,8 +874,8 @@ If FORK is a string, it is the name to use for the new buffer." | |||
| 870 | (interactive (list (Info-read-node-name "Goto node: ") current-prefix-arg)) | 874 | (interactive (list (Info-read-node-name "Goto node: ") current-prefix-arg)) |
| 871 | (info-initialize) | 875 | (info-initialize) |
| 872 | (if fork | 876 | (if fork |
| 873 | (set-buffer | 877 | (set-buffer |
| 874 | (clone-buffer (concat "*info-" (if (stringp fork) fork nodename) "*") t))) | 878 | (clone-buffer (concat "*info-" (if (stringp fork) fork nodename) "*") t))) |
| 875 | (let (filename) | 879 | (let (filename) |
| 876 | (string-match "\\s *\\((\\s *\\([^\t)]*\\)\\s *)\\s *\\|\\)\\(.*\\)" | 880 | (string-match "\\s *\\((\\s *\\([^\t)]*\\)\\s *)\\s *\\|\\)\\(.*\\)" |
| 877 | nodename) | 881 | nodename) |
| @@ -986,7 +990,7 @@ If FORK is a string, it is the name to use for the new buffer." | |||
| 986 | (condition-case err | 990 | (condition-case err |
| 987 | (progn (re-search-forward regexp) (setq found (point))) | 991 | (progn (re-search-forward regexp) (setq found (point))) |
| 988 | (search-failed nil))))) | 992 | (search-failed nil))))) |
| 989 | (if (not found) ;can only happen in subfile case -- else would have erred | 993 | (if (not found) ;can only happen in subfile case -- else would have erred |
| 990 | (unwind-protect | 994 | (unwind-protect |
| 991 | (let ((list ())) | 995 | (let ((list ())) |
| 992 | (save-excursion | 996 | (save-excursion |
| @@ -1025,14 +1029,14 @@ If FORK is a string, it is the name to use for the new buffer." | |||
| 1025 | (goto-char opoint) | 1029 | (goto-char opoint) |
| 1026 | (Info-select-node) | 1030 | (Info-select-node) |
| 1027 | (set-window-start (selected-window) ostart))))) | 1031 | (set-window-start (selected-window) ostart))))) |
| 1028 | (widen) | 1032 | (widen) |
| 1029 | (goto-char found) | 1033 | (goto-char found) |
| 1030 | (Info-select-node) | 1034 | (Info-select-node) |
| 1031 | ;; Use string-equal, not equal, to ignore text props. | 1035 | ;; Use string-equal, not equal, to ignore text props. |
| 1032 | (or (and (string-equal onode Info-current-node) | 1036 | (or (and (string-equal onode Info-current-node) |
| 1033 | (equal ofile Info-current-file)) | 1037 | (equal ofile Info-current-file)) |
| 1034 | (setq Info-history (cons (list ofile onode opoint) | 1038 | (setq Info-history (cons (list ofile onode opoint) |
| 1035 | Info-history)))))) | 1039 | Info-history)))))) |
| 1036 | 1040 | ||
| 1037 | ;; Extract the value of the node-pointer named NAME. | 1041 | ;; Extract the value of the node-pointer named NAME. |
| 1038 | ;; If there is none, use ERRORNAME in the error message; | 1042 | ;; If there is none, use ERRORNAME in the error message; |
| @@ -1220,7 +1224,8 @@ NAME may be an abbreviation of the reference name." | |||
| 1220 | (defvar Info-complete-menu-buffer) | 1224 | (defvar Info-complete-menu-buffer) |
| 1221 | 1225 | ||
| 1222 | (defun Info-complete-menu-item (string predicate action) | 1226 | (defun Info-complete-menu-item (string predicate action) |
| 1223 | (let ((case-fold-search t)) | 1227 | (let ((completion-ignore-case t) |
| 1228 | (case-fold-search t)) | ||
| 1224 | (cond ((eq action nil) | 1229 | (cond ((eq action nil) |
| 1225 | (let (completions | 1230 | (let (completions |
| 1226 | (pattern (concat "\n\\* +\\(" | 1231 | (pattern (concat "\n\\* +\\(" |
| @@ -1271,7 +1276,8 @@ Completion is allowed, and the menu item point is on is the default." | |||
| 1271 | (default nil) | 1276 | (default nil) |
| 1272 | (p (point)) | 1277 | (p (point)) |
| 1273 | beg | 1278 | beg |
| 1274 | (last nil)) | 1279 | (last nil) |
| 1280 | (case-fold-search t)) | ||
| 1275 | (save-excursion | 1281 | (save-excursion |
| 1276 | (goto-char (point-min)) | 1282 | (goto-char (point-min)) |
| 1277 | (if (not (search-forward "\n* menu:" nil t)) | 1283 | (if (not (search-forward "\n* menu:" nil t)) |
| @@ -1290,7 +1296,7 @@ Completion is allowed, and the menu item point is on is the default." | |||
| 1290 | (completing-read (if default | 1296 | (completing-read (if default |
| 1291 | (format "Menu item (default %s): " | 1297 | (format "Menu item (default %s): " |
| 1292 | default) | 1298 | default) |
| 1293 | "Menu item: ") | 1299 | "Menu item: ") |
| 1294 | 'Info-complete-menu-item nil t))) | 1300 | 'Info-complete-menu-item nil t))) |
| 1295 | ;; we rely on the fact that completing-read accepts an input | 1301 | ;; we rely on the fact that completing-read accepts an input |
| 1296 | ;; of "" even when the require-match argument is true and "" | 1302 | ;; of "" even when the require-match argument is true and "" |
| @@ -1298,8 +1304,8 @@ Completion is allowed, and the menu item point is on is the default." | |||
| 1298 | (if (string= item "") | 1304 | (if (string= item "") |
| 1299 | (if default | 1305 | (if default |
| 1300 | (setq item default) | 1306 | (setq item default) |
| 1301 | ;; ask again | 1307 | ;; ask again |
| 1302 | (setq item nil)))) | 1308 | (setq item nil)))) |
| 1303 | (list item current-prefix-arg)))) | 1309 | (list item current-prefix-arg)))) |
| 1304 | ;; there is a problem here in that if several menu items have the same | 1310 | ;; there is a problem here in that if several menu items have the same |
| 1305 | ;; name you can only go to the node of the first with this command. | 1311 | ;; name you can only go to the node of the first with this command. |
| @@ -1309,29 +1315,31 @@ Completion is allowed, and the menu item point is on is the default." | |||
| 1309 | (setq menu-item (regexp-quote menu-item)) | 1315 | (setq menu-item (regexp-quote menu-item)) |
| 1310 | (let ((case-fold-search t)) | 1316 | (let ((case-fold-search t)) |
| 1311 | (save-excursion | 1317 | (save-excursion |
| 1312 | (goto-char (point-min)) | 1318 | (let ((case-fold-search t)) |
| 1313 | (or (search-forward "\n* menu:" nil t) | 1319 | (goto-char (point-min)) |
| 1314 | (error "No menu in this node")) | 1320 | (or (search-forward "\n* menu:" nil t) |
| 1315 | (or (re-search-forward (concat "\n\\* +" menu-item ":") nil t) | 1321 | (error "No menu in this node")) |
| 1316 | (re-search-forward (concat "\n\\* +" menu-item) nil t) | 1322 | (or (re-search-forward (concat "\n\\* +" menu-item ":") nil t) |
| 1317 | (error "No such item in menu")) | 1323 | (re-search-forward (concat "\n\\* +" menu-item) nil t) |
| 1318 | (beginning-of-line) | 1324 | (error "No such item in menu")) |
| 1319 | (forward-char 2) | 1325 | (beginning-of-line) |
| 1320 | (Info-extract-menu-node-name)))) | 1326 | (forward-char 2) |
| 1327 | (Info-extract-menu-node-name))))) | ||
| 1321 | 1328 | ||
| 1322 | ;; If COUNT is nil, use the last item in the menu. | 1329 | ;; If COUNT is nil, use the last item in the menu. |
| 1323 | (defun Info-extract-menu-counting (count) | 1330 | (defun Info-extract-menu-counting (count) |
| 1324 | (let ((case-fold-search t)) | 1331 | (let ((case-fold-search t)) |
| 1325 | (save-excursion | 1332 | (save-excursion |
| 1326 | (goto-char (point-min)) | 1333 | (let ((case-fold-search t)) |
| 1327 | (or (search-forward "\n* menu:" nil t) | 1334 | (goto-char (point-min)) |
| 1328 | (error "No menu in this node")) | 1335 | (or (search-forward "\n* menu:" nil t) |
| 1329 | (if count | 1336 | (error "No menu in this node")) |
| 1330 | (or (search-forward "\n* " nil t count) | 1337 | (if count |
| 1331 | (error "Too few items in menu")) | 1338 | (or (search-forward "\n* " nil t count) |
| 1332 | (while (search-forward "\n* " nil t) | 1339 | (error "Too few items in menu")) |
| 1333 | nil)) | 1340 | (while (search-forward "\n* " nil t) |
| 1334 | (Info-extract-menu-node-name)))) | 1341 | nil)) |
| 1342 | (Info-extract-menu-node-name))))) | ||
| 1335 | 1343 | ||
| 1336 | (defun Info-nth-menu-item () | 1344 | (defun Info-nth-menu-item () |
| 1337 | "Go to the node of the Nth menu item. | 1345 | "Go to the node of the Nth menu item. |
| @@ -1350,7 +1358,8 @@ N is the digit argument used to invoke this command." | |||
| 1350 | "Go to the final node in this file." | 1358 | "Go to the final node in this file." |
| 1351 | (interactive) | 1359 | (interactive) |
| 1352 | (Info-goto-node "Top") | 1360 | (Info-goto-node "Top") |
| 1353 | (let (Info-history) | 1361 | (let ((Info-history nil) |
| 1362 | (case-fold-search t)) | ||
| 1354 | ;; Go to the last node in the menu of Top. | 1363 | ;; Go to the last node in the menu of Top. |
| 1355 | (Info-goto-node (Info-extract-menu-counting nil)) | 1364 | (Info-goto-node (Info-extract-menu-counting nil)) |
| 1356 | ;; If the last node in the menu is not last in pointer structure, | 1365 | ;; If the last node in the menu is not last in pointer structure, |
| @@ -1366,36 +1375,38 @@ N is the digit argument used to invoke this command." | |||
| 1366 | (interactive) | 1375 | (interactive) |
| 1367 | (goto-char (point-min)) | 1376 | (goto-char (point-min)) |
| 1368 | (forward-line 1) | 1377 | (forward-line 1) |
| 1369 | ;; three possibilities, in order of priority: | 1378 | (let ((case-fold-search t)) |
| 1370 | ;; 1. next node is in a menu in this node (but not in an index) | 1379 | ;; three possibilities, in order of priority: |
| 1371 | ;; 2. next node is next at same level | 1380 | ;; 1. next node is in a menu in this node (but not in an index) |
| 1372 | ;; 3. next node is up and next | 1381 | ;; 2. next node is next at same level |
| 1373 | (cond ((and (not not-down) | 1382 | ;; 3. next node is up and next |
| 1374 | (save-excursion (search-forward "\n* menu:" nil t)) | 1383 | (cond ((and (not not-down) |
| 1375 | (not (string-match "\\<index\\>" Info-current-node))) | 1384 | (save-excursion (search-forward "\n* menu:" nil t)) |
| 1376 | (Info-goto-node (Info-extract-menu-counting 1)) | 1385 | (not (string-match "\\<index\\>" Info-current-node))) |
| 1377 | t) | 1386 | (Info-goto-node (Info-extract-menu-counting 1)) |
| 1378 | ((save-excursion (search-backward "next:" nil t)) | 1387 | t) |
| 1379 | (Info-next) | 1388 | ((save-excursion (search-backward "next:" nil t)) |
| 1380 | t) | 1389 | (Info-next) |
| 1381 | ((and (save-excursion (search-backward "up:" nil t)) | 1390 | t) |
| 1382 | ;; Use string-equal, not equal, to ignore text props. | 1391 | ((and (save-excursion (search-backward "up:" nil t)) |
| 1383 | (not (string-equal (downcase (Info-extract-pointer "up")) | 1392 | ;; Use string-equal, not equal, to ignore text props. |
| 1384 | "top"))) | 1393 | (not (string-equal (downcase (Info-extract-pointer "up")) |
| 1385 | (let ((old-node Info-current-node)) | 1394 | "top"))) |
| 1386 | (Info-up) | 1395 | (let ((old-node Info-current-node)) |
| 1387 | (let (Info-history success) | 1396 | (Info-up) |
| 1388 | (unwind-protect | 1397 | (let (Info-history success) |
| 1389 | (setq success (Info-forward-node t no-error)) | 1398 | (unwind-protect |
| 1390 | (or success (Info-goto-node old-node)))))) | 1399 | (setq success (Info-forward-node t no-error)) |
| 1391 | (no-error nil) | 1400 | (or success (Info-goto-node old-node)))))) |
| 1392 | (t (error "No pointer forward from this node")))) | 1401 | (no-error nil) |
| 1402 | (t (error "No pointer forward from this node"))))) | ||
| 1393 | 1403 | ||
| 1394 | (defun Info-backward-node () | 1404 | (defun Info-backward-node () |
| 1395 | "Go backward one node, considering all nodes as forming one sequence." | 1405 | "Go backward one node, considering all nodes as forming one sequence." |
| 1396 | (interactive) | 1406 | (interactive) |
| 1397 | (let ((prevnode (Info-extract-pointer "prev[ious]*" t)) | 1407 | (let ((prevnode (Info-extract-pointer "prev[ious]*" t)) |
| 1398 | (upnode (Info-extract-pointer "up" t))) | 1408 | (upnode (Info-extract-pointer "up" t)) |
| 1409 | (case-fold-search t)) | ||
| 1399 | (cond ((and upnode (string-match "(" upnode)) | 1410 | (cond ((and upnode (string-match "(" upnode)) |
| 1400 | (error "First node in file")) | 1411 | (error "First node in file")) |
| 1401 | ((and upnode (or (null prevnode) | 1412 | ((and upnode (or (null prevnode) |
| @@ -1424,12 +1435,14 @@ N is the digit argument used to invoke this command." | |||
| 1424 | 1435 | ||
| 1425 | (defun Info-next-menu-item () | 1436 | (defun Info-next-menu-item () |
| 1426 | (interactive) | 1437 | (interactive) |
| 1427 | (let ((node | 1438 | ;; Bind this in case the user sets it to nil. |
| 1428 | (save-excursion | 1439 | (let* ((case-fold-search t) |
| 1429 | (forward-line -1) | 1440 | (node |
| 1430 | (search-forward "\n* menu:" nil t) | 1441 | (save-excursion |
| 1431 | (and (search-forward "\n* " nil t) | 1442 | (forward-line -1) |
| 1432 | (Info-extract-menu-node-name))))) | 1443 | (search-forward "\n* menu:" nil t) |
| 1444 | (and (search-forward "\n* " nil t) | ||
| 1445 | (Info-extract-menu-node-name))))) | ||
| 1433 | (if node (Info-goto-node node) | 1446 | (if node (Info-goto-node node) |
| 1434 | (error "No more items in menu")))) | 1447 | (error "No more items in menu")))) |
| 1435 | 1448 | ||
| @@ -1437,9 +1450,11 @@ N is the digit argument used to invoke this command." | |||
| 1437 | (interactive) | 1450 | (interactive) |
| 1438 | (save-excursion | 1451 | (save-excursion |
| 1439 | (forward-line 1) | 1452 | (forward-line 1) |
| 1440 | (let ((beg (save-excursion | 1453 | ;; Bind this in case the user sets it to nil. |
| 1441 | (and (search-backward "\n* menu:" nil t) | 1454 | (let* ((case-fold-search t) |
| 1442 | (point))))) | 1455 | (beg (save-excursion |
| 1456 | (and (search-backward "\n* menu:" nil t) | ||
| 1457 | (point))))) | ||
| 1443 | (or (and beg (search-backward "\n* " beg t)) | 1458 | (or (and beg (search-backward "\n* " beg t)) |
| 1444 | (error "No previous items in menu"))) | 1459 | (error "No previous items in menu"))) |
| 1445 | (Info-goto-node (save-excursion | 1460 | (Info-goto-node (save-excursion |
| @@ -1491,8 +1506,9 @@ N is the digit argument used to invoke this command." | |||
| 1491 | (recenter -1)) | 1506 | (recenter -1)) |
| 1492 | ((Info-no-error (Info-up t)) | 1507 | ((Info-no-error (Info-up t)) |
| 1493 | (goto-char (point-min)) | 1508 | (goto-char (point-min)) |
| 1494 | (or (search-forward "\n* Menu:" nil t) | 1509 | (let ((case-fold-search t)) |
| 1495 | (goto-char (point-max)))) | 1510 | (or (search-forward "\n* Menu:" nil t) |
| 1511 | (goto-char (point-max))))) | ||
| 1496 | (t (error "No previous nodes")))) | 1512 | (t (error "No previous nodes")))) |
| 1497 | 1513 | ||
| 1498 | (defun Info-scroll-up () | 1514 | (defun Info-scroll-up () |
| @@ -1510,11 +1526,12 @@ normally result from this command, but can happen in other ways.)" | |||
| 1510 | (if (or (< (window-start) (point-min)) | 1526 | (if (or (< (window-start) (point-min)) |
| 1511 | (> (window-start) (point-max))) | 1527 | (> (window-start) (point-max))) |
| 1512 | (set-window-start (selected-window) (point))) | 1528 | (set-window-start (selected-window) (point))) |
| 1513 | (let ((virtual-end (save-excursion | 1529 | (let* ((case-fold-search t) |
| 1514 | (goto-char (point-min)) | 1530 | (virtual-end (save-excursion |
| 1515 | (if (search-forward "\n* Menu:" nil t) | 1531 | (goto-char (point-min)) |
| 1516 | (point) | 1532 | (if (search-forward "\n* Menu:" nil t) |
| 1517 | (point-max))))) | 1533 | (point) |
| 1534 | (point-max))))) | ||
| 1518 | (if (or (< virtual-end (window-start)) | 1535 | (if (or (< virtual-end (window-start)) |
| 1519 | (pos-visible-in-window-p virtual-end)) | 1536 | (pos-visible-in-window-p virtual-end)) |
| 1520 | (Info-next-preorder) | 1537 | (Info-next-preorder) |
| @@ -1529,7 +1546,8 @@ previous node or back up to the parent node." | |||
| 1529 | (if (or (< (window-start) (point-min)) | 1546 | (if (or (< (window-start) (point-min)) |
| 1530 | (> (window-start) (point-max))) | 1547 | (> (window-start) (point-max))) |
| 1531 | (set-window-start (selected-window) (point))) | 1548 | (set-window-start (selected-window) (point))) |
| 1532 | (let* ((current-point (point)) | 1549 | (let* ((case-fold-search t) |
| 1550 | (current-point (point)) | ||
| 1533 | (virtual-end (save-excursion | 1551 | (virtual-end (save-excursion |
| 1534 | (beginning-of-line) | 1552 | (beginning-of-line) |
| 1535 | (setq current-point (point)) | 1553 | (setq current-point (point)) |
| @@ -1654,7 +1672,7 @@ Give a blank topic name to go to the Index node itself." | |||
| 1654 | (Info-goto-node (nth 1 (car Info-index-alternatives))) | 1672 | (Info-goto-node (nth 1 (car Info-index-alternatives))) |
| 1655 | (if (> (nth 3 (car Info-index-alternatives)) 0) | 1673 | (if (> (nth 3 (car Info-index-alternatives)) 0) |
| 1656 | (forward-line (nth 3 (car Info-index-alternatives))) | 1674 | (forward-line (nth 3 (car Info-index-alternatives))) |
| 1657 | (forward-line 3) ; don't search in headers | 1675 | (forward-line 3) ; don't search in headers |
| 1658 | (let ((name (car (car Info-index-alternatives)))) | 1676 | (let ((name (car (car Info-index-alternatives)))) |
| 1659 | (Info-find-index-name name))) | 1677 | (Info-find-index-name name))) |
| 1660 | (message "Found `%s' in %s. %s" | 1678 | (message "Found `%s' in %s. %s" |
| @@ -1857,36 +1875,36 @@ If no reference to follow, moves to the next node, or up if none." | |||
| 1857 | (error nil))) | 1875 | (error nil))) |
| 1858 | 1876 | ||
| 1859 | (easy-menu-define Info-mode-menu Info-mode-map | 1877 | (easy-menu-define Info-mode-menu Info-mode-map |
| 1860 | "Menu for info files." | 1878 | "Menu for info files." |
| 1861 | '("Info" | 1879 | '("Info" |
| 1862 | ["Up" Info-up (Info-check-pointer "up") | 1880 | ["Up" Info-up (Info-check-pointer "up") |
| 1863 | :help "Go up in the Info tree"] | 1881 | :help "Go up in the Info tree"] |
| 1864 | ["Next" Info-next (Info-check-pointer "next") | 1882 | ["Next" Info-next (Info-check-pointer "next") |
| 1865 | :help "Go to the next node"] | 1883 | :help "Go to the next node"] |
| 1866 | ["Previous" Info-prev (Info-check-pointer "prev[ious]*") | 1884 | ["Previous" Info-prev (Info-check-pointer "prev[ious]*") |
| 1867 | :help "Go to the previous node"] | 1885 | :help "Go to the previous node"] |
| 1868 | ["Backward" Info-backward-node t | 1886 | ["Backward" Info-backward-node t |
| 1869 | :help "Go backward one node, considering all as a sequence"] | 1887 | :help "Go backward one node, considering all as a sequence"] |
| 1870 | ["Forward" Info-forward-node t | 1888 | ["Forward" Info-forward-node t |
| 1871 | :help "Go forward one node, considering all as a sequence"] | 1889 | :help "Go forward one node, considering all as a sequence"] |
| 1872 | ["Top" Info-top-node t | 1890 | ["Top" Info-top-node t |
| 1873 | :help "Go to top node of file"] | 1891 | :help "Go to top node of file"] |
| 1874 | ["Final node" Info-final-node t | 1892 | ["Final node" Info-final-node t |
| 1875 | :help "Go to final node in this file"] | 1893 | :help "Go to final node in this file"] |
| 1876 | ("Menu item" ["You should never see this" report-emacs-bug t]) | 1894 | ("Menu item" ["You should never see this" report-emacs-bug t]) |
| 1877 | ("Reference" ["You should never see this" report-emacs-bug t]) | 1895 | ("Reference" ["You should never see this" report-emacs-bug t]) |
| 1878 | ["Search..." Info-search t | 1896 | ["Search..." Info-search t |
| 1879 | :help "Search for regular expression in this Info file"] | 1897 | :help "Search for regular expression in this Info file"] |
| 1880 | ["Goto node..." Info-goto-node t | 1898 | ["Goto node..." Info-goto-node t |
| 1881 | :help "Go to a named node]"] | 1899 | :help "Go to a named node]"] |
| 1882 | ["Last" Info-last Info-history | 1900 | ["Last" Info-last Info-history |
| 1883 | :help "Go to the last node you were at"] | 1901 | :help "Go to the last node you were at"] |
| 1884 | ("Index..." | 1902 | ("Index..." |
| 1885 | ["Lookup a String" Info-index t | 1903 | ["Lookup a String" Info-index t |
| 1886 | :help "Look for a string in the index items"] | 1904 | :help "Look for a string in the index items"] |
| 1887 | ["Next Matching Item" Info-index-next t | 1905 | ["Next Matching Item" Info-index-next t |
| 1888 | :help "Look for another occurrence of previous item"]) | 1906 | :help "Look for another occurrence of previous item"]) |
| 1889 | ["Exit" Info-exit t])) | 1907 | ["Exit" Info-exit t])) |
| 1890 | 1908 | ||
| 1891 | (defvar Info-menu-last-node nil) | 1909 | (defvar Info-menu-last-node nil) |
| 1892 | ;; Last node the menu was created for. | 1910 | ;; Last node the menu was created for. |
| @@ -2083,7 +2101,7 @@ Allowed only if variable `Info-enable-edit' is non-nil." | |||
| 2083 | (error "Editing info nodes is not enabled")) | 2101 | (error "Editing info nodes is not enabled")) |
| 2084 | (Info-edit-mode) | 2102 | (Info-edit-mode) |
| 2085 | (message "%s" (substitute-command-keys | 2103 | (message "%s" (substitute-command-keys |
| 2086 | "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info"))) | 2104 | "Editing: Type \\<Info-edit-map>\\[Info-cease-edit] to return to info"))) |
| 2087 | 2105 | ||
| 2088 | (defun Info-cease-edit () | 2106 | (defun Info-cease-edit () |
| 2089 | "Finish editing Info node; switch back to Info proper." | 2107 | "Finish editing Info node; switch back to Info proper." |
| @@ -2149,10 +2167,10 @@ The locations are of the format used in Info-history, i.e. | |||
| 2149 | (setq Info-history (cdr Info-history)) | 2167 | (setq Info-history (cdr Info-history)) |
| 2150 | (goto-char (point-max)) | 2168 | (goto-char (point-max)) |
| 2151 | (while (re-search-backward cmd-desc nil t) | 2169 | (while (re-search-backward cmd-desc nil t) |
| 2152 | (setq where (cons (list Info-current-file | 2170 | (setq where (cons (list Info-current-file |
| 2153 | (match-string-no-properties 1) | 2171 | (match-string-no-properties 1) |
| 2154 | 0) | 2172 | 0) |
| 2155 | where))) | 2173 | where))) |
| 2156 | where))) | 2174 | where))) |
| 2157 | 2175 | ||
| 2158 | ;;;###autoload | 2176 | ;;;###autoload |
| @@ -2251,7 +2269,7 @@ The alist key is the character the title is underlined with (?*, ?= or ?-)." | |||
| 2251 | 'mouse-face 'highlight)))) | 2269 | 'mouse-face 'highlight)))) |
| 2252 | (goto-char (point-min)) | 2270 | (goto-char (point-min)) |
| 2253 | (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$" | 2271 | (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$" |
| 2254 | nil t) | 2272 | nil t) |
| 2255 | (let ((c (preceding-char)) | 2273 | (let ((c (preceding-char)) |
| 2256 | face) | 2274 | face) |
| 2257 | (cond ((= c ?*) (setq face 'Info-title-1-face)) | 2275 | (cond ((= c ?*) (setq face 'Info-title-1-face)) |
| @@ -2281,7 +2299,7 @@ The alist key is the character the title is underlined with (?*, ?= or ?-)." | |||
| 2281 | (let ((n 0)) | 2299 | (let ((n 0)) |
| 2282 | (while (re-search-forward "^\\* +\\([^:\t\n]*\\):" nil t) | 2300 | (while (re-search-forward "^\\* +\\([^:\t\n]*\\):" nil t) |
| 2283 | (setq n (1+ n)) | 2301 | (setq n (1+ n)) |
| 2284 | (if (memq n '(5 9)) ; visual aids to help with 1-9 keys | 2302 | (if (memq n '(5 9)) ; visual aids to help with 1-9 keys |
| 2285 | (put-text-property (match-beginning 0) | 2303 | (put-text-property (match-beginning 0) |
| 2286 | (1+ (match-beginning 0)) | 2304 | (1+ (match-beginning 0)) |
| 2287 | 'face 'info-menu-5)) | 2305 | 'face 'info-menu-5)) |
| @@ -2394,28 +2412,28 @@ specific node to expand." | |||
| 2394 | (defun Info-speedbar-goto-node (text node indent) | 2412 | (defun Info-speedbar-goto-node (text node indent) |
| 2395 | "When user clicks on TEXT, goto an info NODE. | 2413 | "When user clicks on TEXT, goto an info NODE. |
| 2396 | The INDENT level is ignored." | 2414 | The INDENT level is ignored." |
| 2397 | (select-frame speedbar-attached-frame) | 2415 | (select-frame speedbar-attached-frame) |
| 2398 | (let* ((buff (or (get-buffer "*info*") | 2416 | (let* ((buff (or (get-buffer "*info*") |
| 2399 | (progn (info) (get-buffer "*info*")))) | 2417 | (progn (info) (get-buffer "*info*")))) |
| 2400 | (bwin (get-buffer-window buff 0))) | 2418 | (bwin (get-buffer-window buff 0))) |
| 2401 | (if bwin | 2419 | (if bwin |
| 2402 | (progn | 2420 | (progn |
| 2403 | (select-window bwin) | 2421 | (select-window bwin) |
| 2404 | (raise-frame (window-frame bwin))) | 2422 | (raise-frame (window-frame bwin))) |
| 2405 | (if speedbar-power-click | 2423 | (if speedbar-power-click |
| 2406 | (let ((pop-up-frames t)) (select-window (display-buffer buff))) | 2424 | (let ((pop-up-frames t)) (select-window (display-buffer buff))) |
| 2407 | (select-frame speedbar-attached-frame) | 2425 | (select-frame speedbar-attached-frame) |
| 2408 | (switch-to-buffer buff))) | 2426 | (switch-to-buffer buff))) |
| 2409 | (let ((junk (string-match "^(\\([^)]+\\))\\([^.]+\\)$" node)) | 2427 | (let ((junk (string-match "^(\\([^)]+\\))\\([^.]+\\)$" node)) |
| 2410 | (file (match-string 1 node)) | 2428 | (file (match-string 1 node)) |
| 2411 | (node (match-string 2 node))) | 2429 | (node (match-string 2 node))) |
| 2412 | (Info-find-node file node) | 2430 | (Info-find-node file node) |
| 2413 | ;; If we do a find-node, and we were in info mode, restore | 2431 | ;; If we do a find-node, and we were in info mode, restore |
| 2414 | ;; the old default method. Once we are in info mode, it makes | 2432 | ;; the old default method. Once we are in info mode, it makes |
| 2415 | ;; sense to return to whatever method the user was using before. | 2433 | ;; sense to return to whatever method the user was using before. |
| 2416 | (if (string= speedbar-initial-expansion-list-name "Info") | 2434 | (if (string= speedbar-initial-expansion-list-name "Info") |
| 2417 | (speedbar-change-initial-expansion-list | 2435 | (speedbar-change-initial-expansion-list |
| 2418 | speedbar-previously-used-expansion-list-name))))) | 2436 | speedbar-previously-used-expansion-list-name))))) |
| 2419 | 2437 | ||
| 2420 | (defun Info-speedbar-expand-node (text token indent) | 2438 | (defun Info-speedbar-expand-node (text token indent) |
| 2421 | "Expand the node the user clicked on. | 2439 | "Expand the node the user clicked on. |
| @@ -2425,9 +2443,9 @@ INDENT is the current indentation depth." | |||
| 2425 | (cond ((string-match "+" text) ;we have to expand this file | 2443 | (cond ((string-match "+" text) ;we have to expand this file |
| 2426 | (speedbar-change-expand-button-char ?-) | 2444 | (speedbar-change-expand-button-char ?-) |
| 2427 | (if (speedbar-with-writable | 2445 | (if (speedbar-with-writable |
| 2428 | (save-excursion | 2446 | (save-excursion |
| 2429 | (end-of-line) (forward-char 1) | 2447 | (end-of-line) (forward-char 1) |
| 2430 | (Info-speedbar-hierarchy-buttons nil (1+ indent) token))) | 2448 | (Info-speedbar-hierarchy-buttons nil (1+ indent) token))) |
| 2431 | (speedbar-change-expand-button-char ?-) | 2449 | (speedbar-change-expand-button-char ?-) |
| 2432 | (speedbar-change-expand-button-char ??))) | 2450 | (speedbar-change-expand-button-char ??))) |
| 2433 | ((string-match "-" text) ;we have to contract this node | 2451 | ((string-match "-" text) ;we have to contract this node |