[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: I can't yank regexp for/into isearch-forward-regexp's pmpt
From: |
Kevin Rodgers |
Subject: |
Re: I can't yank regexp for/into isearch-forward-regexp's pmpt |
Date: |
Fri, 04 Aug 2006 08:05:43 -0600 |
User-agent: |
Thunderbird 1.5.0.5 (Windows/20060719) |
Kevin Rodgers wrote:
You might be able to do what you want with a little hacking:
(defun isearch-yank-kill-as-regexp ()
"Like `isearch-yank-kill', except during regular expression search:
Search for the text that matches the string (as a regexp) instead of
searching for the literal string itself."
(let ((isearch-regexp nil))
(isearch-yank-kill)))
(define-key isearch-mode-map "\M-z" 'isearch-yank-kill-as-regexp)
Drew Adams points out that we need an (interactive) form between
isearch-yank-kill-as-regexp's argument list and its doc string.
He also reports:
| 2. For some reason, when using `C-M-s' followed by `M-z', the search seems
| to always start at the end of the buffer. So, it first fails, and then it
| can succeed on overwrap search (repeating `C-s'). This problem doesn't
occur
| for simple `C-s' search. I'm not sure why this happens.
I suspect it has something to do with the global binding of M-z to
zap-to-char and/or the squirrely business with isearch-other-meta-char,
which I don't understand. Does the problem go away if you bind a
different meta-character or a control-character to
isearch-yank-kill-as-regexp?
--
Kevin