all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Miles Bader <miles@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: subword-mode
Date: Wed, 25 Nov 2009 09:19:25 -0500	[thread overview]
Message-ID: <jwvd436itly.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <buo3a4318mk.fsf@dhlpc061.dev.necel.com> (Miles Bader's message of "Wed, 25 Nov 2009 14:22:27 +0900")

>> I just bumped into find-word-boundary-function-table, which lead me to
>> its only user: cap-words.el.
>> It seems both subword.el and cap-words.el provide the same feature (tho
>> cap-words.el is obviously not good at advertising itself, ahem).

> Given that it's only about 3 lines long, and apparently works by taking
> advantage of some existing low-level mechanism, cap-words.el seems by
> far the more elegant implementation...

Of course, it also has its disadvantages:
- the mechanism was not pre-existing (i.e. the implementation of
  cap-words.el included a patch to syntax.c to add the relevant hook).
- because it operates at a low level it sometimes does more than one
  asks for: e.g. since abbrevs are defined by default as "words", it
  means that "FooBar" cannot be an abbrev without extra work.

BTW, looking at both subword and cap-words I'm surpried at the use of
2 completely separate regexps when going forward and backward.
I'd expect the use of a regexp like
"\\([[:lower:]]\\)[[:upper:][:digit:]]" where (match-end 1) says where
to stop and that should work in either direction.  That can be combined
with "\\<" or "\\>" depending on the direction, (although I'd actually
prefer using forward-word to find that boundary, so it also obeys script
boundaries).


        Stefan




  parent reply	other threads:[~2009-11-25 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25  4:26 subword-mode Stefan Monnier
2009-11-25  5:22 ` subword-mode Miles Bader
2009-11-25  7:58   ` subword-mode Tassilo Horn
2009-11-25  9:31     ` subword-mode Miles Bader
2009-11-25 14:19   ` Stefan Monnier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-25 11:47 subword-mode Sam Halliday

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=jwvd436itly.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=miles@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.
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.