From: npostavs@users.sourceforge.net
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 4920@debbugs.gnu.org
Subject: bug#4920: 23.1; (check-parens) problem with bash script case items unbalanced close paren
Date: Sun, 10 Jul 2016 09:16:54 -0400 [thread overview]
Message-ID: <87k2gthbuh.fsf@users.sourceforge.net> (raw)
In-Reply-To: <jwv37nh8y7o.fsf-monnier+Inbox@gnu.org> (Stefan Monnier's message of "Sun, 10 Jul 2016 08:38:59 -0400")
[-- Attachment #1: Type: text/plain, Size: 654 bytes --]
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> emacs -Q bug-4920-check-parens.sh --eval '(setq parse-sexp-lookup-properties t)' -f check-parens
>
>> succeeds. Should this variable be set by sh-mode along with the other
>> syntax propertize settings?
>
> Oh, yes, please, and thanks,
So it was already being set by sh-set-shell, but in only in case
sh-use-smie is nil. Here is a patch to set it unconditionally. I think
it's safe to apply to emacs-25 since I see that
parse-sexp-lookup-properties does get set to t at some point anyway (by
font-lock-fontify-syntactic-keywords-region I guess?), so this just
makes it happen a bit earlier.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1215 bytes --]
From 28e9ec947f1edf44947b50009b5f3fec23027f45 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Thu, 7 Jul 2016 21:14:48 -0400
Subject: [PATCH v1] Make sh-mode always use p-s-lookup-properties
This lets functions which rely on syntax-propertize for parsing
work correctly even before font lock has a chance to run.
* lisp/progmodes/sh-script.el (sh-set-shell): Set
parse-sexp-lookup-properties unconditionally (Bug #4920).
---
lisp/progmodes/sh-script.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 10e56d0..5288734 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2430,8 +2430,8 @@ sh-set-shell
(funcall mksym "rules")
:forward-token (funcall mksym "forward-token")
:backward-token (funcall mksym "backward-token")))
+ (setq-local parse-sexp-lookup-properties t)
(unless sh-use-smie
- (setq-local parse-sexp-lookup-properties t)
(setq-local sh-kw-alist (sh-feature sh-kw))
(let ((regexp (sh-feature sh-kws-for-done)))
(if regexp
--
2.8.0
next prev parent reply other threads:[~2016-07-10 13:16 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
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 [this message]
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=87k2gthbuh.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=4920@debbugs.gnu.org \
--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).