help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: symbols verses words


From: rusi
Subject: Re: symbols verses words
Date: Thu, 3 Mar 2011 07:34:18 -0800 (PST)
User-agent: G2/1.0

On Mar 3, 7:48 pm, Tassilo Horn <address@hidden> wrote:
> Perry Smith <address@hidden> writes:
>
> Hi Perry,
>
>
>
> >> I think, something like that should do the trick:
>
> >> --8<---------------cut here---------------start------------->8---
> >> (defun isearch-yank-symbol-or-char ()
> >>  "Pull next character or symbol from buffer into search string."
> >>  (interactive)
> >>  (isearch-yank-internal
> >>   (lambda ()
> >>     (if (or (memq (char-syntax (or (char-after) 0)) '(?w ?_))
> >>             (memq (char-syntax (or (char-after (1+ (point))) 0)) '(?w ?_)))
> >>         (forward-symbol 1)
> >>       (forward-char 1))
> >>     (point))))
>
> >> (define-key isearch-mode-map (kbd "C-S-w") 'isearch-yank-symbol-or-char)
> >> --8<---------------cut here---------------end--------------->8---
>
> >> So when you are on a word constituent (?w) or on a symbol constituent
> >> (?_), then do `forward-symbol', else `forward-char'.
>
> > Thanks.  The problem is that my emacs (GNU 23.2) doesn't have
> > forward-symbol.  I didn't know how to do that.
>
> Ah, that function is defined in thingatpt.el, so you are only missing a
> (require 'thingatpt).
>
> Bye,
> Tassilo

Its there but not documented (emacs 23.1.1)


reply via email to

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