* Case-sensitive support with regexp specials ? @ 2004-12-14 8:55 Sun Yijiang [not found] ` <E1Ceab7-0003kt-GU@fencepost.gnu.org> 0 siblings, 1 reply; 5+ messages in thread From: Sun Yijiang @ 2004-12-14 8:55 UTC (permalink / raw) It seems that Emacs only provides a method to do case insensitive search with "regexp search functions", not with "regexp specials", like vim does. This is not convenient when defining mixed case-sensitive and case-insensitive keywords in some modes. I wonder if this is a TODO in GNU Emacs. Thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <E1Ceab7-0003kt-GU@fencepost.gnu.org>]
* Re: Case-sensitive support with regexp specials ? [not found] ` <E1Ceab7-0003kt-GU@fencepost.gnu.org> @ 2004-12-16 1:56 ` Sun Yijiang 2004-12-16 17:33 ` Kevin Rodgers 2004-12-17 0:53 ` Richard Stallman 0 siblings, 2 replies; 5+ messages in thread From: Sun Yijiang @ 2004-12-16 1:56 UTC (permalink / raw) Cc: emacs-devel In vim regexp, `\c' means "ignore case diffs from here" and `\C' means "consider case diffs from here". Thus, `\chello\CWorld' matches "HeLloWorld" but does not match "helloWoRLd". In GNU Emacs, this regexp should be `[hH][eE][lL][lL][oO]World', which is a little bit ugly and not very convenient in some cases. On Wed, 15 Dec 2004 09:57:49 -0500, Richard Stallman <rms@gnu.org> wrote: > It seems that Emacs only provides a method to do case insensitive > search with "regexp search functions", not with "regexp specials", > like vim does. > > Sorry, I don't know what that means. I do not use vim. > Could you explain? > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Case-sensitive support with regexp specials ? 2004-12-16 1:56 ` Sun Yijiang @ 2004-12-16 17:33 ` Kevin Rodgers 2004-12-18 0:19 ` Richard Stallman 2004-12-17 0:53 ` Richard Stallman 1 sibling, 1 reply; 5+ messages in thread From: Kevin Rodgers @ 2004-12-16 17:33 UTC (permalink / raw) Sun Yijiang wrote: > On Wed, 15 Dec 2004 09:57:49 -0500, Richard Stallman <rms@gnu.org> wrote: > > > It seems that Emacs only provides a method to do case insensitive > > > search with "regexp search functions", not with "regexp specials", > > > like vim does. > > > > Sorry, I don't know what that means. I do not use vim. > > Could you explain? > > In vim regexp, `\c' means "ignore case diffs from here" and `\C' means > "consider case diffs from here". Thus, `\chello\CWorld' matches > "HeLloWorld" but does not match "helloWoRLd". In GNU Emacs, this > regexp should be `[hH][eE][lL][lL][oO]World', which is a little bit > ugly and not very convenient in some cases. Yuck: IMHO a balanced syntax like \(?:...\) would be better than a state-switching construction. Cool: You could combine that with \sw to match upper- and lower-case words in any character set, without having to enumerate the character ranges. -- Kevin Rodgers ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Case-sensitive support with regexp specials ? 2004-12-16 17:33 ` Kevin Rodgers @ 2004-12-18 0:19 ` Richard Stallman 0 siblings, 0 replies; 5+ messages in thread From: Richard Stallman @ 2004-12-18 0:19 UTC (permalink / raw) Cc: emacs-devel Yuck: IMHO a balanced syntax like \(?:...\) would be better than a state-switching construction. For this operation, requiring "balance" might make it clumsy and could also interfere with use. I think the syntax of \c and \C fits in better. However, \c and \C already have meanings in Emacs regexps, for matching in terms of character categories. So we would need to choose some other letter for this, or else change incompatibly to a different letter for categories. (Such an incompatible change would not be tragic, since users probably don't use the syntax very much.) ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Case-sensitive support with regexp specials ? 2004-12-16 1:56 ` Sun Yijiang 2004-12-16 17:33 ` Kevin Rodgers @ 2004-12-17 0:53 ` Richard Stallman 1 sibling, 0 replies; 5+ messages in thread From: Richard Stallman @ 2004-12-17 0:53 UTC (permalink / raw) Cc: emacs-devel In vim regexp, `\c' means "ignore case diffs from here" and `\C' means "consider case diffs from here". Thus, `\chello\CWorld' matches "HeLloWorld" but does not match "helloWoRLd". I would not object if it were added. However, it should wait till after the coming release. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-12-18 0:19 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-12-14 8:55 Case-sensitive support with regexp specials ? Sun Yijiang [not found] ` <E1Ceab7-0003kt-GU@fencepost.gnu.org> 2004-12-16 1:56 ` Sun Yijiang 2004-12-16 17:33 ` Kevin Rodgers 2004-12-18 0:19 ` Richard Stallman 2004-12-17 0:53 ` Richard Stallman
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git 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).