unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
@ 2015-12-25 21:29 Michael Heerdegen
  2015-12-25 21:50 ` Dmitry Gutov
  2023-07-28  1:19 ` Michael Heerdegen
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Heerdegen @ 2015-12-25 21:29 UTC (permalink / raw)
  To: 22238


Hello,

isearch's symbol search (M-s _) doesn't find symbols as in

  ,@symbol

when searching for "symbol".  This was already the case in Emacs 24.5.

Regexp searching for "\_<" stops at the "@" char (not at the "s").  At
least, `isearch-forward-symbol' seems to behave as documented, dunno
about the "\_<" regexp.

Anyway, the behavior is not good.  People use to replace symbols with
isearch's symbol search when they have renamed a function or variable.
Missing occurrences can introduce bugs.


Thanks for your help,

Michael. 




In GNU Emacs 25.0.50.8 (x86_64-pc-linux-gnu, GTK+ Version 3.18.5)
 of 2015-12-23
Repository revision: 09053075225fec8a6cf7a72017a6dfc1ec6b6f0c
Windowing system distributor 'The X.Org Foundation', version 11.0.11703000
System Description:	Debian GNU/Linux testing (stretch)

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_ALL: de_DE.utf8
  value of $LC_COLLATE: C
  value of $LC_TIME: C
  value of $LANG: de_DE.utf8
  locale-coding-system: utf-8-unix






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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 21:29 bug#22238: 25.0.50; isearch symbol search can't find ,@symbol Michael Heerdegen
@ 2015-12-25 21:50 ` Dmitry Gutov
  2015-12-25 21:58   ` Michael Heerdegen
                     ` (2 more replies)
  2023-07-28  1:19 ` Michael Heerdegen
  1 sibling, 3 replies; 12+ messages in thread
From: Dmitry Gutov @ 2015-12-25 21:50 UTC (permalink / raw)
  To: Michael Heerdegen, 22238

On 12/25/2015 11:29 PM, Michael Heerdegen wrote:

> Regexp searching for "\_<" stops at the "@" char (not at the "s").  At
> least, `isearch-forward-symbol' seems to behave as documented, dunno
> about the "\_<" regexp.

I'm assuming this is about emacs-lisp-mode.

As you can see, this is not about isearch: re-search-forward behaves the 
same in this regard.

This seems to be a regression from the fix for 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17325.

Maybe that should just be reverted. A more proper fix would make Emacs 
not consider @ as a symbol constituent when it's the first character. 
The "p" in "_ p" apparently tries but fails to do that.





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 21:50 ` Dmitry Gutov
@ 2015-12-25 21:58   ` Michael Heerdegen
  2015-12-25 22:03     ` Dmitry Gutov
  2015-12-25 22:06   ` Andreas Schwab
  2016-12-05 13:55   ` Michael Heerdegen
  2 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2015-12-25 21:58 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 22238

Dmitry Gutov <dgutov@yandex.ru> writes:

> I'm assuming this is about emacs-lisp-mode.

I forgot to tell, but yes.

> This seems to be a regression from the fix for
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17325.
>
> Maybe that should just be reverted. A more proper fix would make Emacs
> not consider @ as a symbol constituent when it's the first
> character. The "p" in "_ p" apparently tries but fails to do that.

Can a similar problem appear with other programming modes/languages?


Thanks,

Michael.





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 21:58   ` Michael Heerdegen
@ 2015-12-25 22:03     ` Dmitry Gutov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Gutov @ 2015-12-25 22:03 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 22238

On 12/25/2015 11:58 PM, Michael Heerdegen wrote:

> Can a similar problem appear with other programming modes/languages?

A misconfigured syntax table can lead to this and other problems.






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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 21:50 ` Dmitry Gutov
  2015-12-25 21:58   ` Michael Heerdegen
@ 2015-12-25 22:06   ` Andreas Schwab
  2015-12-25 22:09     ` Dmitry Gutov
  2016-12-05 13:55   ` Michael Heerdegen
  2 siblings, 1 reply; 12+ messages in thread
From: Andreas Schwab @ 2015-12-25 22:06 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Michael Heerdegen, 22238

Dmitry Gutov <dgutov@yandex.ru> writes:

> Maybe that should just be reverted. A more proper fix would make Emacs not
> consider @ as a symbol constituent when it's the first character.

But @foo is a valid symbol.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 22:06   ` Andreas Schwab
@ 2015-12-25 22:09     ` Dmitry Gutov
  2015-12-26 10:54       ` Andreas Schwab
  0 siblings, 1 reply; 12+ messages in thread
From: Dmitry Gutov @ 2015-12-25 22:09 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Michael Heerdegen, 22238

On 12/26/2015 12:06 AM, Andreas Schwab wrote:

> But @foo is a valid symbol.

Indeed. If you like to implement the syntax-propertize-function that 
will distinguish between them, be my guest.

But it's more important to discern "symbol" in ,@symbol than support 
symbols with rare names like that.





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 22:09     ` Dmitry Gutov
@ 2015-12-26 10:54       ` Andreas Schwab
  2015-12-26 12:32         ` Dmitry Gutov
  0 siblings, 1 reply; 12+ messages in thread
From: Andreas Schwab @ 2015-12-26 10:54 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Michael Heerdegen, 22238

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 12/26/2015 12:06 AM, Andreas Schwab wrote:
>
>> But @foo is a valid symbol.
>
> Indeed. If you like to implement the syntax-propertize-function that will
> distinguish between them, be my guest.
>
> But it's more important to discern "symbol" in ,@symbol than support
> symbols with rare names like that.

Such symbols are used by Emacs, so they should be properly supported.
There is no point in supporting ,@foo but not @foo, since the method
will be the same.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-26 10:54       ` Andreas Schwab
@ 2015-12-26 12:32         ` Dmitry Gutov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Gutov @ 2015-12-26 12:32 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Michael Heerdegen, 22238

On 12/26/2015 12:54 PM, Andreas Schwab wrote:

> Such symbols are used by Emacs, so they should be properly supported.

Example?

> since the method
> will be the same.

Not at all. ,@foo is not a symbol. It's unquote-splicing followed by 
symbol foo.





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 21:50 ` Dmitry Gutov
  2015-12-25 21:58   ` Michael Heerdegen
  2015-12-25 22:06   ` Andreas Schwab
@ 2016-12-05 13:55   ` Michael Heerdegen
  2 siblings, 0 replies; 12+ messages in thread
From: Michael Heerdegen @ 2016-12-05 13:55 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 22238

Dmitry Gutov <dgutov@yandex.ru> writes:

> Maybe that should just be reverted. A more proper fix would make Emacs
> not consider @ as a symbol constituent when it's the first
> character. The "p" in "_ p" apparently tries but fails to do that.

FWIW, there is a similar problem concerning the end of the symbol and
".".

The real-life use case is that I wanted to rename the argument of a
function like this:

(defun el-search--string-matcher (eregexp)
  "Return a compiled match predicate for EREGEXP.
That's a predicate returning non-nil when extended regexp EREGEXP ...

with isearch in symbol mode.  But symbol search doesn't find the
occurrence of "EREGEXP" at the end of the first sentence of the
docstring.  Again, strictly speaking the behavior is as documented I
think ("."  is a symbol constituent), but this also again foils the
purpose of symbol matching in "real-life".  And again, the situation can
be ambiguous in rare cases.


Michael.





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2015-12-25 21:29 bug#22238: 25.0.50; isearch symbol search can't find ,@symbol Michael Heerdegen
  2015-12-25 21:50 ` Dmitry Gutov
@ 2023-07-28  1:19 ` Michael Heerdegen
  2023-07-28  8:05   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2023-07-28  1:19 UTC (permalink / raw)
  To: 22238-done

Michael Heerdegen <michael_heerdegen@web.de> writes:

> isearch's symbol search (M-s _) doesn't find symbols as in
>
>   ,@symbol
>
> when searching for "symbol".  This was already the case in Emacs 24.5.

Checking this again and: this seems to be fixed.  Closing.

Not sure about the obscure case involving a symbol @foo as mentioned by
Andreas, but searching for such a symbol works using symbol isearch, and
,@foo is read as (,@ foo) by the Lisp reader, not as (, @foo), and
isearch doesn't need to match a symbol @foo here, so I guess everything
works at least relatively well.

Michael.





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2023-07-28  1:19 ` Michael Heerdegen
@ 2023-07-28  8:05   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-29  2:21     ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-28  8:05 UTC (permalink / raw)
  To: 22238; +Cc: michael_heerdegen

severity 22238 minor
merge 22238 44418
quit

[ Is there a pattern in the bug numbers? 🤔 ]

Michael Heerdegen [2023-07-28 03:19 +0200] wrote:
> Michael Heerdegen <michael_heerdegen@web.de> writes:
>> isearch's symbol search (M-s _) doesn't find symbols as in
>>   ,@symbol
>> when searching for "symbol".  This was already the case in Emacs 24.5.
> Checking this again and: this seems to be fixed.  Closing.

Ah, I didn't find this report before submitting the duplicate
https://bugs.gnu.org/44418 (although I claimed to find the behaviour in
Emacs 24.5 as well).

Let's see if merging works without the need for excessive force...

Thanks,
-- 
Basil





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

* bug#22238: 25.0.50; isearch symbol search can't find ,@symbol
  2023-07-28  8:05   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-29  2:21     ` Michael Heerdegen
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Heerdegen @ 2023-07-29  2:21 UTC (permalink / raw)
  To: 22238; +Cc: contovob

"Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army
knife of text editors" <bug-gnu-emacs@gnu.org> writes:

> > Checking this again and: this seems to be fixed.  Closing.
>
> Ah, I didn't find this report before submitting the duplicate
> https://bugs.gnu.org/44418 (although I claimed to find the behaviour
> in Emacs 24.5 as well).

Oh, and I didn't find the other report although I was sure that I had
read some discussion about this issue during vacations (if I only had
known about the secret pattern...).  Thanks for joining.

> Let's see if merging works without the need for excessive force...

The result looks ok to me.

Thx,

Michael.





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

end of thread, other threads:[~2023-07-29  2:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-25 21:29 bug#22238: 25.0.50; isearch symbol search can't find ,@symbol Michael Heerdegen
2015-12-25 21:50 ` Dmitry Gutov
2015-12-25 21:58   ` Michael Heerdegen
2015-12-25 22:03     ` Dmitry Gutov
2015-12-25 22:06   ` Andreas Schwab
2015-12-25 22:09     ` Dmitry Gutov
2015-12-26 10:54       ` Andreas Schwab
2015-12-26 12:32         ` Dmitry Gutov
2016-12-05 13:55   ` Michael Heerdegen
2023-07-28  1:19 ` Michael Heerdegen
2023-07-28  8:05   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-29  2:21     ` Michael Heerdegen

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