all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Possible misleading example in `Incremental Search' Info node
@ 2016-08-04 12:25 Udyant Wig
  2016-08-04 13:56 ` Emanuel Berg
  2016-08-04 14:21 ` Drew Adams
  0 siblings, 2 replies; 4+ messages in thread
From: Udyant Wig @ 2016-08-04 12:25 UTC (permalink / raw)
  To: help-gnu-emacs

I was reading the _Incremental_Search_ Info node in the Emacs manual.
In "15.1.4 Special Input for Incremental Search", found via

    (info "(emacs)Special Isearch")

the second paragraph discusses "lax space matching", and its second and
third sentences read as follows in my version of Emacs:

    Hence, ‘foo bar’ matches ‘foo bar’, ‘foo bar’, ‘foo bar’, and so on
    (but not ‘foobar’).  More precisely, Emacs matches each sequence of
    space characters in the search string to a regular expression
    specified by the variable ‘search-whitespace-regexp’.

I have not modified the default value for `search-whitespace-regexp',
which, for me, is

    search-whitespace-regexp
    => "\\s-+"

From my understanding of that full paragraph, the following illustrates
the default behaviour.  Suppose that we have the text

foobar
foo bar
foo  bar
foo   bar

If point is at the first `f' of `foobar', and I start an incremental
search via C-s for `foo bar', then all three of `foo bar', `foo  bar',
and `foo   bar' are highlighted, the latter two using the
`lazy-highlight' face.

Were the three instances of `foo bar' in the Info node paragraph meant
to have an increasing number of spaces?  Does anyone else see this?

My Emacs version is:

(emacs-version)
=> "GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
    of 2015-03-08 on trouble, modified by Debian"

-- 
Udyant Wig


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

* Re: Possible misleading example in `Incremental Search' Info node
  2016-08-04 12:25 Possible misleading example in `Incremental Search' Info node Udyant Wig
@ 2016-08-04 13:56 ` Emanuel Berg
  2016-08-04 14:21 ` Drew Adams
  1 sibling, 0 replies; 4+ messages in thread
From: Emanuel Berg @ 2016-08-04 13:56 UTC (permalink / raw)
  To: help-gnu-emacs

Udyant Wig wrote:

> Hence, ‘foo bar’ matches ‘foo bar’, ‘foo
> bar’, ‘foo bar’, and so on (but not
> ‘foobar’). More precisely, Emacs matches each
> sequence of space characters in the search
> string to a regular expression specified by
> the variable ‘search-whitespace-regexp’.

All examples with foo and bar are lazy and
unpedagogical at best and incomprehensible
at worst.

Show this to 100 people in the street without
further explanations and ask them explain what
happens and then compile the outcome what came
up on top carrying thru:

    (concat "It takes two" " to tango.") ; -> "It takes two to tango."

    (concat "foo"          "bar")        ; -> "foobar"

Worst thing tho is people when they don't know
what to call a thing calls it "foo"! Then this
lingers on in the code! H-e-l-l-o? Even

    1) Think

    2) Call it the first thing you think of

is better than to call it "foo" because then no
matter how bad an outcome at least you got some
practise using that thing! (The kidney, I mean.)

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 64 Blogomatic articles -                   




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

* RE: Possible misleading example in `Incremental Search' Info node
  2016-08-04 12:25 Possible misleading example in `Incremental Search' Info node Udyant Wig
  2016-08-04 13:56 ` Emanuel Berg
@ 2016-08-04 14:21 ` Drew Adams
  2016-08-04 15:01   ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Drew Adams @ 2016-08-04 14:21 UTC (permalink / raw)
  To: Udyant Wig, help-gnu-emacs

> I was reading the _Incremental_Search_ Info node in the Emacs manual.
> In "15.1.4 Special Input for Incremental Search", found via
> 
>     (info "(emacs)Special Isearch")
> 
> the second paragraph discusses "lax space matching", and its second and
> third sentences read as follows in my version of Emacs:
> 
>     Hence, 'foo bar' matches 'foo bar', 'foo bar', 'foo bar', and so on
>     (but not 'foobar').  More precisely, Emacs matches each sequence of
>     space characters in the search string to a regular expression
>     specified by the variable 'search-whitespace-regexp'.
> 
> From my understanding of that full paragraph, the following illustrates
> the default behaviour.  Suppose that we have the text
> 
> foobar
> foo bar
> foo  bar
> foo   bar

Good catch.  I've reported that regression (using `M-x report-emacs-bug')
as bug #24151.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24151



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

* Re: Possible misleading example in `Incremental Search' Info node
  2016-08-04 14:21 ` Drew Adams
@ 2016-08-04 15:01   ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2016-08-04 15:01 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Thu, 4 Aug 2016 07:21:06 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> > I was reading the _Incremental_Search_ Info node in the Emacs manual.
> > In "15.1.4 Special Input for Incremental Search", found via
> > 
> >     (info "(emacs)Special Isearch")
> > 
> > the second paragraph discusses "lax space matching", and its second and
> > third sentences read as follows in my version of Emacs:
> > 
> >     Hence, 'foo bar' matches 'foo bar', 'foo bar', 'foo bar', and so on
> >     (but not 'foobar').  More precisely, Emacs matches each sequence of
> >     space characters in the search string to a regular expression
> >     specified by the variable 'search-whitespace-regexp'.
> > 
> > From my understanding of that full paragraph, the following illustrates
> > the default behaviour.  Suppose that we have the text
> > 
> > foobar
> > foo bar
> > foo  bar
> > foo   bar
> 
> Good catch.  I've reported that regression (using `M-x report-emacs-bug')
> as bug #24151.
> 
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24151

This was already reported some time ago and is fixed in the 25.1
release candidate.



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

end of thread, other threads:[~2016-08-04 15:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-04 12:25 Possible misleading example in `Incremental Search' Info node Udyant Wig
2016-08-04 13:56 ` Emanuel Berg
2016-08-04 14:21 ` Drew Adams
2016-08-04 15:01   ` Eli Zaretskii

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.