[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r104394: * lisp/isearch.el: Let M-e s
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r104394: * lisp/isearch.el: Let M-e start with point at the first mismatched char. |
Date: |
Fri, 27 May 2011 22:26:53 -0300 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 104394
author: Drew Adams <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2011-05-27 22:26:53 -0300
message:
* lisp/isearch.el: Let M-e start with point at the first mismatched char.
(isearch-fail-pos): New function.
(isearch-edit-string): Use it.
modified:
lisp/ChangeLog
lisp/isearch.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-05-28 01:14:38 +0000
+++ b/lisp/ChangeLog 2011-05-28 01:26:53 +0000
@@ -1,3 +1,9 @@
+2011-05-28 Drew Adams <address@hidden>
+
+ * isearch.el: Let M-e start with point at the first mismatched char.
+ (isearch-fail-pos): New function.
+ (isearch-edit-string): Use it.
+
2011-05-28 Dmitry Kurochkin <address@hidden> (tiny change)
* isearch.el (isearch-range-invisible): Use invisible-p (bug#8721).
=== modified file 'lisp/isearch.el'
--- a/lisp/isearch.el 2011-05-28 01:14:38 +0000
+++ b/lisp/isearch.el 2011-05-28 01:26:53 +0000
@@ -1062,6 +1062,22 @@
(defvar minibuffer-history-symbol) ;; from external package gmhist.el
+(defun isearch-fail-pos ()
+ "Position of first mismatch in search string, or its length if none."
+ (let ((cmds isearch-cmds))
+ (if (and isearch-success (not isearch-error))
+ (length isearch-message)
+ (while (or (not (isearch-success-state (car cmds)))
+ (isearch-error-state (car cmds)))
+ (pop cmds))
+ (let ((succ-msg (and cmds (isearch-message-state (car cmds)))))
+ (if (and (stringp succ-msg)
+ (< (length succ-msg) (length isearch-message))
+ (equal succ-msg
+ (substring isearch-message 0 (length succ-msg))))
+ (length succ-msg)
+ 0)))))
+
(defun isearch-edit-string ()
"Edit the search string in the minibuffer.
The following additional command keys are active while editing.
@@ -1141,7 +1157,7 @@
(setq isearch-new-string
(read-from-minibuffer
(isearch-message-prefix nil nil isearch-nonincremental)
- isearch-string
+ (cons isearch-string (1+ (isearch-fail-pos)))
minibuffer-local-isearch-map nil
(if isearch-regexp
(cons 'regexp-search-ring
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r104394: * lisp/isearch.el: Let M-e start with point at the first mismatched char.,
Stefan Monnier <=