unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* move to fail position in Isearch edit
@ 2008-11-11  6:42 Drew Adams
  2008-11-11  7:13 ` Mathias Dahl
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Drew Adams @ 2008-11-11  6:42 UTC (permalink / raw)
  To: emacs-devel

Any interest in this? I bind it to `M-e' in `minibuffer-local-isearch-map', so
`M-e M-e' puts the cursor at the match failure position. 

If you type a search string quickly and mistype a char or two, this lets you
correct the typo without discarding and retyping the rest of the search string:
`M-e M-e <corrections> C-s'.

(defun isearch-goto-success-end ()
    "Go to end of search string text that matches."
    (interactive)
    (goto-char (point-max))
    (let ((cmds  isearch-cmds)
          succ-msg)
      (when (or (not isearch-success) isearch-error)
        (while (or (not (isearch-success-state (car cmds))) 
                   (isearch-error-state (car cmds)))
          (pop cmds))
        (setq succ-msg  (and cmds (isearch-message-state (car cmds))))
        (backward-char (- (length isearch-string) (length succ-msg))))))

(define-key minibuffer-local-isearch-map 
            "\M-e" 'isearchp-goto-success-end)





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-11-11 21:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-11  6:42 move to fail position in Isearch edit Drew Adams
2008-11-11  7:13 ` Mathias Dahl
2008-11-11 15:07 ` Isearch: always try to find longest successful prefix [was: move to fail position in Isearch edit] Drew Adams
2008-11-11 17:32   ` Juri Linkov
2008-11-11 20:19     ` Drew Adams
2008-11-11 17:33 ` move to fail position in Isearch edit Juri Linkov
2008-11-11 20:16   ` Drew Adams
2008-11-11 20:33   ` Mathias Dahl
2008-11-11 21:02     ` Drew Adams
2008-11-11 21:36       ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).