Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark-multiple could initialize from isearch #11

Open
blais opened this issue Aug 20, 2012 · 1 comment
Open

mark-multiple could initialize from isearch #11

blais opened this issue Aug 20, 2012 · 1 comment

Comments

@blais
Copy link

blais commented Aug 20, 2012

Here's an idea: one common workflow is to 1. isearch for a work, 2. start query-replace from within isearch. (It is so common to invoke query-replace from isearch that the Emacs maintainer once commented to me that this could be the only way.)

I've extended isearch slightly in order to be able to kill the current match from within isearch and keep isearch'ing:

;; Often during incremental search I want to delete the search match.  This                                                                                                                                                                                                       
;; binds the C-k key in isearch mode to to just that.                                                                                                                                                                                                                             
(defun kill-isearch-match ()
  "Kill the current isearch match string and continue searching."
  (interactive)
  (kill-region isearch-other-end (point)))

(define-key isearch-mode-map [(control k)] 'kill-isearch-match)

It would be great if mark-multiple would support being invoked from isearch.

(This is of course just an idea, I suppose I could hook this up myself, but since this is recent development, I thought you might find it interesting. I currently 1. isearch to the work I want to replace, 2. exit isearch, 3. reselect the word for mark-multiple, 4. invoke mark-multiple. It's a bit much.)

Cheers,

@blais
Copy link
Author

blais commented Aug 20, 2012

Well I guess it wasn't worth bothering you, this works:

  (defadvice mark-more-like-this (before isearch-to-region activate)
    (set-mark isearch-other-end))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant