From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs 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 Message-ID: <87k2gthbuh.fsf@users.sourceforge.net> References: <87hbsxgjfe.fsf@stupidchicken.com> <8737nlc4td.fsf@users.sourceforge.net> <87mvlpheqw.fsf@users.sourceforge.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1468156705 32106 80.91.229.3 (10 Jul 2016 13:18:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jul 2016 13:18:25 +0000 (UTC) Cc: 4920@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 10 15:18:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bMEce-0001QC-Ny for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jul 2016 15:18:12 +0200 Original-Received: from localhost ([::1]:55145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMEcd-0007R9-Ti for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jul 2016 09:18:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMEcY-0007R2-6f for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 09:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMEcV-0000sP-0e for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 09:18:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMEcU-0000sG-Ry for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 09:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bMEcU-000568-IV for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2016 09:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jul 2016 13:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 4920 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 4920-submit@debbugs.gnu.org id=B4920.146815662519530 (code B ref 4920); Sun, 10 Jul 2016 13:18:02 +0000 Original-Received: (at 4920) by debbugs.gnu.org; 10 Jul 2016 13:17:05 +0000 Original-Received: from localhost ([127.0.0.1]:44685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMEbZ-00054w-DF for submit@debbugs.gnu.org; Sun, 10 Jul 2016 09:17:05 -0400 Original-Received: from mail-it0-f54.google.com ([209.85.214.54]:38152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMEbX-00054P-B3 for 4920@debbugs.gnu.org; Sun, 10 Jul 2016 09:17:04 -0400 Original-Received: by mail-it0-f54.google.com with SMTP id h190so43124390ith.1 for <4920@debbugs.gnu.org>; Sun, 10 Jul 2016 06:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Gt9J4M3FERouN0d2kgIUzEgOqndFf4HOJejY50JGjCI=; b=uDanJMiZrCIZ/WtIJR6hQrBXyR0Dz7yJRb683AeVSj8HXCyCqYbfY73EYirJThy0AW vUQqv0ahZimfx6zalDMHbXwsBms+AAuvB9kePnf4R24u8Bgqv6TkNTjuxvKA2mDNXebf Zvv8eFmsgGdCZXX8Lvqa5XcyIHYPaaetlNfIZAtotIBplnooqlmp2baIAe0g0FfD7XpP atTRETqcTtLZZ6bUE5HIDy0WCtUDc27sZCXIK1RER3hIrkEThLG6BbfaVoU10TvQsZab EA5McOClOcan5Hl/zWpzLl3CPEh3/F/HSGNwosdoJBEC05iXfv5T4GQNa2GpqzJ0BNXe ylog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Gt9J4M3FERouN0d2kgIUzEgOqndFf4HOJejY50JGjCI=; b=SAkiQt89HVeAUtF1BwCvD42UfFJb3vdqtKJrK2OprrLM8BWvf5gNA4YHkiwodW9YfG ACmfWzZ8dnxV/vJJWqszy4J1O1iBMXrkc530lmWxMMHmT0X6lw+x0NJpO5kSGFhNwxYY /iHuUBI8RmVzLKJwTMJin+AuQsCeG4eA3O1WzQs0LgGLDzo9E5d+m7nA3PZsR64cIrQD zpoBhtpiKFWuMopZmf8jYefvd53HbAOo8S9uxdMaHdWGA0pJGwuiKN7Cv0alAYiianE5 JdRVOlySW6VW8ClM7IzF8oa1JbCMP9WPqM1TXt92z+h51kROK7oJUPVF10zcHhgg9Iae 8SzQ== X-Gm-Message-State: ALyK8tKl2OR4bZzIsY7xQGRqS1xQTLYeqKzPgtiDQq8FiKxGKZZPmnamX+NRmoWxDcCAog== X-Received: by 10.36.14.76 with SMTP id 73mr10571269ite.70.1468156617578; Sun, 10 Jul 2016 06:16:57 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id 92sm1972573iok.22.2016.07.10.06.16.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2016 06:16:56 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 10 Jul 2016 08:38:59 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:120744 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Make-sh-mode-always-use-p-s-lookup-properties.patch Content-Description: patch >From 28e9ec947f1edf44947b50009b5f3fec23027f45 Mon Sep 17 00:00:00 2001 From: Noam Postavsky 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 --=-=-=--