[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: isearch C-o patch (post-freeze resubmission)
From: |
Kim F. Storm |
Subject: |
Re: isearch C-o patch (post-freeze resubmission) |
Date: |
01 Dec 2001 04:32:53 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
Kenichi Handa <address@hidden> writes:
> address@hidden (Kim F. Storm) writes:
> > However, I would much rather change the behaviour of C-w so that it
> > copies a `word' if it is on a `word character' and a single character
> > otherwise. Then I could C-w C-w C-w to copy word+= into the
> > minibuffer (and use backspace if I got too much).
>
> I'm not sure I like it or not.
>
> I'll do this quite often while reading C or Lisp file:
>
> Move point to the head of function/variable, say,
> THIS-FUNCTION-DO-THIS-AND-THAT. Then, type C-s C-w C-w
> C-w C-w C-w C-w C-s .. to search for that name.
>
> With your change, I must type C-w 11 times instead of
> current 6 times.
Please try this version - it handles the above case nicely
but isn't greedy if there are multiple non-word characters
between words!
(defun isearch-yank-word ()
"Pull next word or symbol from buffer into search string."
(interactive)
(isearch-yank-internal (lambda ()
(if (or (= (char-syntax (or (char-after) 0)) ?w)
(= (char-syntax (or (char-after (1+
(point))) 0)) ?w))
(forward-word 1)
(forward-char 1)) (point))))
--
Kim F. Storm <address@hidden> http://www.cua.dk