diff options
| author | Stefan Monnier | 2013-08-05 14:05:46 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-08-05 14:05:46 -0400 |
| commit | dc6c0edad789a8aab129ae12b8f064d0e912cca7 (patch) | |
| tree | c1a48c60a90799f3a05b7db15ac66bd2111bd78e /lisp | |
| parent | 98a428c15ad48f8579b00b68aae6a89b34238b12 (diff) | |
| download | emacs-dc6c0edad789a8aab129ae12b8f064d0e912cca7.tar.gz emacs-dc6c0edad789a8aab129ae12b8f064d0e912cca7.zip | |
Revert introduction of isearch-filter-predicates.
Rely on add-function instead.
* lisp/loadup.el: Preload nadvice.
* lisp/isearch.el (isearch-filter-predicates): Rename it back to
isearch-filter-predicate.
(isearch-message-prefix): Use advice-function-mapc and advice
properties to get the isearch-message-prefix.
(isearch-search, isearch-lazy-highlight-search): Revert to funcall
instead of run-hook-with-args-until-failure.
(isearch-filter-visible): Not obsolete any more.
* lisp/replace.el (perform-replace): Revert to funcall
instead of run-hook-with-args-until-failure.
* lisp/wdired.el (wdired-change-to-wdired-mode): Use add-function.
* lisp/dired-aux.el (dired-isearch-filenames-mode): Rename from
dired-isearch-filenames-toggle; make it into a proper minor mode.
Use add/remove-function.
(dired-isearch-filenames-setup, dired-isearch-filenames-end):
Call the minor-mode rather than add/remove-hook.
(dired-isearch-filter-filenames):
Remove isearch-message-prefix property.
* lisp/info.el (Info--search-loop): New function, extracted from Info-search.
Funcall isearch-filter-predicate instead of
run-hook-with-args-until-failure isearch-filter-predicates.
(Info-search): Use it.
(Info-mode): Use isearch-filter-predicate instead of
isearch-filter-predicates.
* src/lisp.mk (lisp): Add nadvice.elc.
* lib-src/makefile.w32-in (lisp2): Add nadvice.elc.
Fixes: debbugs:14714
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 29 | ||||
| -rw-r--r-- | lisp/dired-aux.el | 28 | ||||
| -rw-r--r-- | lisp/dired.el | 17 | ||||
| -rw-r--r-- | lisp/info.el | 123 | ||||
| -rw-r--r-- | lisp/isearch.el | 57 | ||||
| -rw-r--r-- | lisp/loadup.el | 1 | ||||
| -rw-r--r-- | lisp/replace.el | 15 | ||||
| -rw-r--r-- | lisp/wdired.el | 3 |
8 files changed, 127 insertions, 146 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8bc39097187..ad7d82c30d7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2013-08-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | Revert introduction of isearch-filter-predicates (bug#14714). | ||
| 4 | Rely on add-function instead. | ||
| 5 | * isearch.el (isearch-filter-predicates): Rename it back to | ||
| 6 | isearch-filter-predicate. | ||
| 7 | (isearch-message-prefix): Use advice-function-mapc and advice | ||
| 8 | properties to get the isearch-message-prefix. | ||
| 9 | (isearch-search, isearch-lazy-highlight-search): Revert to funcall | ||
| 10 | instead of run-hook-with-args-until-failure. | ||
| 11 | (isearch-filter-visible): Not obsolete any more. | ||
| 12 | * loadup.el: Preload nadvice. | ||
| 13 | * replace.el (perform-replace): Revert to funcall | ||
| 14 | instead of run-hook-with-args-until-failure. | ||
| 15 | * wdired.el (wdired-change-to-wdired-mode): Use add-function. | ||
| 16 | * dired-aux.el (dired-isearch-filenames-mode): Rename from | ||
| 17 | dired-isearch-filenames-toggle; make it into a proper minor mode. | ||
| 18 | Use add/remove-function. | ||
| 19 | (dired-isearch-filenames-setup, dired-isearch-filenames-end): | ||
| 20 | Call the minor-mode rather than add/remove-hook. | ||
| 21 | (dired-isearch-filter-filenames): | ||
| 22 | Remove isearch-message-prefix property. | ||
| 23 | * info.el (Info--search-loop): New function, extracted from Info-search. | ||
| 24 | Funcall isearch-filter-predicate instead of | ||
| 25 | run-hook-with-args-until-failure isearch-filter-predicates. | ||
| 26 | (Info-search): Use it. | ||
| 27 | (Info-mode): Use isearch-filter-predicate instead of | ||
| 28 | isearch-filter-predicates. | ||
| 29 | |||
| 1 | 2013-08-05 Dmitry Antipov <dmantipov@yandex.ru> | 30 | 2013-08-05 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 31 | ||
| 3 | Do not call to `selected-window' where it is assumed by default. | 32 | Do not call to `selected-window' where it is assumed by default. |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 7cb63f6b012..c12ac068689 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -2491,18 +2491,21 @@ a file name. Otherwise, it searches the whole buffer without restrictions." | |||
| 2491 | :group 'dired | 2491 | :group 'dired |
| 2492 | :version "23.1") | 2492 | :version "23.1") |
| 2493 | 2493 | ||
| 2494 | (defun dired-isearch-filenames-toggle () | 2494 | (define-minor-mode dired-isearch-filenames-mode |
| 2495 | "Toggle file names searching on or off. | 2495 | "Toggle file names searching on or off. |
| 2496 | When on, Isearch skips matches outside file names using the predicate | 2496 | When on, Isearch skips matches outside file names using the predicate |
| 2497 | `dired-isearch-filter-filenames' that matches only at file names. | 2497 | `dired-isearch-filter-filenames' that matches only at file names. |
| 2498 | When off, it uses the original predicate." | 2498 | When off, it uses the original predicate." |
| 2499 | (interactive) | 2499 | nil nil nil |
| 2500 | (setq isearch-filter-predicates | 2500 | (if dired-isearch-filenames-mode |
| 2501 | (if (memq 'dired-isearch-filter-filenames isearch-filter-predicates) | 2501 | (add-function :before-while (local 'isearch-filter-predicate) |
| 2502 | (delq 'dired-isearch-filter-filenames isearch-filter-predicates) | 2502 | #'dired-isearch-filter-filenames |
| 2503 | (cons 'dired-isearch-filter-filenames isearch-filter-predicates))) | 2503 | '((isearch-message-prefix . "filename "))) |
| 2504 | (setq isearch-success t isearch-adjusted t) | 2504 | (remove-function (local 'isearch-filter-predicate) |
| 2505 | (isearch-update)) | 2505 | #'dired-isearch-filter-filenames)) |
| 2506 | (when isearch-mode | ||
| 2507 | (setq isearch-success t isearch-adjusted t) | ||
| 2508 | (isearch-update))) | ||
| 2506 | 2509 | ||
| 2507 | ;;;###autoload | 2510 | ;;;###autoload |
| 2508 | (defun dired-isearch-filenames-setup () | 2511 | (defun dired-isearch-filenames-setup () |
| @@ -2511,15 +2514,14 @@ Intended to be added to `isearch-mode-hook'." | |||
| 2511 | (when (or (eq dired-isearch-filenames t) | 2514 | (when (or (eq dired-isearch-filenames t) |
| 2512 | (and (eq dired-isearch-filenames 'dwim) | 2515 | (and (eq dired-isearch-filenames 'dwim) |
| 2513 | (get-text-property (point) 'dired-filename))) | 2516 | (get-text-property (point) 'dired-filename))) |
| 2514 | (define-key isearch-mode-map "\M-sff" 'dired-isearch-filenames-toggle) | 2517 | (define-key isearch-mode-map "\M-sff" 'dired-isearch-filenames-mode) |
| 2515 | (add-hook 'isearch-filter-predicates 'dired-isearch-filter-filenames nil t) | 2518 | (dired-isearch-filenames-mode 1) |
| 2516 | (add-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end nil t))) | 2519 | (add-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end nil t))) |
| 2517 | 2520 | ||
| 2518 | (defun dired-isearch-filenames-end () | 2521 | (defun dired-isearch-filenames-end () |
| 2519 | "Clean up the Dired file name search after terminating isearch." | 2522 | "Clean up the Dired file name search after terminating isearch." |
| 2520 | (setq isearch-message-prefix-add nil) | ||
| 2521 | (define-key isearch-mode-map "\M-sff" nil) | 2523 | (define-key isearch-mode-map "\M-sff" nil) |
| 2522 | (remove-hook 'isearch-filter-predicates 'dired-isearch-filter-filenames t) | 2524 | (dired-isearch-filenames-mode -1) |
| 2523 | (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t)) | 2525 | (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t)) |
| 2524 | 2526 | ||
| 2525 | (defun dired-isearch-filter-filenames (beg end) | 2527 | (defun dired-isearch-filter-filenames (beg end) |
| @@ -2531,8 +2533,6 @@ name (has the text property `dired-filename')." | |||
| 2531 | 'dired-filename nil) | 2533 | 'dired-filename nil) |
| 2532 | t)) | 2534 | t)) |
| 2533 | 2535 | ||
| 2534 | (put 'dired-isearch-filter-filenames 'isearch-message-prefix "filename ") | ||
| 2535 | |||
| 2536 | ;;;###autoload | 2536 | ;;;###autoload |
| 2537 | (defun dired-isearch-filenames () | 2537 | (defun dired-isearch-filenames () |
| 2538 | "Search for a string using Isearch only in file names in the Dired buffer." | 2538 | "Search for a string using Isearch only in file names in the Dired buffer." |
diff --git a/lisp/dired.el b/lisp/dired.el index c871761bb3c..c44cf574889 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -3849,22 +3849,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." | |||
| 3849 | 3849 | ||
| 3850 | ;;; Start of automatically extracted autoloads. | 3850 | ;;; Start of automatically extracted autoloads. |
| 3851 | 3851 | ||
| 3852 | ;;;### (autoloads (dired-show-file-type dired-do-query-replace-regexp | 3852 | ;;;### (autoloads nil "dired-aux" "dired-aux.el" "555c067fcab27f5a377536db407803ab") |
| 3853 | ;;;;;; dired-do-search dired-do-isearch-regexp dired-do-isearch | ||
| 3854 | ;;;;;; dired-isearch-filenames-regexp dired-isearch-filenames dired-isearch-filenames-setup | ||
| 3855 | ;;;;;; dired-hide-all dired-hide-subdir dired-tree-down dired-tree-up | ||
| 3856 | ;;;;;; dired-kill-subdir dired-mark-subdir-files dired-goto-subdir | ||
| 3857 | ;;;;;; dired-prev-subdir dired-insert-subdir dired-maybe-insert-subdir | ||
| 3858 | ;;;;;; dired-downcase dired-upcase dired-do-symlink-regexp dired-do-hardlink-regexp | ||
| 3859 | ;;;;;; dired-do-copy-regexp dired-do-rename-regexp dired-do-rename | ||
| 3860 | ;;;;;; dired-do-hardlink dired-do-symlink dired-do-copy dired-create-directory | ||
| 3861 | ;;;;;; dired-rename-file dired-copy-file dired-relist-file dired-remove-file | ||
| 3862 | ;;;;;; dired-add-file dired-do-redisplay dired-do-load dired-do-byte-compile | ||
| 3863 | ;;;;;; dired-do-compress dired-query dired-compress-file dired-do-kill-lines | ||
| 3864 | ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command | ||
| 3865 | ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown | ||
| 3866 | ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff | ||
| 3867 | ;;;;;; dired-diff) "dired-aux" "dired-aux.el" "8f5af3aa4eee1b3448525896fa6f39a3") | ||
| 3868 | ;;; Generated autoloads from dired-aux.el | 3853 | ;;; Generated autoloads from dired-aux.el |
| 3869 | 3854 | ||
| 3870 | (autoload 'dired-diff "dired-aux" "\ | 3855 | (autoload 'dired-diff "dired-aux" "\ |
diff --git a/lisp/info.el b/lisp/info.el index 0e0a11753ba..182ad8563aa 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1905,6 +1905,30 @@ the Top node in FILENAME." | |||
| 1905 | (defvar Info-search-case-fold nil | 1905 | (defvar Info-search-case-fold nil |
| 1906 | "The value of `case-fold-search' from previous `Info-search' command.") | 1906 | "The value of `case-fold-search' from previous `Info-search' command.") |
| 1907 | 1907 | ||
| 1908 | (defun Info--search-loop (regexp bound backward) | ||
| 1909 | (when backward | ||
| 1910 | ;; Hide Info file header for backward search. | ||
| 1911 | (narrow-to-region (save-excursion | ||
| 1912 | (goto-char (point-min)) | ||
| 1913 | (search-forward "\n\^_") | ||
| 1914 | (1- (point))) | ||
| 1915 | (point-max))) | ||
| 1916 | (let ((give-up nil) | ||
| 1917 | (found nil) | ||
| 1918 | (beg-found nil)) | ||
| 1919 | (while (not (or give-up | ||
| 1920 | (and found | ||
| 1921 | (funcall isearch-filter-predicate | ||
| 1922 | beg-found found)))) | ||
| 1923 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) | ||
| 1924 | (if (funcall | ||
| 1925 | (if backward #'re-search-backward #'re-search-forward) | ||
| 1926 | regexp bound t) | ||
| 1927 | (setq found (point) beg-found (if backward (match-end 0) | ||
| 1928 | (match-beginning 0))) | ||
| 1929 | (setq give-up t found nil)))) | ||
| 1930 | found)) | ||
| 1931 | |||
| 1908 | (defun Info-search (regexp &optional bound _noerror _count direction) | 1932 | (defun Info-search (regexp &optional bound _noerror _count direction) |
| 1909 | "Search for REGEXP, starting from point, and select node it's found in. | 1933 | "Search for REGEXP, starting from point, and select node it's found in. |
| 1910 | If DIRECTION is `backward', search in the reverse direction." | 1934 | If DIRECTION is `backward', search in the reverse direction." |
| @@ -1920,55 +1944,35 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 1920 | (when (equal regexp "") | 1944 | (when (equal regexp "") |
| 1921 | (setq regexp (car Info-search-history))) | 1945 | (setq regexp (car Info-search-history))) |
| 1922 | (when regexp | 1946 | (when regexp |
| 1923 | (let (found beg-found give-up | 1947 | (setq Info-search-case-fold case-fold-search) |
| 1924 | (backward (eq direction 'backward)) | 1948 | (let* ((backward (eq direction 'backward)) |
| 1925 | (onode Info-current-node) | 1949 | (onode Info-current-node) |
| 1926 | (ofile Info-current-file) | 1950 | (ofile Info-current-file) |
| 1927 | (opoint (point)) | 1951 | (opoint (point)) |
| 1928 | (opoint-min (point-min)) | 1952 | (opoint-min (point-min)) |
| 1929 | (opoint-max (point-max)) | 1953 | (opoint-max (point-max)) |
| 1930 | (ostart (window-start)) | 1954 | (ostart (window-start)) |
| 1931 | (osubfile Info-current-subfile)) | 1955 | (osubfile Info-current-subfile) |
| 1932 | (setq Info-search-case-fold case-fold-search) | 1956 | (found |
| 1933 | (save-excursion | 1957 | (save-excursion |
| 1934 | (save-restriction | 1958 | (save-restriction |
| 1935 | (widen) | 1959 | (widen) |
| 1936 | (when backward | 1960 | (Info--search-loop regexp bound backward))))) |
| 1937 | ;; Hide Info file header for backward search | 1961 | |
| 1938 | (narrow-to-region (save-excursion | 1962 | (unless (or (not isearch-mode) (not Info-isearch-search) |
| 1939 | (goto-char (point-min)) | 1963 | Info-isearch-initial-node |
| 1940 | (search-forward "\n\^_") | 1964 | bound |
| 1941 | (1- (point))) | 1965 | (and found (> found opoint-min) (< found opoint-max))) |
| 1942 | (point-max))) | ||
| 1943 | (while (and (not give-up) | ||
| 1944 | (or (null found) | ||
| 1945 | (not (run-hook-with-args-until-failure | ||
| 1946 | 'isearch-filter-predicates beg-found found)))) | ||
| 1947 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) | ||
| 1948 | (if (if backward | ||
| 1949 | (re-search-backward regexp bound t) | ||
| 1950 | (re-search-forward regexp bound t)) | ||
| 1951 | (setq found (point) beg-found (if backward (match-end 0) | ||
| 1952 | (match-beginning 0))) | ||
| 1953 | (setq give-up t)))))) | ||
| 1954 | |||
| 1955 | (when (and isearch-mode Info-isearch-search | ||
| 1956 | (not Info-isearch-initial-node) | ||
| 1957 | (not bound) | ||
| 1958 | (or give-up (and found (not (and (> found opoint-min) | ||
| 1959 | (< found opoint-max)))))) | ||
| 1960 | (signal 'search-failed (list regexp "end of node"))) | 1966 | (signal 'search-failed (list regexp "end of node"))) |
| 1961 | 1967 | ||
| 1962 | ;; If no subfiles, give error now. | 1968 | ;; If no subfiles, give error now. |
| 1963 | (if give-up | 1969 | (unless (or found Info-current-subfile) |
| 1964 | (if (null Info-current-subfile) | 1970 | (if isearch-mode |
| 1965 | (if isearch-mode | 1971 | (signal 'search-failed (list regexp "end of manual")) |
| 1966 | (signal 'search-failed (list regexp "end of manual")) | 1972 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) |
| 1967 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) | 1973 | (if backward |
| 1968 | (if backward | 1974 | (re-search-backward regexp) |
| 1969 | (re-search-backward regexp) | 1975 | (re-search-forward regexp))))) |
| 1970 | (re-search-forward regexp)))) | ||
| 1971 | (setq found nil))) | ||
| 1972 | 1976 | ||
| 1973 | (if (and bound (not found)) | 1977 | (if (and bound (not found)) |
| 1974 | (signal 'search-failed (list regexp))) | 1978 | (signal 'search-failed (list regexp))) |
| @@ -2009,29 +2013,9 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 2009 | (while list | 2013 | (while list |
| 2010 | (message "Searching subfile %s..." (cdr (car list))) | 2014 | (message "Searching subfile %s..." (cdr (car list))) |
| 2011 | (Info-read-subfile (car (car list))) | 2015 | (Info-read-subfile (car (car list))) |
| 2012 | (when backward | 2016 | (when backward (goto-char (point-max))) |
| 2013 | ;; Hide Info file header for backward search | ||
| 2014 | (narrow-to-region (save-excursion | ||
| 2015 | (goto-char (point-min)) | ||
| 2016 | (search-forward "\n\^_") | ||
| 2017 | (1- (point))) | ||
| 2018 | (point-max)) | ||
| 2019 | (goto-char (point-max))) | ||
| 2020 | (setq list (cdr list)) | 2017 | (setq list (cdr list)) |
| 2021 | (setq give-up nil found nil) | 2018 | (setq found (Info--search-loop regexp nil backward)) |
| 2022 | (while (and (not give-up) | ||
| 2023 | (or (null found) | ||
| 2024 | (not (run-hook-with-args-until-failure | ||
| 2025 | 'isearch-filter-predicates beg-found found)))) | ||
| 2026 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) | ||
| 2027 | (if (if backward | ||
| 2028 | (re-search-backward regexp nil t) | ||
| 2029 | (re-search-forward regexp nil t)) | ||
| 2030 | (setq found (point) beg-found (if backward (match-end 0) | ||
| 2031 | (match-beginning 0))) | ||
| 2032 | (setq give-up t)))) | ||
| 2033 | (if give-up | ||
| 2034 | (setq found nil)) | ||
| 2035 | (if found | 2019 | (if found |
| 2036 | (setq list nil))) | 2020 | (setq list nil))) |
| 2037 | (if found | 2021 | (if found |
| @@ -4288,8 +4272,7 @@ Advanced commands: | |||
| 4288 | 'Info-isearch-wrap) | 4272 | 'Info-isearch-wrap) |
| 4289 | (set (make-local-variable 'isearch-push-state-function) | 4273 | (set (make-local-variable 'isearch-push-state-function) |
| 4290 | 'Info-isearch-push-state) | 4274 | 'Info-isearch-push-state) |
| 4291 | (set (make-local-variable 'isearch-filter-predicates) | 4275 | (set (make-local-variable 'isearch-filter-predicate) #'Info-isearch-filter) |
| 4292 | '(Info-isearch-filter)) | ||
| 4293 | (set (make-local-variable 'revert-buffer-function) | 4276 | (set (make-local-variable 'revert-buffer-function) |
| 4294 | 'Info-revert-buffer-function) | 4277 | 'Info-revert-buffer-function) |
| 4295 | (Info-set-mode-line) | 4278 | (Info-set-mode-line) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index a591f8b4291..072ccc26772 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -187,21 +187,15 @@ or to the end of the buffer for a backward search.") | |||
| 187 | "Function to save a function restoring the mode-specific Isearch state | 187 | "Function to save a function restoring the mode-specific Isearch state |
| 188 | to the search status stack.") | 188 | to the search status stack.") |
| 189 | 189 | ||
| 190 | (defvar isearch-filter-predicates nil | 190 | (defvar isearch-filter-predicate #'isearch-filter-visible |
| 191 | "Predicates that filter the search hits that would normally be available. | 191 | "Predicate that filter the search hits that would normally be available. |
| 192 | Search hits that dissatisfy the list of predicates are skipped. | 192 | Search hits that dissatisfy the predicate are skipped. The function |
| 193 | Each function in this list has two arguments: the positions of | 193 | has two arguments: the positions of start and end of text matched by |
| 194 | start and end of text matched by the search. | 194 | the search. If this function returns nil, continue searching without |
| 195 | The search loop uses `run-hook-with-args-until-failure' to call | 195 | stopping at this match. |
| 196 | each predicate in order, and when one of the predicates returns nil, | 196 | If you use `add-function' to modify this variable, you can use the |
| 197 | skips this match and continues searching for the next match. | 197 | `isearch-message-prefix' advice property to specify the prefix string |
| 198 | When the list of predicates is empty, `run-hook-with-args-until-failure' | 198 | displayed in the search message.") |
| 199 | returns non-nil that means that the found match is accepted. | ||
| 200 | The property `isearch-message-prefix' put on the predicate's symbol | ||
| 201 | specifies the prefix string displayed in the search message.") | ||
| 202 | (define-obsolete-variable-alias 'isearch-filter-predicate | ||
| 203 | 'isearch-filter-predicates | ||
| 204 | "24.4") | ||
| 205 | 199 | ||
| 206 | ;; Search ring. | 200 | ;; Search ring. |
| 207 | 201 | ||
| @@ -2614,13 +2608,13 @@ If there is no completion possible, say so and continue searching." | |||
| 2614 | (< (point) isearch-opoint))) | 2608 | (< (point) isearch-opoint))) |
| 2615 | "over") | 2609 | "over") |
| 2616 | (if isearch-wrapped "wrapped ") | 2610 | (if isearch-wrapped "wrapped ") |
| 2617 | (mapconcat (lambda (s) | 2611 | (let ((prefix "")) |
| 2618 | (and (symbolp s) | 2612 | (advice-function-mapc |
| 2619 | (get s 'isearch-message-prefix))) | 2613 | (lambda (_ props) |
| 2620 | (if (consp isearch-filter-predicates) | 2614 | (let ((np (cdr (assq 'isearch-message-prefix props)))) |
| 2621 | isearch-filter-predicates | 2615 | (if np (setq prefix (concat np prefix))))) |
| 2622 | (list isearch-filter-predicates)) | 2616 | isearch-filter-predicate) |
| 2623 | "") | 2617 | prefix) |
| 2624 | (if isearch-word | 2618 | (if isearch-word |
| 2625 | (or (and (symbolp isearch-word) | 2619 | (or (and (symbolp isearch-word) |
| 2626 | (get isearch-word 'isearch-message-prefix)) | 2620 | (get isearch-word 'isearch-message-prefix)) |
| @@ -2766,15 +2760,8 @@ update the match data, and return point." | |||
| 2766 | (if (or (not isearch-success) | 2760 | (if (or (not isearch-success) |
| 2767 | (bobp) (eobp) | 2761 | (bobp) (eobp) |
| 2768 | (= (match-beginning 0) (match-end 0)) | 2762 | (= (match-beginning 0) (match-end 0)) |
| 2769 | ;; When one of filter predicates returns nil, | 2763 | (funcall isearch-filter-predicate |
| 2770 | ;; retry the search. Otherwise, act according | 2764 | (match-beginning 0) (match-end 0))) |
| 2771 | ;; to search-invisible (open overlays, etc.) | ||
| 2772 | (and (run-hook-with-args-until-failure | ||
| 2773 | 'isearch-filter-predicates | ||
| 2774 | (match-beginning 0) (match-end 0)) | ||
| 2775 | (or (eq search-invisible t) | ||
| 2776 | (not (isearch-range-invisible | ||
| 2777 | (match-beginning 0) (match-end 0)))))) | ||
| 2778 | (setq retry nil))) | 2765 | (setq retry nil))) |
| 2779 | (setq isearch-just-started nil) | 2766 | (setq isearch-just-started nil) |
| 2780 | (if isearch-success | 2767 | (if isearch-success |
| @@ -2951,7 +2938,6 @@ determined by `isearch-range-invisible' unless invisible text can be | |||
| 2951 | searched too when `search-invisible' is t." | 2938 | searched too when `search-invisible' is t." |
| 2952 | (or (eq search-invisible t) | 2939 | (or (eq search-invisible t) |
| 2953 | (not (isearch-range-invisible beg end)))) | 2940 | (not (isearch-range-invisible beg end)))) |
| 2954 | (make-obsolete 'isearch-filter-visible 'isearch-invisible "24.4") | ||
| 2955 | 2941 | ||
| 2956 | 2942 | ||
| 2957 | ;; General utilities | 2943 | ;; General utilities |
| @@ -3177,11 +3163,8 @@ Attempt to do the search exactly the way the pending Isearch would." | |||
| 3177 | (if (or (not success) | 3163 | (if (or (not success) |
| 3178 | (= (point) bound) ; like (bobp) (eobp) in `isearch-search'. | 3164 | (= (point) bound) ; like (bobp) (eobp) in `isearch-search'. |
| 3179 | (= (match-beginning 0) (match-end 0)) | 3165 | (= (match-beginning 0) (match-end 0)) |
| 3180 | (and (run-hook-with-args-until-failure | 3166 | (funcall isearch-filter-predicate |
| 3181 | 'isearch-filter-predicates | 3167 | (match-beginning 0) (match-end 0))) |
| 3182 | (match-beginning 0) (match-end 0)) | ||
| 3183 | (not (isearch-range-invisible | ||
| 3184 | (match-beginning 0) (match-end 0))))) | ||
| 3185 | (setq retry nil))) | 3168 | (setq retry nil))) |
| 3186 | success) | 3169 | success) |
| 3187 | (error nil))) | 3170 | (error nil))) |
diff --git a/lisp/loadup.el b/lisp/loadup.el index 7fb9526b360..c32bd00463e 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -139,6 +139,7 @@ | |||
| 139 | ;; In case loaddefs hasn't been generated yet. | 139 | ;; In case loaddefs hasn't been generated yet. |
| 140 | (file-error (load "ldefs-boot.el"))) | 140 | (file-error (load "ldefs-boot.el"))) |
| 141 | 141 | ||
| 142 | (load "emacs-lisp/nadvice") | ||
| 142 | (load "minibuffer") | 143 | (load "minibuffer") |
| 143 | (load "abbrev") ;lisp-mode.el and simple.el use define-abbrev-table. | 144 | (load "abbrev") ;lisp-mode.el and simple.el use define-abbrev-table. |
| 144 | (load "simple") | 145 | (load "simple") |
diff --git a/lisp/replace.el b/lisp/replace.el index be0ecda20fa..5e44677b0f8 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -252,7 +252,7 @@ or capitalized.) | |||
| 252 | 252 | ||
| 253 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, | 253 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, |
| 254 | ignore hidden matches if `search-invisible' is nil, and ignore more | 254 | ignore hidden matches if `search-invisible' is nil, and ignore more |
| 255 | matches using a non-nil `isearch-filter-predicates'. | 255 | matches using `isearch-filter-predicate'. |
| 256 | 256 | ||
| 257 | If `replace-lax-whitespace' is non-nil, a space or spaces in the string | 257 | If `replace-lax-whitespace' is non-nil, a space or spaces in the string |
| 258 | to be replaced will match a sequence of whitespace chars defined by the | 258 | to be replaced will match a sequence of whitespace chars defined by the |
| @@ -306,7 +306,7 @@ capitalized.) | |||
| 306 | 306 | ||
| 307 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, | 307 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, |
| 308 | ignore hidden matches if `search-invisible' is nil, and ignore more | 308 | ignore hidden matches if `search-invisible' is nil, and ignore more |
| 309 | matches using a non-nil `isearch-filter-predicates'. | 309 | matches using `isearch-filter-predicate'. |
| 310 | 310 | ||
| 311 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp | 311 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp |
| 312 | to be replaced will match a sequence of whitespace chars defined by the | 312 | to be replaced will match a sequence of whitespace chars defined by the |
| @@ -390,7 +390,7 @@ are non-nil and REGEXP has no uppercase letters. | |||
| 390 | 390 | ||
| 391 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, | 391 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, |
| 392 | ignore hidden matches if `search-invisible' is nil, and ignore more | 392 | ignore hidden matches if `search-invisible' is nil, and ignore more |
| 393 | matches using a non-nil `isearch-filter-predicates'. | 393 | matches using `isearch-filter-predicate'. |
| 394 | 394 | ||
| 395 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp | 395 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp |
| 396 | to be replaced will match a sequence of whitespace chars defined by the | 396 | to be replaced will match a sequence of whitespace chars defined by the |
| @@ -484,7 +484,7 @@ then its replacement is upcased or capitalized.) | |||
| 484 | 484 | ||
| 485 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, | 485 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, |
| 486 | ignore hidden matches if `search-invisible' is nil, and ignore more | 486 | ignore hidden matches if `search-invisible' is nil, and ignore more |
| 487 | matches using a non-nil `isearch-filter-predicates'. | 487 | matches using `isearch-filter-predicate'. |
| 488 | 488 | ||
| 489 | If `replace-lax-whitespace' is non-nil, a space or spaces in the string | 489 | If `replace-lax-whitespace' is non-nil, a space or spaces in the string |
| 490 | to be replaced will match a sequence of whitespace chars defined by the | 490 | to be replaced will match a sequence of whitespace chars defined by the |
| @@ -530,7 +530,7 @@ are non-nil and REGEXP has no uppercase letters. | |||
| 530 | 530 | ||
| 531 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, | 531 | Ignore read-only matches if `query-replace-skip-read-only' is non-nil, |
| 532 | ignore hidden matches if `search-invisible' is nil, and ignore more | 532 | ignore hidden matches if `search-invisible' is nil, and ignore more |
| 533 | matches using a non-nil `isearch-filter-predicates'. | 533 | matches using `isearch-filter-predicate'. |
| 534 | 534 | ||
| 535 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp | 535 | If `replace-regexp-lax-whitespace' is non-nil, a space or spaces in the regexp |
| 536 | to be replaced will match a sequence of whitespace chars defined by the | 536 | to be replaced will match a sequence of whitespace chars defined by the |
| @@ -2087,9 +2087,8 @@ make, or the user didn't cancel the call." | |||
| 2087 | 'read-only nil)))) | 2087 | 'read-only nil)))) |
| 2088 | (setq skip-read-only-count (1+ skip-read-only-count))) | 2088 | (setq skip-read-only-count (1+ skip-read-only-count))) |
| 2089 | ;; Optionally filter out matches. | 2089 | ;; Optionally filter out matches. |
| 2090 | ((not (run-hook-with-args-until-failure | 2090 | ((not (funcall isearch-filter-predicate |
| 2091 | 'isearch-filter-predicates | 2091 | (nth 0 real-match-data) (nth 1 real-match-data))) |
| 2092 | (nth 0 real-match-data) (nth 1 real-match-data))) | ||
| 2093 | (setq skip-filtered-count (1+ skip-filtered-count))) | 2092 | (setq skip-filtered-count (1+ skip-filtered-count))) |
| 2094 | ;; Optionally ignore invisible matches. | 2093 | ;; Optionally ignore invisible matches. |
| 2095 | ((not (or (eq search-invisible t) | 2094 | ((not (or (eq search-invisible t) |
diff --git a/lisp/wdired.el b/lisp/wdired.el index 55665fbb6a0..6c2c9777a47 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el | |||
| @@ -239,7 +239,8 @@ See `wdired-mode'." | |||
| 239 | (dired-remember-marks (point-min) (point-max))) | 239 | (dired-remember-marks (point-min) (point-max))) |
| 240 | (set (make-local-variable 'wdired-old-point) (point)) | 240 | (set (make-local-variable 'wdired-old-point) (point)) |
| 241 | (set (make-local-variable 'query-replace-skip-read-only) t) | 241 | (set (make-local-variable 'query-replace-skip-read-only) t) |
| 242 | (add-hook 'isearch-filter-predicates 'wdired-isearch-filter-read-only nil t) | 242 | (add-function :after-while (local 'isearch-filter-predicate) |
| 243 | #'wdired-isearch-filter-read-only) | ||
| 243 | (use-local-map wdired-mode-map) | 244 | (use-local-map wdired-mode-map) |
| 244 | (force-mode-line-update) | 245 | (force-mode-line-update) |
| 245 | (setq buffer-read-only nil) | 246 | (setq buffer-read-only nil) |