From: Perry Smith <pedzsan@gmail.com>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: symbols verses words
Date: Thu, 3 Mar 2011 13:25:28 -0600 [thread overview]
Message-ID: <4D23A785-46BC-4C54-AABC-8DA922AEA177@gmail.com> (raw)
In-Reply-To: <87zkpcntt7.fsf@member.fsf.org>
On Mar 3, 2011, at 8:48 AM, Tassilo Horn wrote:
> Perry Smith <pedzsan@gmail.com> 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).
Got it... thanks!
Perry
next prev parent reply other threads:[~2011-03-03 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 0:20 symbols verses words Perry Smith
2011-03-03 7:52 ` Andreas Röhler
2011-03-03 10:19 ` Tassilo Horn
2011-03-03 14:14 ` Perry Smith
2011-03-03 14:48 ` Tassilo Horn
2011-03-03 19:25 ` Perry Smith [this message]
[not found] ` <mailman.9.1299163745.10269.help-gnu-emacs@gnu.org>
2011-03-03 15:34 ` rusi
2011-03-04 9:06 ` Andreas Röhler
2011-03-03 14:26 ` MBR
2011-03-03 14:33 ` Perry Smith
[not found] <mailman.10.1299111607.15358.help-gnu-emacs@gnu.org>
2011-03-05 4:36 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D23A785-46BC-4C54-AABC-8DA922AEA177@gmail.com \
--to=pedzsan@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=tassilo@member.fsf.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.