GNU bug report logs - #33940
27.0.50; ?\^c syntax confuses scanning

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Tue, 1 Jan 2019 02:59:02 UTC

Severity: normal

Found in version 27.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33940 in the body.
You can then email your comments to 33940 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33940; Package emacs. (Tue, 01 Jan 2019 02:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 01 Jan 2019 02:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: 27.0.50; ?\^c syntax confuses scanning
Date: Tue, 01 Jan 2019 03:58:35 +0100
Hello,

in 20b858ef13f8f71fae6cbce5cdac31c4dd130600 "Prefer \... to control
chars in .el literals" woman.el has been changed to contain reader
syntaxes like "?\^]" - which apparently confuses `scan-sexps', e.g.

(scan-sexps (point-min) (point-max))
|- (scan-error "Containing expression ends prematurely" 81997 81998)

Obviously `scan-sexps' doesn't handle this kind of syntax correctly.

This confuses paren highlighting, by-sexp and by-list movement, prevents
enabling paredit mode, and such unpleasant things.

(CC'ing the author of the commit, Paul Eggert)

Thanks and regards,

Michael.



In GNU Emacs 27.0.50 (build 22, x86_64-pc-linux-gnu, GTK+ Version 3.24.2)
 of 2018-12-31 built on drachen
Repository revision: 174d64d4cefb3c49e260a2eb3d9015b0f092f922
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33940; Package emacs. (Tue, 01 Jan 2019 03:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 33940 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 33940 <at> debbugs.gnu.org
Subject: Re: 27.0.50; ?\^c syntax confuses scanning
Date: Mon, 31 Dec 2018 19:58:13 -0800
Michael Heerdegen wrote:
> in 20b858ef13f8f71fae6cbce5cdac31c4dd130600 "Prefer \... to control
> chars in .el literals" woman.el has been changed to contain reader
> syntaxes like "?\^]" - which apparently confuses `scan-sexps', e.g.
> 
> (scan-sexps (point-min) (point-max))
> |- (scan-error "Containing expression ends prematurely" 81997 81998)
> 
> Obviously `scan-sexps' doesn't handle this kind of syntax correctly.

The second argument to scan-sexps is a count, not position, so you might want to 
rethink that example.

Anyway, I'm not seeing any problems. I built the emacs-26 branch and ran the 
shell command:

src/emacs -Q lisp/woman.el

and then typed:

M-: (scan-sexps (point-min) (point-max)) RET

and it returned nil, which is what I'd expect. Can you reproduce the problem 
with a simple, self-contained test case like that?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33940; Package emacs. (Tue, 01 Jan 2019 04:13:02 GMT) Full text and rfc822 format available.

Message #11 received at 33940 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 33940 <at> debbugs.gnu.org
Subject: Re: 27.0.50; ?\^c syntax confuses scanning
Date: Tue, 01 Jan 2019 05:12:31 +0100
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> The second argument to scan-sexps is a count, not position, so you
> might want to rethink that example.

Indeed, thanks.  But let's keep the example for now, since it provokes
the scan error.

> Anyway, I'm not seeing any problems. I built the emacs-26 branch and
> ran the shell command:
>
> src/emacs -Q lisp/woman.el
>
> and then typed:
>
> M-: (scan-sexps (point-min) (point-max)) RET
>
> and it returned nil, which is what I'd expect. Can you reproduce the
> problem with a simple, self-contained test case like that?

Yes, with exactly that recipe, but with emacs built from the master
branch, please.  Oh, and happy new year, if you not are still in the old
one.


Thanks,

Michael.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 01 Jan 2019 19:43:02 GMT) Full text and rfc822 format available.

Notification sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
bug acknowledged by developer. (Tue, 01 Jan 2019 19:43:02 GMT) Full text and rfc822 format available.

Message #16 received at 33940-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 33940-done <at> debbugs.gnu.org
Subject: Re: 27.0.50; ?\^c syntax confuses scanning
Date: Tue, 1 Jan 2019 11:42:43 -0800
[Message part 1 (text/plain, inline)]
Michael Heerdegen wrote:
> Yes, with exactly that recipe, but with emacs built from the master
> branch, please.  Oh, and happy new year, if you not are still in the old
> one.

The same for you! Thanks for pointing me in the right direction; I installed the 
attached patch.
[0001-Fix-woman.el-to-not-confuse-scan-sexps.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33940; Package emacs. (Wed, 02 Jan 2019 00:29:02 GMT) Full text and rfc822 format available.

Message #19 received at 33940 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 33940 <at> debbugs.gnu.org
Cc: eggert <at> cs.ucla.edu
Subject: Re: bug#33940: 27.0.50; ?\^c syntax confuses scanning
Date: Wed, 02 Jan 2019 01:28:14 +0100
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> Thanks for pointing me in the right direction; I installed the
> attached patch.

Great, thanks.

BTW, do you know whether the original "?\^]" is considered correct read
syntax?  Does the reader only accept it by accident, or should
`scan-sexps' also be able to handle it?

Anyway, probably a corner case that doesn't matter much.  Thanks for
your fix,


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33940; Package emacs. (Wed, 02 Jan 2019 00:49:02 GMT) Full text and rfc822 format available.

Message #22 received at 33940 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Michael Heerdegen <michael_heerdegen <at> web.de>, 33940 <at> debbugs.gnu.org
Subject: Re: bug#33940: 27.0.50; ?\^c syntax confuses scanning
Date: Tue, 1 Jan 2019 16:48:00 -0800
Michael Heerdegen wrote:
> BTW, do you know whether the original "?\^]" is considered correct read
> syntax?  Does the reader only accept it by accident, or should
> `scan-sexps' also be able to handle it?

Sorry, I don't know, so I played it safe.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33940; Package emacs. (Wed, 02 Jan 2019 09:50:01 GMT) Full text and rfc822 format available.

Message #25 received at 33940 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: eggert <at> cs.ucla.edu, 33940 <at> debbugs.gnu.org
Subject: Re: bug#33940: 27.0.50; ?\^c syntax confuses scanning
Date: Wed, 02 Jan 2019 10:49:54 +0100
On Jan 02 2019, Michael Heerdegen <michael_heerdegen <at> web.de> wrote:

> BTW, do you know whether the original "?\^]" is considered correct read
> syntax?  Does the reader only accept it by accident, or should
> `scan-sexps' also be able to handle it?

It's as valid as `?]', which has the same problem wrt scan-sexps.
That's why prin1-char adds redundant backslashes.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33940; Package emacs. (Wed, 02 Jan 2019 11:32:02 GMT) Full text and rfc822 format available.

Message #28 received at 33940 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: eggert <at> cs.ucla.edu, 33940 <at> debbugs.gnu.org
Subject: Re: bug#33940: 27.0.50; ?\^c syntax confuses scanning
Date: Wed, 02 Jan 2019 12:31:09 +0100
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> It's as valid as `?]', which has the same problem wrt scan-sexps.
> That's why prin1-char adds redundant backslashes.

Ok, thanks, so it's nothing new.

Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Jan 2019 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.