diff options
| author | Stefan Monnier | 2015-05-27 12:16:16 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-05-27 12:16:16 -0400 |
| commit | b506f8007561774479e26e8637467e8afefbe371 (patch) | |
| tree | 9044d11c05b5bf4781708e048b1c4050fc87026e | |
| parent | 401b4c4015e109ef4f59bf3dd558d2a8baf72fb2 (diff) | |
| download | emacs-b506f8007561774479e26e8637467e8afefbe371.tar.gz emacs-b506f8007561774479e26e8637467e8afefbe371.zip | |
* lisp/isearch.el (isearch--current-buffer): New var
(isearch-update): Set cursor-sensor-inhibit here.
(isearch-done): Unset cursor-sensor-inhibit in the right buffer (bug#20532).
| -rw-r--r-- | lisp/isearch.el | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index dc10502309f..5599ea55632 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -932,12 +932,6 @@ convert the search string to a regexp used by regexp search functions." | |||
| 932 | (add-hook 'post-command-hook 'isearch-post-command-hook) | 932 | (add-hook 'post-command-hook 'isearch-post-command-hook) |
| 933 | (add-hook 'mouse-leave-buffer-hook 'isearch-done) | 933 | (add-hook 'mouse-leave-buffer-hook 'isearch-done) |
| 934 | (add-hook 'kbd-macro-termination-hook 'isearch-done) | 934 | (add-hook 'kbd-macro-termination-hook 'isearch-done) |
| 935 | (make-local-variable 'cursor-sensor-inhibit) | ||
| 936 | (unless (boundp 'cursor-sensor-inhibit) | ||
| 937 | (setq cursor-sensor-inhibit nil)) | ||
| 938 | ;; Suspend things like cursor-intangible during Isearch so we can search even | ||
| 939 | ;; within intangible text. | ||
| 940 | (push 'isearch cursor-sensor-inhibit) | ||
| 941 | 935 | ||
| 942 | ;; isearch-mode can be made modal (in the sense of not returning to | 936 | ;; isearch-mode can be made modal (in the sense of not returning to |
| 943 | ;; the calling function until searching is completed) by entering | 937 | ;; the calling function until searching is completed) by entering |
| @@ -949,10 +943,23 @@ convert the search string to a regexp used by regexp search functions." | |||
| 949 | 943 | ||
| 950 | 944 | ||
| 951 | ;; Some high level utilities. Others below. | 945 | ;; Some high level utilities. Others below. |
| 946 | (defvar isearch--current-buffer) | ||
| 952 | 947 | ||
| 953 | (defun isearch-update () | 948 | (defun isearch-update () |
| 954 | "This is called after every isearch command to update the display. | 949 | "This is called after every isearch command to update the display. |
| 955 | The last thing it does is to run `isearch-update-post-hook'." | 950 | The last thing it does is to run `isearch-update-post-hook'." |
| 951 | (unless (eq (current-buffer) isearch--current-buffer) | ||
| 952 | (when isearch--current-buffer | ||
| 953 | (with-current-buffer isearch--current-buffer | ||
| 954 | (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))) | ||
| 955 | (setq isearch--current-buffer (current-buffer)) | ||
| 956 | (make-local-variable 'cursor-sensor-inhibit) | ||
| 957 | (unless (boundp 'cursor-sensor-inhibit) | ||
| 958 | (setq cursor-sensor-inhibit nil)) | ||
| 959 | ;; Suspend things like cursor-intangible during Isearch so we can search | ||
| 960 | ;; even within intangible text. | ||
| 961 | (push 'isearch cursor-sensor-inhibit)) | ||
| 962 | |||
| 956 | (if (and (null unread-command-events) | 963 | (if (and (null unread-command-events) |
| 957 | (null executing-kbd-macro)) | 964 | (null executing-kbd-macro)) |
| 958 | (progn | 965 | (progn |
| @@ -1026,7 +1033,9 @@ NOPUSH is t and EDIT is t." | |||
| 1026 | (remove-hook 'mouse-leave-buffer-hook 'isearch-done) | 1033 | (remove-hook 'mouse-leave-buffer-hook 'isearch-done) |
| 1027 | (remove-hook 'kbd-macro-termination-hook 'isearch-done) | 1034 | (remove-hook 'kbd-macro-termination-hook 'isearch-done) |
| 1028 | (setq isearch-lazy-highlight-start nil) | 1035 | (setq isearch-lazy-highlight-start nil) |
| 1029 | (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)) | 1036 | (with-current-buffer isearch--current-buffer |
| 1037 | (setq isearch--current-buffer nil) | ||
| 1038 | (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))) | ||
| 1030 | 1039 | ||
| 1031 | ;; Called by all commands that terminate isearch-mode. | 1040 | ;; Called by all commands that terminate isearch-mode. |
| 1032 | ;; If NOPUSH is non-nil, we don't push the string on the search ring. | 1041 | ;; If NOPUSH is non-nil, we don't push the string on the search ring. |