emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: syntax-table for info


From: Nick Roberts
Subject: Re: syntax-table for info
Date: Thu, 8 Mar 2007 08:57:07 +1300

 > We already solved this kind of problem once for capitalize-region:
 > 
 >       if ((int) flag >= (int) CASE_CAPITALIZE)
 >      inword = SYNTAX (c) == Sword && (inword || !SYNTAX_PREFIX (c));
 > 
 > Since ' in text-mode has syntax "w p", it means that a ' after a word char
 > is considered by capitalize-region as being a word-char, whereas a ' after
 > a non-word char is considered as a non-word char.  This way
 > capitalize-region  applied to
 > 
 >     'can't'
 > gives
 >     'Can't'
 > 
 > I guess the same idea should be applied to word movement.

Interesting.  It might be a bit harder in this case though, because you can
have an apostrophe at the end of a word, e.g, "two mens' sons", meaning the
sons of two men.  So you would also have to check for an apostrophe at the
start of the word.

-- 
Nick                                           http://www.inet.net.nz/~nickrob




reply via email to

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