From: npostavs@users.sourceforge.net
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 4920@debbugs.gnu.org, Chong Yidong <cyd@stupidchicken.com>,
Jeremy Hall <jeremy.hall@bakbone.com>
Subject: bug#4920: 23.1; (check-parens) problem with bash script case items unbalanced close paren
Date: Thu, 07 Jul 2016 21:10:54 -0400 [thread overview]
Message-ID: <8737nlc4td.fsf@users.sourceforge.net> (raw)
In-Reply-To: <jwvd43ldlmh.fsf-monnier+emacsbugreports@gnu.org> (Stefan Monnier's message of "Sat, 14 Nov 2009 13:11:10 -0500")
tags 4920 patch
quit
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> Running (check-parens) fails on a bash script with case statements in
>>> because of the unmatched close ")". Would it be possible to fix this,
>>> or tell me how to work around it?
>> I can't reproduce this: `M-x check-parens RET' on the following file
>> signals no error. Please provice a more detailed bug report.
>
>> #!/bin/sh
>
>> case "$SYSNAME" in
>> Darwin)
>> ;;
>> Linux)
>
> Those parentheses get a syntax-table property applied by
> font-lock-syntactic-keywords, which means that the behavior will be
> (hopefully) correct for the visible part of the text, and maybe for all
> the text before that, but not necessarily for the text after
> window-end.
Right, seems to easily reproducible with
echo '#!/bin/sh' > bug-4920-check-parens.sh
seq -f '# etc %.0f' 1000 >> bug-4920-check-parens.sh
cat >>bug-4920-check-parens.sh <<EOF
case "$SYSNAME" in
Darwin)
# ssss
;;
Linux)
EOF
emacs -Q bug-4920-check-parens.sh -f check-parens
And easily fixable by adding a syntax-propertize call at the beginning
of check-parens:
diff --git i/lisp/emacs-lisp/lisp.el w/lisp/emacs-lisp/lisp.el
index ea7cce6..9786429 100644
--- i/lisp/emacs-lisp/lisp.el
+++ w/lisp/emacs-lisp/lisp.el
@@ -719,2 +719,3 @@ check-parens
(interactive)
+ (syntax-propertize (point-max))
(condition-case data
next prev parent reply other threads:[~2016-07-08 1:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-14 16:28 bug#4920: 23.1; (check-parens) problem with bash script case items unbalanced close paren Chong Yidong
2009-11-14 18:11 ` Stefan Monnier
2009-11-16 12:25 ` Jeremy Hall
2016-07-08 1:10 ` npostavs [this message]
2016-07-10 0:11 ` Stefan Monnier
2016-07-10 0:39 ` Noam Postavsky
2016-07-10 2:11 ` Stefan Monnier
2016-07-10 12:14 ` npostavs
2016-07-10 12:38 ` Stefan Monnier
2016-07-10 13:16 ` npostavs
2016-07-10 14:20 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2009-11-13 16:14 Jeremy Hall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8737nlc4td.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=4920@debbugs.gnu.org \
--cc=cyd@stupidchicken.com \
--cc=jeremy.hall@bakbone.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).