diff options
| author | Drew Adams | 2011-05-27 22:26:53 -0300 |
|---|---|---|
| committer | Stefan Monnier | 2011-05-27 22:26:53 -0300 |
| commit | b74aa22b0a69709a67f33fb446da3c22f7ea340c (patch) | |
| tree | 88c7804922ccb7835e1ea2cc07a31ec115dda385 | |
| parent | 66e2e71d556785cd10270931c6fc0424b9dea6a6 (diff) | |
| download | emacs-b74aa22b0a69709a67f33fb446da3c22f7ea340c.tar.gz emacs-b74aa22b0a69709a67f33fb446da3c22f7ea340c.zip | |
* lisp/isearch.el: Let M-e start with point at the first mismatched char.
(isearch-fail-pos): New function.
(isearch-edit-string): Use it.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/isearch.el | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fe1f6cdeaba..03af0adf999 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-05-28 Drew Adams <drew.adams@oracle.com> | ||
| 2 | |||
| 3 | * isearch.el: Let M-e start with point at the first mismatched char. | ||
| 4 | (isearch-fail-pos): New function. | ||
| 5 | (isearch-edit-string): Use it. | ||
| 6 | |||
| 1 | 2011-05-28 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> (tiny change) | 7 | 2011-05-28 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> (tiny change) |
| 2 | 8 | ||
| 3 | * isearch.el (isearch-range-invisible): Use invisible-p (bug#8721). | 9 | * isearch.el (isearch-range-invisible): Use invisible-p (bug#8721). |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 1bb08d1ebb4..7f018ab14c7 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1062,6 +1062,22 @@ nonincremental search instead via `isearch-edit-string'." | |||
| 1062 | 1062 | ||
| 1063 | (defvar minibuffer-history-symbol) ;; from external package gmhist.el | 1063 | (defvar minibuffer-history-symbol) ;; from external package gmhist.el |
| 1064 | 1064 | ||
| 1065 | (defun isearch-fail-pos () | ||
| 1066 | "Position of first mismatch in search string, or its length if none." | ||
| 1067 | (let ((cmds isearch-cmds)) | ||
| 1068 | (if (and isearch-success (not isearch-error)) | ||
| 1069 | (length isearch-message) | ||
| 1070 | (while (or (not (isearch-success-state (car cmds))) | ||
| 1071 | (isearch-error-state (car cmds))) | ||
| 1072 | (pop cmds)) | ||
| 1073 | (let ((succ-msg (and cmds (isearch-message-state (car cmds))))) | ||
| 1074 | (if (and (stringp succ-msg) | ||
| 1075 | (< (length succ-msg) (length isearch-message)) | ||
| 1076 | (equal succ-msg | ||
| 1077 | (substring isearch-message 0 (length succ-msg)))) | ||
| 1078 | (length succ-msg) | ||
| 1079 | 0))))) | ||
| 1080 | |||
| 1065 | (defun isearch-edit-string () | 1081 | (defun isearch-edit-string () |
| 1066 | "Edit the search string in the minibuffer. | 1082 | "Edit the search string in the minibuffer. |
| 1067 | The following additional command keys are active while editing. | 1083 | The following additional command keys are active while editing. |
| @@ -1141,7 +1157,7 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst | |||
| 1141 | (setq isearch-new-string | 1157 | (setq isearch-new-string |
| 1142 | (read-from-minibuffer | 1158 | (read-from-minibuffer |
| 1143 | (isearch-message-prefix nil nil isearch-nonincremental) | 1159 | (isearch-message-prefix nil nil isearch-nonincremental) |
| 1144 | isearch-string | 1160 | (cons isearch-string (1+ (isearch-fail-pos))) |
| 1145 | minibuffer-local-isearch-map nil | 1161 | minibuffer-local-isearch-map nil |
| 1146 | (if isearch-regexp | 1162 | (if isearch-regexp |
| 1147 | (cons 'regexp-search-ring | 1163 | (cons 'regexp-search-ring |