unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* "Match whole word only" "Match case"
@ 2005-03-12  0:20 Tak Ota
  2005-03-12  0:59 ` Miles Bader
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tak Ota @ 2005-03-12  0:20 UTC (permalink / raw)


Many word processors and text editors I know have explicit options to
opt for "Match case" and "Match whole word only" when searching and
replacing text strings.  These features are not so obvious under
emacs.  Though it is not a big deal for seasoned emacs users I cannot
imagine a novice user to discover and manipulate case-fold-search
variable or start using \b in regular expression search.  The need for
those feature is pretty basic and even a novice user may sometimes
want to use.  Do you think it is worth considering to have these
search options to be explicit choice from the Edit->Search and
Edit->Replace menu?

-Tak

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Match whole word only" "Match case"
  2005-03-12  0:20 "Match whole word only" "Match case" Tak Ota
@ 2005-03-12  0:59 ` Miles Bader
  2005-03-12 13:33   ` Stefan Monnier
  2005-03-12 22:15 ` Richard Stallman
  2005-03-13  2:05 ` Juri Linkov
  2 siblings, 1 reply; 7+ messages in thread
From: Miles Bader @ 2005-03-12  0:59 UTC (permalink / raw)
  Cc: emacs-devel

On Fri, 11 Mar 2005 16:20:56 -0800 (PST), Tak Ota
<Takaaki.Ota@am.sony.com> wrote:
> Many word processors and text editors I know have explicit options to
> opt for "Match case" and "Match whole word only" when searching and
> replacing text strings.

query-replace has a "words-only" mode if you use the C-u prefix.

Both searching and replacing automatically do case-matching if you use
any uppercase characters in the search string.  This is not sufficent
if you want to search/replace only _lowercase_ characters, and it
would be nice to have such an option, but I wonder if it could be
added without zillions of new commands?

-Miles
-- 
Do not taunt Happy Fun Ball.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Match whole word only" "Match case"
  2005-03-12  0:59 ` Miles Bader
@ 2005-03-12 13:33   ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2005-03-12 13:33 UTC (permalink / raw)
  Cc: emacs-devel, Tak Ota, miles

> Both searching and replacing automatically do case-matching if you use
> any uppercase characters in the search string.  This is not sufficent
> if you want to search/replace only _lowercase_ characters, and it
> would be nice to have such an option, but I wonder if it could be

C-s M-c foobar will only match lowercase `foobar'.


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Match whole word only" "Match case"
  2005-03-12  0:20 "Match whole word only" "Match case" Tak Ota
  2005-03-12  0:59 ` Miles Bader
@ 2005-03-12 22:15 ` Richard Stallman
  2005-03-14 18:28   ` Tak Ota
  2005-03-13  2:05 ` Juri Linkov
  2 siblings, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2005-03-12 22:15 UTC (permalink / raw)
  Cc: emacs-devel

      Do you think it is worth considering to have these
    search options to be explicit choice from the Edit->Search and
    Edit->Replace menu?

Let's not think about it now.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Match whole word only" "Match case"
  2005-03-12  0:20 "Match whole word only" "Match case" Tak Ota
  2005-03-12  0:59 ` Miles Bader
  2005-03-12 22:15 ` Richard Stallman
@ 2005-03-13  2:05 ` Juri Linkov
  2005-03-13  6:07   ` Miles Bader
  2 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2005-03-13  2:05 UTC (permalink / raw)
  Cc: emacs-devel

Tak Ota <Takaaki.Ota@am.sony.com> writes:
> Do you think it is worth considering to have these search options to
> be explicit choice from the Edit->Search and Edit->Replace menu?

There is already "Case-Insensitive Search" option in Options menu.
But putting "Word Search" option in Options menu is a possible source
of confusion: users might forget about it after turning it on, and later
wonder why normal search can't find a part of the word.  Also note that
word search and replace are not very useful.  In source code they often
don't work as intended.  What is more useful are not \b delimiters,
but \_< and \_> to match symbols instead of words.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Match whole word only" "Match case"
  2005-03-13  2:05 ` Juri Linkov
@ 2005-03-13  6:07   ` Miles Bader
  0 siblings, 0 replies; 7+ messages in thread
From: Miles Bader @ 2005-03-13  6:07 UTC (permalink / raw)
  Cc: Tak Ota, emacs-devel

On Sun, 13 Mar 2005 04:05:02 +0200, Juri Linkov <juri@jurta.org> wrote:
> Also note that
> word search and replace are not very useful.  In source code they often
> don't work as intended.  What is more useful are not \b delimiters,
> but \_< and \_> to match symbols instead of words.

Maybe in theory, but in practice I find that a simple
word-query-replace is quite useful in source code, as it's often
"close enough", and it's easier to type than the regexp version with
\_< etc.

-Miles
-- 
Do not taunt Happy Fun Ball.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Match whole word only" "Match case"
  2005-03-12 22:15 ` Richard Stallman
@ 2005-03-14 18:28   ` Tak Ota
  0 siblings, 0 replies; 7+ messages in thread
From: Tak Ota @ 2005-03-14 18:28 UTC (permalink / raw)
  Cc: emacs-devel

OK.  I'll bring it back later after the release.

-Tak

Sat, 12 Mar 2005 14:15:44 -0800: "Richard Stallman" <rms@gnu.org> wrote:

>       Do you think it is worth considering to have these
>     search options to be explicit choice from the Edit->Search and
>     Edit->Replace menu?
> 
> Let's not think about it now.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-03-14 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-12  0:20 "Match whole word only" "Match case" Tak Ota
2005-03-12  0:59 ` Miles Bader
2005-03-12 13:33   ` Stefan Monnier
2005-03-12 22:15 ` Richard Stallman
2005-03-14 18:28   ` Tak Ota
2005-03-13  2:05 ` Juri Linkov
2005-03-13  6:07   ` Miles Bader

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).