emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

move to fail position in Isearch edit


From: Drew Adams
Subject: move to fail position in Isearch edit
Date: Mon, 10 Nov 2008 22:42:33 -0800

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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]