aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/info.el52
1 files changed, 18 insertions, 34 deletions
diff --git a/lisp/info.el b/lisp/info.el
index c48e2800cf3..8da9f0ad27e 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -963,15 +963,13 @@ If FORK is a string, it is the name to use for the new buffer."
963 (goto-char marker) 963 (goto-char marker)
964 (while (re-search-forward "\nNode: \\(.*\\)\177" nil t) 964 (while (re-search-forward "\nNode: \\(.*\\)\177" nil t)
965 (setq compl 965 (setq compl
966 (cons (list (buffer-substring (match-beginning 1) 966 (cons (list (match-string-no-properties 1))
967 (match-end 1)))
968 compl)))) 967 compl))))
969 (widen) 968 (widen)
970 (goto-char (point-min)) 969 (goto-char (point-min))
971 ;; If the buffer begins with a node header, process that first. 970 ;; If the buffer begins with a node header, process that first.
972 (if (Info-node-at-bob-matching node-regexp) 971 (if (Info-node-at-bob-matching node-regexp)
973 (setq compl (list (buffer-substring (match-beginning 1) 972 (setq compl (list (match-string-no-properties 1))))
974 (match-end 1)))))
975 ;; Now for the rest of the nodes. 973 ;; Now for the rest of the nodes.
976 (while (search-forward "\n\^_" nil t) 974 (while (search-forward "\n\^_" nil t)
977 (forward-line 1) 975 (forward-line 1)
@@ -979,8 +977,7 @@ If FORK is a string, it is the name to use for the new buffer."
979 (forward-line 1) 977 (forward-line 1)
980 (if (re-search-backward node-regexp beg t) 978 (if (re-search-backward node-regexp beg t)
981 (setq compl 979 (setq compl
982 (cons (list (buffer-substring (match-beginning 1) 980 (cons (list (match-string-no-properties 1))
983 (match-end 1)))
984 compl)))))))) 981 compl))))))))
985 (setq compl (cons '("*") compl)) 982 (setq compl (cons '("*") compl))
986 (setq Info-current-file-completions compl)))) 983 (setq Info-current-file-completions compl))))
@@ -1039,8 +1036,7 @@ If FORK is a string, it is the name to use for the new buffer."
1039 (re-search-forward "\\(^.*\\): [0-9]+$") 1036 (re-search-forward "\\(^.*\\): [0-9]+$")
1040 (goto-char (+ (match-end 1) 2)) 1037 (goto-char (+ (match-end 1) 2))
1041 (setq list (cons (cons (read (current-buffer)) 1038 (setq list (cons (cons (read (current-buffer))
1042 (buffer-substring 1039 (match-string-no-properties 1))
1043 (match-beginning 1) (match-end 1)))
1044 list)) 1040 list))
1045 (goto-char (1+ (match-end 0)))) 1041 (goto-char (1+ (match-end 0))))
1046 (setq list (nreverse list) 1042 (setq list (nreverse list)
@@ -1158,7 +1154,7 @@ NAME may be an abbreviation of the reference name."
1158 1154
1159 (goto-char (point-min)) 1155 (goto-char (point-min))
1160 (while (re-search-forward "\\*note[ \n\t]*\\([^:]*\\):" nil t) 1156 (while (re-search-forward "\\*note[ \n\t]*\\([^:]*\\):" nil t)
1161 (setq str (buffer-substring 1157 (setq str (buffer-substring-no-properties
1162 (match-beginning 1) 1158 (match-beginning 1)
1163 (1- (point)))) 1159 (1- (point))))
1164 ;; See if this one should be the default. 1160 ;; See if this one should be the default.
@@ -1266,12 +1262,10 @@ NAME may be an abbreviation of the reference name."
1266 (goto-char (point-min)) 1262 (goto-char (point-min))
1267 (search-forward "\n* Menu:") 1263 (search-forward "\n* Menu:")
1268 (while (re-search-forward pattern nil t) 1264 (while (re-search-forward pattern nil t)
1269 (setq completions (cons (cons (format "%s" 1265 (setq completions
1270 (buffer-substring 1266 (cons (cons (match-string-no-properties 1)
1271 (match-beginning 1) 1267 (match-beginning 1))
1272 (match-end 1))) 1268 completions))))
1273 (match-beginning 1))
1274 completions))))
1275 (try-completion string completions predicate))) 1269 (try-completion string completions predicate)))
1276 ((eq action t) 1270 ((eq action t)
1277 (let (completions 1271 (let (completions
@@ -1283,11 +1277,9 @@ NAME may be an abbreviation of the reference name."
1283 (goto-char (point-min)) 1277 (goto-char (point-min))
1284 (search-forward "\n* Menu:") 1278 (search-forward "\n* Menu:")
1285 (while (re-search-forward pattern nil t) 1279 (while (re-search-forward pattern nil t)
1286 (setq completions (cons (cons (format "%s" 1280 (setq completions (cons (cons
1287 (buffer-substring 1281 (match-string-no-properties 1)
1288 (match-beginning 1) 1282 (match-beginning 1))
1289 (match-end 1)))
1290 (match-beginning 1))
1291 completions)))) 1283 completions))))
1292 (all-completions string completions predicate))) 1284 (all-completions string completions predicate)))
1293 (t 1285 (t
@@ -1321,9 +1313,7 @@ Completion is allowed, and the menu item point is on is the default."
1321 (goto-char p) 1313 (goto-char p)
1322 (end-of-line) 1314 (end-of-line)
1323 (if (re-search-backward "\n\\* +\\([^:\t\n]*\\):" beg t) 1315 (if (re-search-backward "\n\\* +\\([^:\t\n]*\\):" beg t)
1324 (setq default (format "%s" (buffer-substring 1316 (setq default (match-string-no-properties 1))))))
1325 (match-beginning 1)
1326 (match-end 1))))))))
1327 (let ((item nil)) 1317 (let ((item nil))
1328 (while (null item) 1318 (while (null item)
1329 (setq item (let ((completion-ignore-case t) 1319 (setq item (let ((completion-ignore-case t)
@@ -1660,15 +1650,11 @@ Give a blank topic name to go to the Index node itself."
1660 (goto-char (point-min)) 1650 (goto-char (point-min))
1661 (while (re-search-forward pattern nil t) 1651 (while (re-search-forward pattern nil t)
1662 (setq matches 1652 (setq matches
1663 (cons (list (buffer-substring (match-beginning 1) 1653 (cons (list (match-string-no-properties 1)
1664 (match-end 1)) 1654 (match-string-no-properties 2)
1665 (buffer-substring (match-beginning 2)
1666 (match-end 2))
1667 Info-current-node 1655 Info-current-node
1668 (string-to-int (concat "0" 1656 (string-to-int (concat "0"
1669 (buffer-substring 1657 (match-string 3))))
1670 (match-beginning 3)
1671 (match-end 3)))))
1672 matches))) 1658 matches)))
1673 (and (setq node (Info-extract-pointer "next" t)) 1659 (and (setq node (Info-extract-pointer "next" t))
1674 (string-match "\\<Index\\>" node))) 1660 (string-match "\\<Index\\>" node)))
@@ -1790,7 +1776,7 @@ SIG optional fourth argument, controls action on no match
1790 (> (match-end 0) pos)))))) 1776 (> (match-end 0) pos))))))
1791 (if (and found (<= (match-beginning 0) pos) 1777 (if (and found (<= (match-beginning 0) pos)
1792 (> (match-end 0) pos)) 1778 (> (match-end 0) pos))
1793 (buffer-substring (match-beginning 1) (match-end 1)) 1779 (match-string-no-properties 1)
1794 (cond ((null errorstring) 1780 (cond ((null errorstring)
1795 nil) 1781 nil)
1796 ((eq errorstring t) 1782 ((eq errorstring t)
@@ -2176,9 +2162,7 @@ The locations are of the format used in Info-history, i.e.
2176 (goto-char (point-max)) 2162 (goto-char (point-max))
2177 (while (re-search-backward cmd-desc nil t) 2163 (while (re-search-backward cmd-desc nil t)
2178 (setq where (cons (list Info-current-file 2164 (setq where (cons (list Info-current-file
2179 (buffer-substring 2165 (match-string-no-properties 1)
2180 (match-beginning 1)
2181 (match-end 1))
2182 0) 2166 0)
2183 where))) 2167 where)))
2184 where))) 2168 where)))