unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: symbols verses words
Date: Thu, 03 Mar 2011 08:52:27 +0100	[thread overview]
Message-ID: <4D6F48BB.7010101@easy-emacs.de> (raw)
In-Reply-To: <06BF1211-A1CA-4E57-ADF4-8C89EF6ACDE1@gmail.com>

Am 03.03.2011 01:20, schrieb Perry Smith:
> I need some help understanding Emac's design.  I use a lot of "word" constructs where I *think* I should be using symbol.  For example, if I'm writing C code and I want to find foo but not foo_bar, I usually do \<foo\>  but really it seems that I should be doing \_<foo\_>  ... fine.  I can make that adjustment.  But when I do incremental search, I often hit ^w to pull in the next word but what I really want (often but not always) is to pull in the next symbol (into the search string).  So if I'm sitting at this_that, I'd ilke to hit ^W (perhaps) and pull in this_that instead of just this.
>
> So, I started looking at isearch-yank-word-or-char and I was going to concoct isearch-yank-symbol-or-char and got stuck-- at least briefly.  Because not only is _ marked as symbol, -, +, /, *, etc are marked as symbol characters too.  So now, I'm confused...
>
> If I have:  this  this_that  this-that
>
> and search for \_<this\_>  I hit the first and third this -- which is exactly what I want.


Which should not happen IMHO, as

`\_>'
      matches the empty string, but only at the end of a symbol


and your third this of this-that is not at the end.

BTW can't reproduce this with C-M-s, isearch-repeat-forward

it doesn't match this-that, as expected.

Looks like a bug, maybe try the last pre-release, which works fine here:

ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-23.3-rc1.tar.gz

Andreas

--
https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
https://code.launchpad.net/s-x-emacs-werkstatt/




  But how is it doing that since this_that and this-that are the same as 
far as looking at the syntax table entries?  They are both wwww_wwww.
>
> I'd like to understand how the \_<  and \_>  constructs work so I can make my isearch-yank-symbol-or-char work in a consistent manner.
>
> Thanks,
> Perry
>
>
>




  reply	other threads:[~2011-03-03  7:52 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 [this message]
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
     [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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D6F48BB.7010101@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).