diff options
| author | Stefan Monnier | 2012-08-04 18:31:04 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-08-04 18:31:04 -0400 |
| commit | 7c2dc8bd36acd9bee84354d052593b430d4ad527 (patch) | |
| tree | b239039d27d38d5941c62bdd6fd3439e5f359751 | |
| parent | ce555168d9911f5a59489bf0ba2fc4367da68588 (diff) | |
| download | emacs-7c2dc8bd36acd9bee84354d052593b430d4ad527.tar.gz emacs-7c2dc8bd36acd9bee84354d052593b430d4ad527.zip | |
* lisp/isearch.el: Misc simplification; use defstruct.
(isearch-mode-map): Dense maps now work like sparse ones.
(isearch--state): New defstruct.
(isearch-string-state, isearch-message-state, isearch-point-state)
(isearch-success-state, isearch-forward-state)
(isearch-other-end-state, isearch-word-state, isearch-error-state)
(isearch-wrapped-state, isearch-barrier-state)
(isearch-case-fold-search-state, isearch-pop-fun-state): Remove,
replaced by defstruct's accessors.
(isearch--set-state): Rename from isearch-top-state and change
calling convention.
(isearch-push-state): Use new isearch--get-state.
(isearch-toggle-word): Disable regexp when enabling word.
(isearch-message-prefix): Remove unused arg _c-q-hack.
(isearch-message-suffix): Remove unused arg _ellipsis.
| -rw-r--r-- | lisp/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/isearch.el | 185 |
2 files changed, 102 insertions, 101 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ff28199d756..fb1f0868d5b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2012-08-04 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * isearch.el: Misc simplification; use defstruct. | ||
| 4 | (isearch-mode-map): Dense maps now work like sparse ones. | ||
| 5 | (isearch--state): New defstruct. | ||
| 6 | (isearch-string-state, isearch-message-state, isearch-point-state) | ||
| 7 | (isearch-success-state, isearch-forward-state) | ||
| 8 | (isearch-other-end-state, isearch-word-state, isearch-error-state) | ||
| 9 | (isearch-wrapped-state, isearch-barrier-state) | ||
| 10 | (isearch-case-fold-search-state, isearch-pop-fun-state): Remove, | ||
| 11 | replaced by defstruct's accessors. | ||
| 12 | (isearch--set-state): Rename from isearch-top-state and change | ||
| 13 | calling convention. | ||
| 14 | (isearch-push-state): Use new isearch--get-state. | ||
| 15 | (isearch-toggle-word): Disable regexp when enabling word. | ||
| 16 | (isearch-message-prefix): Remove unused arg _c-q-hack. | ||
| 17 | (isearch-message-suffix): Remove unused arg _ellipsis. | ||
| 18 | |||
| 1 | 2012-08-04 Andreas Schwab <schwab@linux-m68k.org> | 19 | 2012-08-04 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 20 | ||
| 3 | * simple.el (list-processes--refresh): For a server use :host or | 21 | * simple.el (list-processes--refresh): For a server use :host or |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 27185bf3fa6..9271ce32484 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | 57 | ||
| 58 | ;;; Code: | 58 | ;;; Code: |
| 59 | 59 | ||
| 60 | (eval-when-compile (require 'cl-lib)) | ||
| 60 | 61 | ||
| 61 | ;; Some additional options and constants. | 62 | ;; Some additional options and constants. |
| 62 | 63 | ||
| @@ -413,13 +414,6 @@ This is like `describe-bindings', but displays only Isearch keys." | |||
| 413 | ;; Make function keys, etc, which aren't bound to a scrolling-function | 414 | ;; Make function keys, etc, which aren't bound to a scrolling-function |
| 414 | ;; exit the search. | 415 | ;; exit the search. |
| 415 | (define-key map [t] 'isearch-other-control-char) | 416 | (define-key map [t] 'isearch-other-control-char) |
| 416 | ;; Control chars, by default, end isearch mode transparently. | ||
| 417 | ;; We need these explicit definitions because, in a dense keymap, | ||
| 418 | ;; the binding for t does not affect characters. | ||
| 419 | ;; We use a dense keymap to save space. | ||
| 420 | (while (< i ?\s) | ||
| 421 | (define-key map (make-string 1 i) 'isearch-other-control-char) | ||
| 422 | (setq i (1+ i))) | ||
| 423 | 417 | ||
| 424 | ;; Single-byte printing chars extend the search string by default. | 418 | ;; Single-byte printing chars extend the search string by default. |
| 425 | (setq i ?\s) | 419 | (setq i ?\s) |
| @@ -434,8 +428,8 @@ This is like `describe-bindings', but displays only Isearch keys." | |||
| 434 | ;; default local key binding for any key not otherwise bound. | 428 | ;; default local key binding for any key not otherwise bound. |
| 435 | (let ((meta-map (make-sparse-keymap))) | 429 | (let ((meta-map (make-sparse-keymap))) |
| 436 | (define-key map (char-to-string meta-prefix-char) meta-map) | 430 | (define-key map (char-to-string meta-prefix-char) meta-map) |
| 437 | (define-key map [escape] meta-map)) | 431 | (define-key map [escape] meta-map) |
| 438 | (define-key map (vector meta-prefix-char t) 'isearch-other-meta-char) | 432 | (define-key meta-map [t] 'isearch-other-meta-char)) |
| 439 | 433 | ||
| 440 | ;; Several non-printing chars change the searching behavior. | 434 | ;; Several non-printing chars change the searching behavior. |
| 441 | (define-key map "\C-s" 'isearch-repeat-forward) | 435 | (define-key map "\C-s" 'isearch-repeat-forward) |
| @@ -965,9 +959,10 @@ NOPUSH is t and EDIT is t." | |||
| 965 | (before (if (bobp) nil | 959 | (before (if (bobp) nil |
| 966 | (get-text-property (1- (point)) 'intangible)))) | 960 | (get-text-property (1- (point)) 'intangible)))) |
| 967 | (when (and before after (eq before after)) | 961 | (when (and before after (eq before after)) |
| 968 | (if isearch-forward | 962 | (goto-char |
| 969 | (goto-char (next-single-property-change (point) 'intangible)) | 963 | (if isearch-forward |
| 970 | (goto-char (previous-single-property-change (point) 'intangible))))) | 964 | (next-single-property-change (point) 'intangible) |
| 965 | (previous-single-property-change (point) 'intangible))))) | ||
| 971 | 966 | ||
| 972 | (if (and (> (length isearch-string) 0) (not nopush)) | 967 | (if (and (> (length isearch-string) 0) (not nopush)) |
| 973 | ;; Update the ring data. | 968 | ;; Update the ring data. |
| @@ -1007,73 +1002,58 @@ REGEXP if non-nil says use the regexp search ring." | |||
| 1007 | 1002 | ||
| 1008 | ;; The search status structure and stack. | 1003 | ;; The search status structure and stack. |
| 1009 | 1004 | ||
| 1010 | (defsubst isearch-string-state (frame) | 1005 | (cl-defstruct (isearch--state |
| 1011 | "Return the search string in FRAME." | 1006 | (:constructor nil) |
| 1012 | (aref frame 0)) | 1007 | (:copier nil) |
| 1013 | (defsubst isearch-message-state (frame) | 1008 | (:constructor isearch--get-state |
| 1014 | "Return the search string to display to the user in FRAME." | 1009 | (&aux |
| 1015 | (aref frame 1)) | 1010 | (string isearch-string) |
| 1016 | (defsubst isearch-point-state (frame) | 1011 | (message isearch-message) |
| 1017 | "Return the point in FRAME." | 1012 | (point (point)) |
| 1018 | (aref frame 2)) | 1013 | (success isearch-success) |
| 1019 | (defsubst isearch-success-state (frame) | 1014 | (forward isearch-forward) |
| 1020 | "Return the success flag in FRAME." | 1015 | (other-end isearch-other-end) |
| 1021 | (aref frame 3)) | 1016 | (word isearch-word) |
| 1022 | (defsubst isearch-forward-state (frame) | 1017 | (error isearch-error) |
| 1023 | "Return the searching-forward flag in FRAME." | 1018 | (wrapped isearch-wrapped) |
| 1024 | (aref frame 4)) | 1019 | (barrier isearch-barrier) |
| 1025 | (defsubst isearch-other-end-state (frame) | 1020 | (case-fold-search isearch-case-fold-search) |
| 1026 | "Return the other end of the match in FRAME." | 1021 | (pop-fun (if isearch-push-state-function |
| 1027 | (aref frame 5)) | 1022 | (funcall isearch-push-state-function)))))) |
| 1028 | (defsubst isearch-word-state (frame) | 1023 | (string :read-only t) |
| 1029 | "Return the search-by-word flag in FRAME." | 1024 | (message :read-only t) |
| 1030 | (aref frame 6)) | 1025 | (point :read-only t) |
| 1031 | (defsubst isearch-error-state (frame) | 1026 | (success :read-only t) |
| 1032 | "Return the regexp error message in FRAME, or nil if its regexp is valid." | 1027 | (forward :read-only t) |
| 1033 | (aref frame 7)) | 1028 | (other-end :read-only t) |
| 1034 | (defsubst isearch-wrapped-state (frame) | 1029 | (word :read-only t) |
| 1035 | "Return the search-wrapped flag in FRAME." | 1030 | (error :read-only t) |
| 1036 | (aref frame 8)) | 1031 | (wrapped :read-only t) |
| 1037 | (defsubst isearch-barrier-state (frame) | 1032 | (barrier :read-only t) |
| 1038 | "Return the barrier value in FRAME." | 1033 | (case-fold-search :read-only t) |
| 1039 | (aref frame 9)) | 1034 | (pop-fun :read-only t)) |
| 1040 | (defsubst isearch-case-fold-search-state (frame) | 1035 | |
| 1041 | "Return the case-folding flag in FRAME." | 1036 | (defun isearch--set-state (cmd) |
| 1042 | (aref frame 10)) | 1037 | (setq isearch-string (isearch--state-string cmd) |
| 1043 | (defsubst isearch-pop-fun-state (frame) | 1038 | isearch-message (isearch--state-message cmd) |
| 1044 | "Return the function restoring the mode-specific Isearch state in FRAME." | 1039 | isearch-success (isearch--state-success cmd) |
| 1045 | (aref frame 11)) | 1040 | isearch-forward (isearch--state-forward cmd) |
| 1046 | 1041 | isearch-other-end (isearch--state-other-end cmd) | |
| 1047 | (defun isearch-top-state () | 1042 | isearch-word (isearch--state-word cmd) |
| 1048 | (let ((cmd (car isearch-cmds))) | 1043 | isearch-error (isearch--state-error cmd) |
| 1049 | (setq isearch-string (isearch-string-state cmd) | 1044 | isearch-wrapped (isearch--state-wrapped cmd) |
| 1050 | isearch-message (isearch-message-state cmd) | 1045 | isearch-barrier (isearch--state-barrier cmd) |
| 1051 | isearch-success (isearch-success-state cmd) | 1046 | isearch-case-fold-search (isearch--state-case-fold-search cmd)) |
| 1052 | isearch-forward (isearch-forward-state cmd) | 1047 | (if (functionp (isearch--state-pop-fun cmd)) |
| 1053 | isearch-other-end (isearch-other-end-state cmd) | 1048 | (funcall (isearch--state-pop-fun cmd) cmd)) |
| 1054 | isearch-word (isearch-word-state cmd) | 1049 | (goto-char (isearch--state-point cmd))) |
| 1055 | isearch-error (isearch-error-state cmd) | ||
| 1056 | isearch-wrapped (isearch-wrapped-state cmd) | ||
| 1057 | isearch-barrier (isearch-barrier-state cmd) | ||
| 1058 | isearch-case-fold-search (isearch-case-fold-search-state cmd)) | ||
| 1059 | (if (functionp (isearch-pop-fun-state cmd)) | ||
| 1060 | (funcall (isearch-pop-fun-state cmd) cmd)) | ||
| 1061 | (goto-char (isearch-point-state cmd)))) | ||
| 1062 | 1050 | ||
| 1063 | (defun isearch-pop-state () | 1051 | (defun isearch-pop-state () |
| 1064 | (setq isearch-cmds (cdr isearch-cmds)) | 1052 | (setq isearch-cmds (cdr isearch-cmds)) |
| 1065 | (isearch-top-state)) | 1053 | (isearch--set-state (car isearch-cmds))) |
| 1066 | 1054 | ||
| 1067 | (defun isearch-push-state () | 1055 | (defun isearch-push-state () |
| 1068 | (setq isearch-cmds | 1056 | (push (isearch--get-state) isearch-cmds)) |
| 1069 | (cons (vector isearch-string isearch-message (point) | ||
| 1070 | isearch-success isearch-forward isearch-other-end | ||
| 1071 | isearch-word | ||
| 1072 | isearch-error isearch-wrapped isearch-barrier | ||
| 1073 | isearch-case-fold-search | ||
| 1074 | (if isearch-push-state-function | ||
| 1075 | (funcall isearch-push-state-function))) | ||
| 1076 | isearch-cmds))) | ||
| 1077 | 1057 | ||
| 1078 | 1058 | ||
| 1079 | ;; Commands active while inside of the isearch minor mode. | 1059 | ;; Commands active while inside of the isearch minor mode. |
| @@ -1100,11 +1080,11 @@ If MSG is non-nil, use `isearch-message', otherwise `isearch-string'." | |||
| 1100 | (curr-msg (if msg isearch-message isearch-string)) | 1080 | (curr-msg (if msg isearch-message isearch-string)) |
| 1101 | succ-msg) | 1081 | succ-msg) |
| 1102 | (when (or (not isearch-success) isearch-error) | 1082 | (when (or (not isearch-success) isearch-error) |
| 1103 | (while (or (not (isearch-success-state (car cmds))) | 1083 | (while (or (not (isearch--state-success (car cmds))) |
| 1104 | (isearch-error-state (car cmds))) | 1084 | (isearch--state-error (car cmds))) |
| 1105 | (pop cmds)) | 1085 | (pop cmds)) |
| 1106 | (setq succ-msg (and cmds (if msg (isearch-message-state (car cmds)) | 1086 | (setq succ-msg (and cmds (if msg (isearch--state-message (car cmds)) |
| 1107 | (isearch-string-state (car cmds))))) | 1087 | (isearch--state-string (car cmds))))) |
| 1108 | (if (and (stringp succ-msg) | 1088 | (if (and (stringp succ-msg) |
| 1109 | (< (length succ-msg) (length curr-msg)) | 1089 | (< (length succ-msg) (length curr-msg)) |
| 1110 | (equal succ-msg | 1090 | (equal succ-msg |
| @@ -1201,7 +1181,7 @@ The following additional command keys are active while editing. | |||
| 1201 | (minibuffer-history-symbol)) | 1181 | (minibuffer-history-symbol)) |
| 1202 | (setq isearch-new-string | 1182 | (setq isearch-new-string |
| 1203 | (read-from-minibuffer | 1183 | (read-from-minibuffer |
| 1204 | (isearch-message-prefix nil nil isearch-nonincremental) | 1184 | (isearch-message-prefix nil isearch-nonincremental) |
| 1205 | (cons isearch-string (1+ (or (isearch-fail-pos) | 1185 | (cons isearch-string (1+ (or (isearch-fail-pos) |
| 1206 | (length isearch-string)))) | 1186 | (length isearch-string)))) |
| 1207 | minibuffer-local-isearch-map nil | 1187 | minibuffer-local-isearch-map nil |
| @@ -1294,18 +1274,18 @@ The following additional command keys are active while editing. | |||
| 1294 | ;; For defined push-state function, restore the first state. | 1274 | ;; For defined push-state function, restore the first state. |
| 1295 | ;; This calls pop-state function and restores original point. | 1275 | ;; This calls pop-state function and restores original point. |
| 1296 | (let ((isearch-cmds (last isearch-cmds))) | 1276 | (let ((isearch-cmds (last isearch-cmds))) |
| 1297 | (isearch-top-state)) | 1277 | (isearch--set-state (car isearch-cmds))) |
| 1298 | (goto-char isearch-opoint)) | 1278 | (goto-char isearch-opoint)) |
| 1299 | (isearch-done t) ; exit isearch | 1279 | (isearch-done t) ; Exit isearch.. |
| 1300 | (isearch-clean-overlays) | 1280 | (isearch-clean-overlays) |
| 1301 | (signal 'quit nil)) ; and pass on quit signal | 1281 | (signal 'quit nil)) ; ..and pass on quit signal. |
| 1302 | 1282 | ||
| 1303 | (defun isearch-abort () | 1283 | (defun isearch-abort () |
| 1304 | "Abort incremental search mode if searching is successful, signaling quit. | 1284 | "Abort incremental search mode if searching is successful, signaling quit. |
| 1305 | Otherwise, revert to previous successful search and continue searching. | 1285 | Otherwise, revert to previous successful search and continue searching. |
| 1306 | Use `isearch-exit' to quit without signaling." | 1286 | Use `isearch-exit' to quit without signaling." |
| 1307 | (interactive) | 1287 | (interactive) |
| 1308 | ;; (ding) signal instead below, if quitting | 1288 | ;; (ding) signal instead below, if quitting |
| 1309 | (discard-input) | 1289 | (discard-input) |
| 1310 | (if (and isearch-success (not isearch-error)) | 1290 | (if (and isearch-success (not isearch-error)) |
| 1311 | ;; If search is successful and has no incomplete regexp, | 1291 | ;; If search is successful and has no incomplete regexp, |
| @@ -1328,9 +1308,7 @@ Use `isearch-exit' to quit without signaling." | |||
| 1328 | (if (null (if isearch-regexp regexp-search-ring search-ring)) | 1308 | (if (null (if isearch-regexp regexp-search-ring search-ring)) |
| 1329 | (setq isearch-error "No previous search string") | 1309 | (setq isearch-error "No previous search string") |
| 1330 | (setq isearch-string | 1310 | (setq isearch-string |
| 1331 | (if isearch-regexp | 1311 | (car (if isearch-regexp regexp-search-ring search-ring)) |
| 1332 | (car regexp-search-ring) | ||
| 1333 | (car search-ring)) | ||
| 1334 | isearch-message | 1312 | isearch-message |
| 1335 | (mapconcat 'isearch-text-char-description | 1313 | (mapconcat 'isearch-text-char-description |
| 1336 | isearch-string "") | 1314 | isearch-string "") |
| @@ -1391,8 +1369,10 @@ Use `isearch-exit' to quit without signaling." | |||
| 1391 | 1369 | ||
| 1392 | (defun isearch-toggle-word () | 1370 | (defun isearch-toggle-word () |
| 1393 | "Toggle word searching on or off." | 1371 | "Toggle word searching on or off." |
| 1372 | ;; The status stack is left unchanged. | ||
| 1394 | (interactive) | 1373 | (interactive) |
| 1395 | (setq isearch-word (not isearch-word)) | 1374 | (setq isearch-word (not isearch-word)) |
| 1375 | (if isearch-word (setq isearch-regexp nil)) | ||
| 1396 | (setq isearch-success t isearch-adjusted t) | 1376 | (setq isearch-success t isearch-adjusted t) |
| 1397 | (isearch-update)) | 1377 | (isearch-update)) |
| 1398 | 1378 | ||
| @@ -1411,7 +1391,7 @@ Use `isearch-exit' to quit without signaling." | |||
| 1411 | (if isearch-case-fold-search nil 'yes)) | 1391 | (if isearch-case-fold-search nil 'yes)) |
| 1412 | (let ((message-log-max nil)) | 1392 | (let ((message-log-max nil)) |
| 1413 | (message "%s%s [case %ssensitive]" | 1393 | (message "%s%s [case %ssensitive]" |
| 1414 | (isearch-message-prefix nil nil isearch-nonincremental) | 1394 | (isearch-message-prefix nil isearch-nonincremental) |
| 1415 | isearch-message | 1395 | isearch-message |
| 1416 | (if isearch-case-fold-search "in" ""))) | 1396 | (if isearch-case-fold-search "in" ""))) |
| 1417 | (setq isearch-success t isearch-adjusted t) | 1397 | (setq isearch-success t isearch-adjusted t) |
| @@ -1857,7 +1837,7 @@ to the barrier." | |||
| 1857 | ;; We have to check 2 stack frames because the last might be | 1837 | ;; We have to check 2 stack frames because the last might be |
| 1858 | ;; invalid just because of a backslash. | 1838 | ;; invalid just because of a backslash. |
| 1859 | (or (not isearch-error) | 1839 | (or (not isearch-error) |
| 1860 | (not (isearch-error-state (cadr isearch-cmds))) | 1840 | (not (isearch--state-error (cadr isearch-cmds))) |
| 1861 | allow-invalid)) | 1841 | allow-invalid)) |
| 1862 | (if to-barrier | 1842 | (if to-barrier |
| 1863 | (progn (goto-char isearch-barrier) | 1843 | (progn (goto-char isearch-barrier) |
| @@ -1872,8 +1852,8 @@ to the barrier." | |||
| 1872 | ;; Also skip over postfix operators -- though horrid, | 1852 | ;; Also skip over postfix operators -- though horrid, |
| 1873 | ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly valid. | 1853 | ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly valid. |
| 1874 | (while (and previous | 1854 | (while (and previous |
| 1875 | (or (isearch-error-state frame) | 1855 | (or (isearch--state-error frame) |
| 1876 | (let* ((string (isearch-string-state frame)) | 1856 | (let* ((string (isearch--state-string frame)) |
| 1877 | (lchar (aref string (1- (length string))))) | 1857 | (lchar (aref string (1- (length string))))) |
| 1878 | ;; The operators aren't always operators; check | 1858 | ;; The operators aren't always operators; check |
| 1879 | ;; backslashes. This doesn't handle the case of | 1859 | ;; backslashes. This doesn't handle the case of |
| @@ -1881,7 +1861,7 @@ to the barrier." | |||
| 1881 | ;; being special, but then we should fall back to | 1861 | ;; being special, but then we should fall back to |
| 1882 | ;; the barrier anyway because it's all optional. | 1862 | ;; the barrier anyway because it's all optional. |
| 1883 | (if (isearch-backslash | 1863 | (if (isearch-backslash |
| 1884 | (isearch-string-state (car previous))) | 1864 | (isearch--state-string (car previous))) |
| 1885 | (eq lchar ?\}) | 1865 | (eq lchar ?\}) |
| 1886 | (memq lchar '(?* ?? ?+)))))) | 1866 | (memq lchar '(?* ?? ?+)))))) |
| 1887 | (setq stack previous previous (cdr previous) frame (car stack))) | 1867 | (setq stack previous previous (cdr previous) frame (car stack))) |
| @@ -1891,7 +1871,7 @@ to the barrier." | |||
| 1891 | ;; what matched before that. | 1871 | ;; what matched before that. |
| 1892 | (let ((last-other-end | 1872 | (let ((last-other-end |
| 1893 | (or (and (car previous) | 1873 | (or (and (car previous) |
| 1894 | (isearch-other-end-state (car previous))) | 1874 | (isearch--state-other-end (car previous))) |
| 1895 | isearch-barrier))) | 1875 | isearch-barrier))) |
| 1896 | (goto-char (if isearch-forward | 1876 | (goto-char (if isearch-forward |
| 1897 | (max last-other-end isearch-barrier) | 1877 | (max last-other-end isearch-barrier) |
| @@ -2355,12 +2335,12 @@ If there is no completion possible, say so and continue searching." | |||
| 2355 | (add-text-properties (match-beginning 0) (match-end 0) | 2335 | (add-text-properties (match-beginning 0) (match-end 0) |
| 2356 | '(face trailing-whitespace) m))) | 2336 | '(face trailing-whitespace) m))) |
| 2357 | (setq m (concat | 2337 | (setq m (concat |
| 2358 | (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental) | 2338 | (isearch-message-prefix ellipsis isearch-nonincremental) |
| 2359 | m | 2339 | m |
| 2360 | (isearch-message-suffix c-q-hack ellipsis))) | 2340 | (isearch-message-suffix c-q-hack))) |
| 2361 | (if c-q-hack m (let ((message-log-max nil)) (message "%s" m))))) | 2341 | (if c-q-hack m (let ((message-log-max nil)) (message "%s" m))))) |
| 2362 | 2342 | ||
| 2363 | (defun isearch-message-prefix (&optional _c-q-hack ellipsis nonincremental) | 2343 | (defun isearch-message-prefix (&optional ellipsis nonincremental) |
| 2364 | ;; If about to search, and previous search regexp was invalid, | 2344 | ;; If about to search, and previous search regexp was invalid, |
| 2365 | ;; check that it still is. If it is valid now, | 2345 | ;; check that it still is. If it is valid now, |
| 2366 | ;; let the message we display while searching say that it is valid. | 2346 | ;; let the message we display while searching say that it is valid. |
| @@ -2401,7 +2381,7 @@ If there is no completion possible, say so and continue searching." | |||
| 2401 | (propertize (concat (upcase (substring m 0 1)) (substring m 1)) | 2381 | (propertize (concat (upcase (substring m 0 1)) (substring m 1)) |
| 2402 | 'face 'minibuffer-prompt))) | 2382 | 'face 'minibuffer-prompt))) |
| 2403 | 2383 | ||
| 2404 | (defun isearch-message-suffix (&optional c-q-hack _ellipsis) | 2384 | (defun isearch-message-suffix (&optional c-q-hack) |
| 2405 | (concat (if c-q-hack "^Q" "") | 2385 | (concat (if c-q-hack "^Q" "") |
| 2406 | (if isearch-error | 2386 | (if isearch-error |
| 2407 | (concat " [" isearch-error "]") | 2387 | (concat " [" isearch-error "]") |
| @@ -2435,7 +2415,8 @@ Can be changed via `isearch-search-fun-function' for special needs." | |||
| 2435 | ;; (or when using nonincremental word isearch) | 2415 | ;; (or when using nonincremental word isearch) |
| 2436 | (let ((lax (not (or isearch-nonincremental | 2416 | (let ((lax (not (or isearch-nonincremental |
| 2437 | (eq (length isearch-string) | 2417 | (eq (length isearch-string) |
| 2438 | (length (isearch-string-state (car isearch-cmds)))))))) | 2418 | (length (isearch--state-string |
| 2419 | (car isearch-cmds)))))))) | ||
| 2439 | (funcall | 2420 | (funcall |
| 2440 | (if isearch-forward #'re-search-forward #'re-search-backward) | 2421 | (if isearch-forward #'re-search-forward #'re-search-backward) |
| 2441 | (if (functionp isearch-word) | 2422 | (if (functionp isearch-word) |
| @@ -2501,6 +2482,7 @@ update the match data, and return point." | |||
| 2501 | (isearch-no-upper-case-p isearch-string isearch-regexp))) | 2482 | (isearch-no-upper-case-p isearch-string isearch-regexp))) |
| 2502 | (condition-case lossage | 2483 | (condition-case lossage |
| 2503 | (let ((inhibit-point-motion-hooks | 2484 | (let ((inhibit-point-motion-hooks |
| 2485 | ;; FIXME: equality comparisons on functions is asking for trouble. | ||
| 2504 | (and (eq isearch-filter-predicate 'isearch-filter-visible) | 2486 | (and (eq isearch-filter-predicate 'isearch-filter-visible) |
| 2505 | search-invisible)) | 2487 | search-invisible)) |
| 2506 | (inhibit-quit nil) | 2488 | (inhibit-quit nil) |
| @@ -2545,11 +2527,12 @@ update the match data, and return point." | |||
| 2545 | (if isearch-success | 2527 | (if isearch-success |
| 2546 | nil | 2528 | nil |
| 2547 | ;; Ding if failed this time after succeeding last time. | 2529 | ;; Ding if failed this time after succeeding last time. |
| 2548 | (and (isearch-success-state (car isearch-cmds)) | 2530 | (and (isearch--state-success (car isearch-cmds)) |
| 2549 | (ding)) | 2531 | (ding)) |
| 2550 | (if (functionp (isearch-pop-fun-state (car isearch-cmds))) | 2532 | (if (functionp (isearch--state-pop-fun (car isearch-cmds))) |
| 2551 | (funcall (isearch-pop-fun-state (car isearch-cmds)) (car isearch-cmds))) | 2533 | (funcall (isearch--state-pop-fun (car isearch-cmds)) |
| 2552 | (goto-char (isearch-point-state (car isearch-cmds))))) | 2534 | (car isearch-cmds))) |
| 2535 | (goto-char (isearch--state-point (car isearch-cmds))))) | ||
| 2553 | 2536 | ||
| 2554 | 2537 | ||
| 2555 | ;; Called when opening an overlay, and we are still in isearch. | 2538 | ;; Called when opening an overlay, and we are still in isearch. |