diff options
| author | Juri Linkov | 2007-07-22 22:35:10 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-07-22 22:35:10 +0000 |
| commit | e81ab986428e7c45c3e7ac2ae6bf52f39dfcefbf (patch) | |
| tree | cb3ba8e491e4ff947e1f6247c0f1ca9139202780 | |
| parent | 49bbf1b953d9ef97fa9398a90e66b6f9fc340321 (diff) | |
| download | emacs-e81ab986428e7c45c3e7ac2ae6bf52f39dfcefbf.tar.gz emacs-e81ab986428e7c45c3e7ac2ae6bf52f39dfcefbf.zip | |
(isearch-edit-string): Save old point and
isearch-other-end to old-point and old-other-end before reading
the search string from minibuffer. After exiting minibuffer set
point to old-other-end if point and the search direction is the
same as before reading the search string.
(isearch-del-char): Don't set isearch-yank-flag to t. Put point
to isearch-other-end. Instead of isearch-search-and-update call
three functions isearch-search, isearch-push-state and isearch-update.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/isearch.el | 25 |
2 files changed, 31 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39852c22ab2..2d63c163eea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2007-07-22 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * isearch.el (isearch-edit-string): Save old point and | ||
| 4 | isearch-other-end to old-point and old-other-end before reading | ||
| 5 | the search string from minibuffer. After exiting minibuffer set | ||
| 6 | point to old-other-end if point and the search direction is the | ||
| 7 | same as before reading the search string. | ||
| 8 | (isearch-del-char): Don't set isearch-yank-flag to t. Put point | ||
| 9 | to isearch-other-end. Instead of isearch-search-and-update call | ||
| 10 | three functions isearch-search, isearch-push-state and isearch-update. | ||
| 11 | |||
| 1 | 2007-07-22 Ralf Angeli <angeli@caeruleus.net> | 12 | 2007-07-22 Ralf Angeli <angeli@caeruleus.net> |
| 2 | 13 | ||
| 3 | * textmodes/reftex.el (reftex-access-parse-file): Do not risk | 14 | * textmodes/reftex.el (reftex-access-parse-file): Do not risk |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 71e5e4bccd3..00e7f1cc306 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -992,7 +992,7 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst | |||
| 992 | isearch-original-minibuffer-message-timeout) | 992 | isearch-original-minibuffer-message-timeout) |
| 993 | (isearch-original-minibuffer-message-timeout | 993 | (isearch-original-minibuffer-message-timeout |
| 994 | isearch-original-minibuffer-message-timeout) | 994 | isearch-original-minibuffer-message-timeout) |
| 995 | ) | 995 | old-point old-other-end) |
| 996 | 996 | ||
| 997 | ;; Actually terminate isearching until editing is done. | 997 | ;; Actually terminate isearching until editing is done. |
| 998 | ;; This is so that the user can do anything without failure, | 998 | ;; This is so that the user can do anything without failure, |
| @@ -1001,6 +1001,10 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst | |||
| 1001 | (isearch-done t t) | 1001 | (isearch-done t t) |
| 1002 | (exit nil)) ; was recursive editing | 1002 | (exit nil)) ; was recursive editing |
| 1003 | 1003 | ||
| 1004 | ;; Save old point and isearch-other-end before reading from minibuffer | ||
| 1005 | ;; that can change their values. | ||
| 1006 | (setq old-point (point) old-other-end isearch-other-end) | ||
| 1007 | |||
| 1004 | (isearch-message) ;; for read-char | 1008 | (isearch-message) ;; for read-char |
| 1005 | (unwind-protect | 1009 | (unwind-protect |
| 1006 | (let* (;; Why does following read-char echo? | 1010 | (let* (;; Why does following read-char echo? |
| @@ -1036,6 +1040,14 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst | |||
| 1036 | isearch-new-message | 1040 | isearch-new-message |
| 1037 | (mapconcat 'isearch-text-char-description | 1041 | (mapconcat 'isearch-text-char-description |
| 1038 | isearch-new-string ""))) | 1042 | isearch-new-string ""))) |
| 1043 | |||
| 1044 | ;; Set point at the start (end) of old match if forward (backward), | ||
| 1045 | ;; so after exiting minibuffer isearch resumes at the start (end) | ||
| 1046 | ;; of this match and can find it again. | ||
| 1047 | (if (and old-other-end (eq old-point (point)) | ||
| 1048 | (eq isearch-forward isearch-new-forward)) | ||
| 1049 | (goto-char old-other-end)) | ||
| 1050 | |||
| 1039 | ;; Always resume isearching by restarting it. | 1051 | ;; Always resume isearching by restarting it. |
| 1040 | (isearch-mode isearch-forward | 1052 | (isearch-mode isearch-forward |
| 1041 | isearch-regexp | 1053 | isearch-regexp |
| @@ -1260,10 +1272,13 @@ If search string is empty, just beep." | |||
| 1260 | (ding) | 1272 | (ding) |
| 1261 | (setq isearch-string (substring isearch-string 0 (- (or arg 1))) | 1273 | (setq isearch-string (substring isearch-string 0 (- (or arg 1))) |
| 1262 | isearch-message (mapconcat 'isearch-text-char-description | 1274 | isearch-message (mapconcat 'isearch-text-char-description |
| 1263 | isearch-string "") | 1275 | isearch-string ""))) |
| 1264 | ;; Don't move cursor in reverse search. | 1276 | ;; Use the isearch-other-end as new starting point to be able |
| 1265 | isearch-yank-flag t)) | 1277 | ;; to find the remaining part of the search string again. |
| 1266 | (isearch-search-and-update)) | 1278 | (if isearch-other-end (goto-char isearch-other-end)) |
| 1279 | (isearch-search) | ||
| 1280 | (isearch-push-state) | ||
| 1281 | (isearch-update)) | ||
| 1267 | 1282 | ||
| 1268 | (defun isearch-yank-string (string) | 1283 | (defun isearch-yank-string (string) |
| 1269 | "Pull STRING into search string." | 1284 | "Pull STRING into search string." |