aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-07-26 14:48:00 +0000
committerGerd Moellmann2000-07-26 14:48:00 +0000
commitc40a4de1df24a74f43484c2fb4321027e0d2bdb1 (patch)
tree8c79d0deac74e4329fa1a35bab0156232937cb46
parent4728a55337f5c9a3fcd48d638c42e8cb5a8e9be8 (diff)
downloademacs-c40a4de1df24a74f43484c2fb4321027e0d2bdb1.tar.gz
emacs-c40a4de1df24a74f43484c2fb4321027e0d2bdb1.zip
(isearch-resume): New function.
(isearch-done): Add something to command-history to resume the search. (isearch-yank-line, isearch-yank-word): Use buffer-substring-no-properties instead of buffer-substring.
-rw-r--r--lisp/isearch.el26
1 files changed, 24 insertions, 2 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 7285023dc44..9a4fb86b2b0 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -625,6 +625,13 @@ is treated as a regexp. See \\[isearch-forward] for more info."
625 (setq disable-point-adjustment t)) 625 (setq disable-point-adjustment t))
626 626
627(defun isearch-done (&optional nopush edit) 627(defun isearch-done (&optional nopush edit)
628 (let ((command `(isearch-resume ,isearch-string ,isearch-regexp
629 ,isearch-word ,isearch-forward
630 ,isearch-message
631 ,isearch-case-fold-search)))
632 (unless (equal (car command-history) command)
633 (setq command-history (cons command command-history))))
634
628 (remove-hook 'mouse-leave-buffer-hook 'isearch-done) 635 (remove-hook 'mouse-leave-buffer-hook 'isearch-done)
629 ;; Called by all commands that terminate isearch-mode. 636 ;; Called by all commands that terminate isearch-mode.
630 ;; If NOPUSH is non-nil, we don't push the string on the search ring. 637 ;; If NOPUSH is non-nil, we don't push the string on the search ring.
@@ -1030,7 +1037,8 @@ Otherwise invoke `mouse-yank-at-click'."
1030 (save-excursion 1037 (save-excursion
1031 (and (not isearch-forward) isearch-other-end 1038 (and (not isearch-forward) isearch-other-end
1032 (goto-char isearch-other-end)) 1039 (goto-char isearch-other-end))
1033 (buffer-substring (point) (progn (forward-word 1) (point)))))) 1040 (buffer-substring-no-properties
1041 (point) (progn (forward-word 1) (point))))))
1034 1042
1035(defun isearch-yank-line () 1043(defun isearch-yank-line ()
1036 "Pull rest of line from buffer into search string." 1044 "Pull rest of line from buffer into search string."
@@ -1039,7 +1047,7 @@ Otherwise invoke `mouse-yank-at-click'."
1039 (save-excursion 1047 (save-excursion
1040 (and (not isearch-forward) isearch-other-end 1048 (and (not isearch-forward) isearch-other-end
1041 (goto-char isearch-other-end)) 1049 (goto-char isearch-other-end))
1042 (buffer-substring (point) (line-end-position))))) 1050 (buffer-substring-no-properties (point) (line-end-position)))))
1043 1051
1044 1052
1045(defun isearch-search-and-update () 1053(defun isearch-search-and-update ()
@@ -1938,4 +1946,18 @@ Attempt to do the search exactly the way the pending isearch would."
1938 (setq isearch-lazy-highlight-end (point-min)) 1946 (setq isearch-lazy-highlight-end (point-min))
1939 (setq isearch-lazy-highlight-start (point-max)))))))))) 1947 (setq isearch-lazy-highlight-start (point-max))))))))))
1940 1948
1949(defun isearch-resume (search regexp word forward message case-fold)
1950 "Resume an incremental search.
1951SEARCH is the string or regexp searched for.
1952REGEXP non-nil means the resumed search was a regexp search.
1953WORD non-nil means resume a word search.
1954FORWARD non-nil means resume a forward search.
1955MESSAGE is the echo-area message recorded for the search resumed.
1956CASE-FOLD non-nil means the search was case-insensitive."
1957 (isearch-mode forward regexp nil nil word)
1958 (setq isearch-string search
1959 isearch-message message
1960 isearch-case-fold-search case-fold)
1961 (isearch-search))
1962
1941;;; isearch.el ends here 1963;;; isearch.el ends here