GNU bug report logs - #21871
Emacs Lisp Mode (at least): spurious parens in column 0 don't get bold red highlighting.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alan Mackenzie <acm@HIDDEN>; dated Tue, 10 Nov 2015 16:29:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Removed indication that bug 21871 blocks Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 2 Sep 2017 13:19:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 02 09:19:41 2017
Received: from localhost ([127.0.0.1]:41866 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1do8Kr-0004Vd-Ha
	for submit <at> debbugs.gnu.org; Sat, 02 Sep 2017 09:19:41 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43087)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1do8Kq-0004VO-Pf
 for 21871 <at> debbugs.gnu.org; Sat, 02 Sep 2017 09:19:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1do8Kg-0007td-Kc
 for 21871 <at> debbugs.gnu.org; Sat, 02 Sep 2017 09:19:35 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49247)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1do8KV-0007hN-Vd; Sat, 02 Sep 2017 09:19:20 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2148
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1do8KU-0007sh-8A; Sat, 02 Sep 2017 09:19:19 -0400
Date: Sat, 02 Sep 2017 16:19:02 +0300
Message-Id: <83fuc5z1a1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20160517090242.GA2250@HIDDEN> (message from Alan
 Mackenzie on Tue, 17 May 2016 09:02:42 +0000)
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0 don't get bold red highlighting.
References: <20151110163034.GH2626@HIDDEN>
 <20151112185424.38599.qmail@HIDDEN>
 <414b75b8-bb45-4640-4742-9f88b9ff5e75@HIDDEN>
 <20160516102002.GB2317@HIDDEN>
 <37a9ca07-1ffc-b872-4cf0-719f97177e35@HIDDEN>
 <20160517090242.GA2250@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 21871
Cc: 21871 <at> debbugs.gnu.org, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

unblock 24655 by 21871
thanks

> Date: Tue, 17 May 2016 09:02:42 +0000
> From: Alan Mackenzie <acm@HIDDEN>
> Cc: 21871 <at> debbugs.gnu.org
> 
> On Mon, May 16, 2016 at 04:18:54PM +0300, Dmitry Gutov wrote:
> > On 05/16/2016 01:20 PM, Alan Mackenzie wrote:
> 
> > > Note this convention is still active.
> 
> > The "convention" may be in place, but the underlying reasons for it  are 
> > much weaker these days.
> 
> The convention is still needed, in particular in CC Mode.  We tried to
> do without it for some time, and got complaints (from Martin Rudalics)
> about its speed.
> 
> > Any relevant operation can use syntax-ppss. 
> 
> No, it can't.  Anything which uses back_comment can't.  That includes
> scan-lists, backward-list, and so on, which are very widely used,
> including in beginning-of-defun.
> 
> Or are you proposing to rewrite vast swathes of Emacs, expunging all
> (backward) uses of scan-lists, etc.?
> 
> > >> We don't have to scan back to the beginning of the buffer, we can use
> > >> syntax-ppss (and it's more reliable with bug#16247 fixed).
> 
> > > Sorry, this isn't true.  The scanning back to BOB is done at the C
> > > level, in function back_comment.
> 
> > What I wrote is true: font-lock rules can use syntax-ppss, and often do.
> 
> Up to a point, you may be right.  Any time anybody uses
> beginning-of-defun, etc., this scanning from BOB may happen.
> 
> Also, syntax-ppss will deliver the wrong value if font-lock-syntax-table
> is non-nil and syntax-ppss is also used outside of font-lock.  This is
> (one of) the problems with syntax-ppss - it ploughs on blindly,
> regardless of changes to the syntax table, text-properties, etc.  But it
> sort of works most of the time.
> 
> > > syntax-ppss isn't suitable for use
> > > here (Stefan's view, not merely mine), because syntax-ppss doesn't react
> > > to changes in the syntax table, and suchlike.
> 
> > Here where?
> 
> In back_comment.
> 
> [ .... ]
> 
> > > The scanning back to BOB which is slow doesn't just happen in font
> > > lock; it can (and does) happen anywhere.
> 
> > Only in certain places, where the programmer didn't think to use the 
> > cache provided by syntax-ppss.
> 
> This is simply false.  See above.
> 
> > > It's just font lock's job to warn the user about this, so
> > > that she can correct it by adding in a backslash, for example.
> 
> > And it's the job of the programmer to avoid this problem altogether, 
> > which is not too hard.
> 
> This is also false.  People have been struggling with the problem for
> years, if not decades.
> 
> > > Things do get confused, for example see bug #22884, where there was an
> > > open paren in column zero in our own C sources.
> 
> > Even if bug#22884 is somewhat related, it's actually irrelevant is the 
> > current discussion because c-mode uses a non-default 
> > beginning-of-defun-function. Which means font-lock-compile-keywords 
> > won't add highlighting to 0-column parens in c-mode anyway.
> 
> Sadly true.  It ought to, though.  I can't see the connection between a
> major mode determining its own BOD, and whether or not it wants parens
> in column zero in strings and comments to get warning face.
> 
> > It seems the current code was designed with only Lisp modes in mind.
> 
> Not at all.  Read the manual.
> 
> > >> M-x beginning-of-defun does get confused, though. If *that* is problem
> > >> what we want to detect, .....
> 
> > > Not particularly.  We want the user to be warned about things
> > > potentially going wrong in back_comment, and anything which calls it.
> 
> > I don't see any reason to believe that the original author of this code 
> > was concerned with back_comment specifically.
> 
> No, with things which call it, including scan-lists, beginning-of-defun,
> etc.
> 
> > > No.  open-paren-in-column-0-is-defun-start is a variable that the user
> > > can change at any time.
> 
> > I don't think it is, or should be, true. The major mode knows better 
> > whether it can know where a defun starts, or not.
> 
> open-paren-in-... is a customisable option.  It is up to the user
> whether she wants the speed of o-p-i-c-0-i-d-s set at t, or the accuracy
> of it set at nil.
> 
> > E.g. js-mode and elisp-byte-code-mode set it to nil. If the user changes 
> > that value in one of these modes, nothing good will happen.
> 
> Set it to nil or bind it to nil?  This may be a misuse of the variable
> by these modes.

More than a year later, it doesn't sound like this is bothering anyone
else, and Stefan still didn't chime in to tell what he thinks.  So I'm
removing the Emacs 26.1 blocking status from this bug.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.
Added indication that bug 21871 blocks24655 Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Removed indication that bug 21871 blocks Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added indication that bug 21871 blocks21966 Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Removed indication that bug 21871 blocks Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 17 May 2016 09:02:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 17 05:02:48 2016
Received: from localhost ([127.0.0.1]:54690 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1b2ats-0004iy-2b
	for submit <at> debbugs.gnu.org; Tue, 17 May 2016 05:02:48 -0400
Received: from mail.muc.de ([193.149.48.3]:41953)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1b2atq-0004iq-1p
 for 21871 <at> debbugs.gnu.org; Tue, 17 May 2016 05:02:46 -0400
Received: (qmail 56925 invoked by uid 3782); 17 May 2016 09:02:44 -0000
Received: from acm.muc.de (p548C7AFA.dip0.t-ipconnect.de [84.140.122.250]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 17 May 2016 11:02:43 +0200
Received: (qmail 5271 invoked by uid 1000); 17 May 2016 09:02:42 -0000
Date: Tue, 17 May 2016 09:02:42 +0000
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0 don't get bold red highlighting.
Message-ID: <20160517090242.GA2250@HIDDEN>
References: <20151110163034.GH2626@HIDDEN>
 <20151112185424.38599.qmail@HIDDEN>
 <414b75b8-bb45-4640-4742-9f88b9ff5e75@HIDDEN>
 <20160516102002.GB2317@HIDDEN>
 <37a9ca07-1ffc-b872-4cf0-719f97177e35@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <37a9ca07-1ffc-b872-4cf0-719f97177e35@HIDDEN>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: 21871
Cc: 21871 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

Hello, Dmitry.

On Mon, May 16, 2016 at 04:18:54PM +0300, Dmitry Gutov wrote:
> On 05/16/2016 01:20 PM, Alan Mackenzie wrote:

> > Note this convention is still active.

> The "convention" may be in place, but the underlying reasons for it  are 
> much weaker these days.

The convention is still needed, in particular in CC Mode.  We tried to
do without it for some time, and got complaints (from Martin Rudalics)
about its speed.

> Any relevant operation can use syntax-ppss. 

No, it can't.  Anything which uses back_comment can't.  That includes
scan-lists, backward-list, and so on, which are very widely used,
including in beginning-of-defun.

Or are you proposing to rewrite vast swathes of Emacs, expunging all
(backward) uses of scan-lists, etc.?

> >> We don't have to scan back to the beginning of the buffer, we can use
> >> syntax-ppss (and it's more reliable with bug#16247 fixed).

> > Sorry, this isn't true.  The scanning back to BOB is done at the C
> > level, in function back_comment.

> What I wrote is true: font-lock rules can use syntax-ppss, and often do.

Up to a point, you may be right.  Any time anybody uses
beginning-of-defun, etc., this scanning from BOB may happen.

Also, syntax-ppss will deliver the wrong value if font-lock-syntax-table
is non-nil and syntax-ppss is also used outside of font-lock.  This is
(one of) the problems with syntax-ppss - it ploughs on blindly,
regardless of changes to the syntax table, text-properties, etc.  But it
sort of works most of the time.

> > syntax-ppss isn't suitable for use
> > here (Stefan's view, not merely mine), because syntax-ppss doesn't react
> > to changes in the syntax table, and suchlike.

> Here where?

In back_comment.

[ .... ]

> > The scanning back to BOB which is slow doesn't just happen in font
> > lock; it can (and does) happen anywhere.

> Only in certain places, where the programmer didn't think to use the 
> cache provided by syntax-ppss.

This is simply false.  See above.

> > It's just font lock's job to warn the user about this, so
> > that she can correct it by adding in a backslash, for example.

> And it's the job of the programmer to avoid this problem altogether, 
> which is not too hard.

This is also false.  People have been struggling with the problem for
years, if not decades.

> > Things do get confused, for example see bug #22884, where there was an
> > open paren in column zero in our own C sources.

> Even if bug#22884 is somewhat related, it's actually irrelevant is the 
> current discussion because c-mode uses a non-default 
> beginning-of-defun-function. Which means font-lock-compile-keywords 
> won't add highlighting to 0-column parens in c-mode anyway.

Sadly true.  It ought to, though.  I can't see the connection between a
major mode determining its own BOD, and whether or not it wants parens
in column zero in strings and comments to get warning face.

> It seems the current code was designed with only Lisp modes in mind.

Not at all.  Read the manual.

> >> M-x beginning-of-defun does get confused, though. If *that* is problem
> >> what we want to detect, .....

> > Not particularly.  We want the user to be warned about things
> > potentially going wrong in back_comment, and anything which calls it.

> I don't see any reason to believe that the original author of this code 
> was concerned with back_comment specifically.

No, with things which call it, including scan-lists, beginning-of-defun,
etc.

> > No.  open-paren-in-column-0-is-defun-start is a variable that the user
> > can change at any time.

> I don't think it is, or should be, true. The major mode knows better 
> whether it can know where a defun starts, or not.

open-paren-in-... is a customisable option.  It is up to the user
whether she wants the speed of o-p-i-c-0-i-d-s set at t, or the accuracy
of it set at nil.

> E.g. js-mode and elisp-byte-code-mode set it to nil. If the user changes 
> that value in one of these modes, nothing good will happen.

Set it to nil or bind it to nil?  This may be a misuse of the variable
by these modes.

> > We can't make our font-locking dependent upon
> > what its value was at some time in the past.  If open-paren-... belongs
> > anywhere, it's in the form just beyond the end of your patch's text.

> I don't think so. I don't mind taking its comparison out altogether, but 
> then the predicate will become very simple.

Again, do you understand that comparison, and why all the components of
that `and' form are there?

> > Do you understand the consequences of taking out the check on
> > syntax-begin-function?  (I certainly don't.)  It would be good if Stefan
> > could express a view, here.

> Point is, there is no way to simply alter the check that it would accept 
> the current situation with syntax-begin-function, but still keep it 
> meaningful. If we accept the value nil (which it is emacs-lisp-mode 
> now), we should accept any syntax-begin-function, I think.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 May 2016 17:43:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 16 13:43:05 2016
Received: from localhost ([127.0.0.1]:54172 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1b2MXp-0007by-JX
	for submit <at> debbugs.gnu.org; Mon, 16 May 2016 13:43:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37146)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andreas.roehler@HIDDEN>) id 1b2MXo-0007bT-Bb
 for submit <at> debbugs.gnu.org; Mon, 16 May 2016 13:43:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1b2MXi-00048f-Hn
 for submit <at> debbugs.gnu.org; Mon, 16 May 2016 13:42:59 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39685)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1b2MXi-000483-FK
 for submit <at> debbugs.gnu.org; Mon, 16 May 2016 13:42:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56308)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1b2MXg-0004Yc-7r
 for bug-gnu-emacs@HIDDEN; Mon, 16 May 2016 13:42:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1b2MXc-000475-DB
 for bug-gnu-emacs@HIDDEN; Mon, 16 May 2016 13:42:55 -0400
Received: from mout.kundenserver.de ([212.227.17.13]:51148)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <andreas.roehler@HIDDEN>) id 1b2MXc-00046x-2L
 for bug-gnu-emacs@HIDDEN; Mon, 16 May 2016 13:42:52 -0400
Received: from [192.168.178.35] ([77.12.90.221]) by mrelayeu.kundenserver.de
 (mreue104) with ESMTPSA (Nemesis) id 0Lmufk-1bVqoV3YLM-00h2k4 for
 <bug-gnu-emacs@HIDDEN>; Mon, 16 May 2016 16:57:35 +0200
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0 don't get bold red highlighting.
To: bug-gnu-emacs@HIDDEN
References: <20151110163034.GH2626@HIDDEN>
 <20151112185424.38599.qmail@HIDDEN>
 <414b75b8-bb45-4640-4742-9f88b9ff5e75@HIDDEN>
 <20160516102002.GB2317@HIDDEN>
 <37a9ca07-1ffc-b872-4cf0-719f97177e35@HIDDEN>
From: =?UTF-8?Q?Andreas_R=c3=b6hler?= <andreas.roehler@HIDDEN>
Message-ID: <5739E09F.7020009@HIDDEN>
Date: Mon, 16 May 2016 17:00:47 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101
 Icedove/38.7.0
MIME-Version: 1.0
In-Reply-To: <37a9ca07-1ffc-b872-4cf0-719f97177e35@HIDDEN>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:612XdDr0yX4lnHXVvm4QYl5iL0Z+BXq/rYWpjayyA1JKQDw3KGg
 FZJj3PYEO1vzMp9YYwPBZ5029jiuhiajhjiA8bUspZBuIQkzFu4/geXqd9mKE2V3HSw4b1d
 EDMauxl6nIO8OCSc6H4ZI7CD6tP9leabshW4t8QtMWki/wgTKIwcNufbzeHh1kmdNDm21zP
 N5aF0c+0rFKB43roomzvA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:BHzrN1+6sKw=:eq+Zva9bJqfZs7w7A0b40O
 rXalBDJ454FhIMKBbUJrGjGGeAGnihg/sGFPoEmqw7SL4sMTJHvoRbcYU2xr3uPyKtIF/kLqv
 pdrrPixwRLIQKp730/7w3x7F9KswLPHGD5g5kj/PXwFCzsfgST5kOusI1vlkSC5l0w9OhPrVX
 Y9aL92G1p+x61lWRbC7CA9Hn7i6N7+QIu10X36Vnh0rvd5hS89ea0RLsVg+WsTmB4kF0HFMaQ
 N/7d4J4Ipk6pwaKZJE4ECF6uyVTwQ9LcStRGaprgoXTgkjjR/XPD2ZM0trwjtomB66rtOCGz1
 g7+K4XQ0HPJMYRRevFztNCHk/mUEO1Bg/yAZ28mknyIurnWrFvgyMIWJ8cVCvO7nxcjuYdUoB
 jtZZL5Xn3n8249/zodTm3VDaQTR+Dx9hUCWBtlumu532WRkIYuuyvq3GmxlMWCXSoKqQHwx/+
 /75I7FUPdatQn+h98KIXowTI4/jbIsIx8Hqi2o/GoddbAndKZmhbDIb/FzQRRNmAZt7VF+mpM
 PEtJccSR+LdAHgjERZduztzWMhEl4uPXyYsvqXeQy3e5uKCbVhzC+dyImmZm6EttB5CMzyKTi
 20r6pJX8PXPelRI/WyRg+FCriEqgh3BMNXhHj7rNcFNKpcfHLISIhJmGi3nGXgLH/RJ5CJsr1
 RXpXN3P/S0BZKAW7nWGZ5zlhU3jRUWFvwwbV95FR89Ya3HV2MJXch61Uw8BB0pSRx8TxTUR0b
 rVwtMn3+8WNvQyvy
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)



On 16.05.2016 15:18, Dmitry Gutov wrote:
> On 05/16/2016 01:20 PM, Alan Mackenzie wrote:
>
>> No.  open-paren-in-column-0-is-defun-start is a variable that the user
>> can change at any time.
>
> I don't think it is, or should be, true. The major mode knows better 
> whether it can know where a defun starts, or not.
>

This open-paren-in-column-0-is-defun-start introduces exercises how to 
jump with crossed legs.
There are some astonishing jumpers around, I see. From the state of art 
of programming it's just a shame.

Emacs will always buggy cherishing such crap.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 16 May 2016 17:32:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 16 13:32:07 2016
Received: from localhost ([127.0.0.1]:54137 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1b2MND-0007Kf-AP
	for submit <at> debbugs.gnu.org; Mon, 16 May 2016 13:32:07 -0400
Received: from mail.muc.de ([193.149.48.3]:55646)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1b2MNC-0007Hk-1J
 for 21871 <at> debbugs.gnu.org; Mon, 16 May 2016 13:32:06 -0400
Received: (qmail 10532 invoked by uid 3782); 16 May 2016 10:20:03 -0000
Received: from acm.muc.de (p548C61A4.dip0.t-ipconnect.de [84.140.97.164]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Mon, 16 May 2016 12:20:03 +0200
Received: (qmail 17390 invoked by uid 1000); 16 May 2016 10:20:02 -0000
Date: Mon, 16 May 2016 10:20:02 +0000
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0 don't get bold red highlighting.
Message-ID: <20160516102002.GB2317@HIDDEN>
References: <20151110163034.GH2626@HIDDEN>
 <20151112185424.38599.qmail@HIDDEN>
 <414b75b8-bb45-4640-4742-9f88b9ff5e75@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <414b75b8-bb45-4640-4742-9f88b9ff5e75@HIDDEN>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: 21871
Cc: 21871 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

Hello, Dmitry.

On Mon, May 16, 2016 at 12:50:54AM +0300, Dmitry Gutov wrote:
> On 11/12/2015 08:54 PM, Alan Mackenzie wrote:

> > The fix to bug #16247 meant no longer setting syntax-begin-function to a
> > non-nil value.  This is the condition which used to cause the appropriate
> > font-lock-keywords form to get added to lisp-font-lock-keywords-1/2.  It
> > no longer is.

> Looking into this, I'm not sure we still want to highlight them. The 
> aforementioned bug, now fixed, mirrored the justifications that we give 
> in the manual and the comments for the highlighting of parens in the 0th 
> column:

> "The convention speeds up many Emacs operations, which would otherwise 
> have to scan back to the beginning of the buffer to analyze the syntax 
> of the code."

Note this convention is still active.

> and

> ;; Try to detect when a string or comment contains something that
> ;; looks like a defun and would thus confuse font-lock.

> We don't have to scan back to the beginning of the buffer, we can use 
> syntax-ppss (and it's more reliable with bug#16247 fixed).

Sorry, this isn't true.  The scanning back to BOB is done at the C
level, in function back_comment.  syntax-ppss isn't suitable for use
here (Stefan's view, not merely mine), because syntax-ppss doesn't react
to changes in the syntax table, and suchlike.

> font-lock doesn't get confused by something looking like a defun inside 
> a docstring (try it; I wasn't able to get it highlight something wrong).

You might be getting confused, here.  The scanning back to BOB which is
slow doesn't just happen in font lock; it can (and does) happen
anywhere.  It's just font lock's job to warn the user about this, so
that she can correct it by adding in a backslash, for example.

Things do get confused, for example see bug #22884, where there was an
open paren in column zero in our own C sources.

> M-x beginning-of-defun does get confused, though. If *that* is problem 
> what we want to detect, .....

Not particularly.  We want the user to be warned about things
potentially going wrong in back_comment, and anything which calls it.
The problem we want to fix is the lack of font-lock-warning-face on
these parens in column 0.  Anything beyond that is not for Emacs 25.1.

> .... I think the patch should look like this:

> diff --git a/lisp/font-lock.el b/lisp/font-lock.el
> index 8ee9f69..eed2766 100644
> --- a/lisp/font-lock.el
> +++ b/lisp/font-lock.el
> @@ -1786,13 +1786,10 @@ font-lock-compile-keywords
>   	  (cons t (cons keywords
>   			(mapcar #'font-lock-compile-keyword keywords))))
>       (if (and (not syntactic-keywords)
> -	     (let ((beg-function syntax-begin-function))
> -	       (or (eq beg-function 'beginning-of-defun)
> -                   (if (symbolp beg-function)
> -                       (get beg-function 'font-lock-syntax-paren-check))))
> -	     (not beginning-of-defun-function))
> +             (not beginning-of-defun-function)
> +             open-paren-in-column-0-is-defun-start)

No.  open-paren-in-column-0-is-defun-start is a variable that the user
can change at any time.  We can't make our font-locking dependent upon
what its value was at some time in the past.  If open-paren-... belongs
anywhere, it's in the form just beyond the end of your patch's text.

Do you understand the consequences of taking out the check on
syntax-begin-function?  (I certainly don't.)  It would be good if Stefan
could express a view, here.

>   	;; Try to detect when a string or comment contains something that
> -	;; looks like a defun and would thus confuse font-lock.
> +	;; looks like a defun and would thus confuse beginning-of-defun.

Also no.  It's more general than that.  I think "would thus confuse
Emacs" would be more accurate.

>   	(nconc keywords
>   	       `((,(if defun-prompt-regexp
>   		       (concat "^\\(?:" defun-prompt-regexp "\\)?\\s(")

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 16 May 2016 13:19:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 16 09:19:04 2016
Received: from localhost ([127.0.0.1]:53384 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1b2IQK-0004BG-DQ
	for submit <at> debbugs.gnu.org; Mon, 16 May 2016 09:19:04 -0400
Received: from mail-wm0-f43.google.com ([74.125.82.43]:38899)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1b2IQI-0004Ak-I7
 for 21871 <at> debbugs.gnu.org; Mon, 16 May 2016 09:19:02 -0400
Received: by mail-wm0-f43.google.com with SMTP id g17so135703306wme.1
 for <21871 <at> debbugs.gnu.org>; Mon, 16 May 2016 06:19:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:subject:to:references:cc:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=FFWN9N/blOPaybWjsKhJymDsSaHU5iqYVTDg7YPfTwc=;
 b=dBAgxXksVDBN9xeMXLV5kIwZ2ZWDSATWvmnWjQsUIFJ/32/6RYYcrROaydptGBBgOA
 GYq7nn0IhDrGVRvyNpmfvaELOIUMWeC8YbNr+L1pF0RZ8AxY8jf1f+T0EHgu+vVsX+tB
 Pru0ZAc4S6s9niOhVV/PX7tj2u1BbBWGBDqBtcfS27zJ45iiYxHJpZy0AH+a8Wu2MmJg
 zlLj7emjsn2jt14A8w+FC6zLPT++sdlqL3b1McIBQ1Wqs9YIp3/0naJNVi4PnLMIORS5
 E/WDwqDIoO+wIfyNaBL8uMQfXeIAjuXucVm1yCB/f36JbjXKOJpdyzYq80sFZJsw4Hhj
 2swg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:subject:to:references:cc:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=FFWN9N/blOPaybWjsKhJymDsSaHU5iqYVTDg7YPfTwc=;
 b=QP2TjjQfoi/cmAlSvhfWBYBlsfpRov8t1Ej9NtFvF2hXjxTD0tdryYVga8VwNRGVhL
 xDt2NPPhZmWWxqNbGcxw6bDNqvyvQeMFZR3jayWT+pdPVld1LU6Z00QpRpWytp6IS/PD
 xIg1DCvZE61T+vq/gAMHRR8ANWsZubdAK3A6smELsPCo86G8vHsZm7JRyfajB8WYlPi4
 R07gSbO3jUvW6g6bdy7VWo+dWOcGCagdnGLmlcoHCchiMabGgyznrP2UDcj2++0Tzlts
 RLjFBYV70MlXMk+cisJctp4qGLkvHx6FsWIulnQf7HENonzuXlkcc/nwrfqnHlWxk9q9
 QRRQ==
X-Gm-Message-State: AOPr4FUZ8h9fhFCKXTc7ofaMrgxnUs3XqVwhGaIXMUZrhLjdGJcY2/R6hfpsrM9Qe8gJYA==
X-Received: by 10.28.27.17 with SMTP id b17mr17693209wmb.19.1463404736887;
 Mon, 16 May 2016 06:18:56 -0700 (PDT)
Received: from [192.168.0.185] (static-nbl2-118.cytanet.com.cy.
 [212.31.107.118])
 by smtp.googlemail.com with ESMTPSA id xz3sm16423482wjb.10.2016.05.16.06.18.55
 (version=TLSv1/SSLv3 cipher=OTHER);
 Mon, 16 May 2016 06:18:56 -0700 (PDT)
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0 don't get bold red highlighting.
To: Alan Mackenzie <acm@HIDDEN>
References: <20151110163034.GH2626@HIDDEN>
 <20151112185424.38599.qmail@HIDDEN>
 <414b75b8-bb45-4640-4742-9f88b9ff5e75@HIDDEN>
 <20160516102002.GB2317@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <37a9ca07-1ffc-b872-4cf0-719f97177e35@HIDDEN>
Date: Mon, 16 May 2016 16:18:54 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.1
MIME-Version: 1.0
In-Reply-To: <20160516102002.GB2317@HIDDEN>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.5 (/)
X-Debbugs-Envelope-To: 21871
Cc: 21871 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 05/16/2016 01:20 PM, Alan Mackenzie wrote:

> Note this convention is still active.

The "convention" may be in place, but the underlying reasons for it  are 
much weaker these days. Any relevant operation can use syntax-ppss.

>> We don't have to scan back to the beginning of the buffer, we can use
>> syntax-ppss (and it's more reliable with bug#16247 fixed).
>
> Sorry, this isn't true.  The scanning back to BOB is done at the C
> level, in function back_comment.

What I wrote is true: font-lock rules can use syntax-ppss, and often do.

> syntax-ppss isn't suitable for use
> here (Stefan's view, not merely mine), because syntax-ppss doesn't react
> to changes in the syntax table, and suchlike.

Here where?

>> font-lock doesn't get confused by something looking like a defun inside
>> a docstring (try it; I wasn't able to get it highlight something wrong).
>
> You might be getting confused, here.

No, I'm not. I'm addressing a comment inside font-lock-compile-keywords, 
which is trying to justify highlighting parens in the first column.

> The scanning back to BOB which is
> slow doesn't just happen in font lock; it can (and does) happen
> anywhere.

Only in certain places, where the programmer didn't think to use the 
cache provided by syntax-ppss.

> It's just font lock's job to warn the user about this, so
> that she can correct it by adding in a backslash, for example.

And it's the job of the programmer to avoid this problem altogether, 
which is not too hard.

> Things do get confused, for example see bug #22884, where there was an
> open paren in column zero in our own C sources.

Even if bug#22884 is somewhat related, it's actually irrelevant is the 
current discussion because c-mode uses a non-default 
beginning-of-defun-function. Which means font-lock-compile-keywords 
won't add highlighting to 0-column parens in c-mode anyway.

It seems the current code was designed with only Lisp modes in mind.

>> M-x beginning-of-defun does get confused, though. If *that* is problem
>> what we want to detect, .....
>
> Not particularly.  We want the user to be warned about things
> potentially going wrong in back_comment, and anything which calls it.

I don't see any reason to believe that the original author of this code 
was concerned with back_comment specifically.

> No.  open-paren-in-column-0-is-defun-start is a variable that the user
> can change at any time.

I don't think it is, or should be, true. The major mode knows better 
whether it can know where a defun starts, or not.

E.g. js-mode and elisp-byte-code-mode set it to nil. If the user changes 
that value in one of these modes, nothing good will happen.

> We can't make our font-locking dependent upon
> what its value was at some time in the past.  If open-paren-... belongs
> anywhere, it's in the form just beyond the end of your patch's text.

I don't think so. I don't mind taking its comparison out altogether, but 
then the predicate will become very simple.

> Do you understand the consequences of taking out the check on
> syntax-begin-function?  (I certainly don't.)  It would be good if Stefan
> could express a view, here.

Point is, there is no way to simply alter the check that it would accept 
the current situation with syntax-begin-function, but still keep it 
meaningful. If we accept the value nil (which it is emacs-lisp-mode 
now), we should accept any syntax-begin-function, I think.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 15 May 2016 21:51:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 15 17:51:05 2016
Received: from localhost ([127.0.0.1]:53045 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1b23wG-00025T-Tt
	for submit <at> debbugs.gnu.org; Sun, 15 May 2016 17:51:05 -0400
Received: from mail-wm0-f45.google.com ([74.125.82.45]:37933)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1b23wE-00024z-Pn
 for 21871 <at> debbugs.gnu.org; Sun, 15 May 2016 17:51:03 -0400
Received: by mail-wm0-f45.google.com with SMTP id g17so108992066wme.1
 for <21871 <at> debbugs.gnu.org>; Sun, 15 May 2016 14:51:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=5eRg20JKTaSu+NmNg6mHYAT+Oumok0vuuCulKoTwcOg=;
 b=eExCZpsjDiHQlXuXOxQwrEthJNLNZksDooIsdh1vjctQB+V78gcjKwF2jfcVyuhw7v
 YyZRelfhzG7Wyu2ijlpW5uR85SqAS7vFftMqem8aX6VsicGyJQVN+MzhAQD8PEwrCm3b
 D4GV1I2ceiPIBP7EroefMxBS2fNvmzQ2DxCJhkRaqGVp3Fol2eVPEeoaw8AJWc+HziuB
 k+Ae69M4pzqn/KbK7mhFatcy92s0RJCGftvwudA+G8NGjQQBTCQl9d5KXwifGugdd/4B
 CAnay1ZxwEgkeBYTN7//L3eAlA17lfXSwak5qpwDRParFN7VTe1UecPSXcRMcJEXVIOq
 IAMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=5eRg20JKTaSu+NmNg6mHYAT+Oumok0vuuCulKoTwcOg=;
 b=kvFY636RmCbrTQkA9IIlAxgtuvDLTavQtbxeyYsiKwjNr2WDiRWyb7LKT3W7YzTMig
 D90erVqUul7Q1ksPbYVLX+ngKMC70zSYFnnBnUidLa+p1C883KUujb7mNiZR2JPuqCnr
 mz2b9iGvq+Hf34UPgcQ8gOFJqfUshJy+e9LAb/M/zhrUkS8ZIexVEmoLi9ooKZI3M/2/
 FD7EaUEzN76LhHw11mFd/5N+4WbBe7b7pBaoahPPyRzzz8R2jIo3s/yU7SzERkONbRXo
 5aEdIT1XdD9eR00VUke+FL9X2ajEC/LzNPvevtSMLeh/LyZApnHL4nO8lmOnxRpu1gcp
 Kufw==
X-Gm-Message-State: AOPr4FVSe/N2ikAOC3zxO79VvWdkD9nITn5COOTTE4FNkGt/l+o2IOr/XF8avUhB6OVzPA==
X-Received: by 10.194.42.69 with SMTP id m5mr26716505wjl.89.1463349057102;
 Sun, 15 May 2016 14:50:57 -0700 (PDT)
Received: from [192.168.1.2] ([185.105.175.24])
 by smtp.googlemail.com with ESMTPSA id
 m140sm14989349wma.24.2016.05.15.14.50.55
 (version=TLSv1/SSLv3 cipher=OTHER);
 Sun, 15 May 2016 14:50:56 -0700 (PDT)
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0 don't get bold red highlighting.
To: Alan Mackenzie <acm@HIDDEN>, 21871 <at> debbugs.gnu.org
References: <20151110163034.GH2626@HIDDEN>
 <20151112185424.38599.qmail@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <414b75b8-bb45-4640-4742-9f88b9ff5e75@HIDDEN>
Date: Mon, 16 May 2016 00:50:54 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.1
MIME-Version: 1.0
In-Reply-To: <20151112185424.38599.qmail@HIDDEN>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.5 (/)
X-Debbugs-Envelope-To: 21871
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 11/12/2015 08:54 PM, Alan Mackenzie wrote:

> The fix to bug #16247 meant no longer setting syntax-begin-function to a
> non-nil value.  This is the condition which used to cause the appropriate
> font-lock-keywords form to get added to lisp-font-lock-keywords-1/2.  It
> no longer is.

Looking into this, I'm not sure we still want to highlight them. The 
aforementioned bug, now fixed, mirrored the justifications that we give 
in the manual and the comments for the highlighting of parens in the 0th 
column:

"The convention speeds up many Emacs operations, which would otherwise 
have to scan back to the beginning of the buffer to analyze the syntax 
of the code."

and

;; Try to detect when a string or comment contains something that
;; looks like a defun and would thus confuse font-lock.

We don't have to scan back to the beginning of the buffer, we can use 
syntax-ppss (and it's more reliable with bug#16247 fixed).

font-lock doesn't get confused by something looking like a defun inside 
a docstring (try it; I wasn't able to get it highlight something wrong).

M-x beginning-of-defun does get confused, though. If *that* is problem 
what we want to detect, I think the patch should look like this:

diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 8ee9f69..eed2766 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1786,13 +1786,10 @@ font-lock-compile-keywords
  	  (cons t (cons keywords
  			(mapcar #'font-lock-compile-keyword keywords))))
      (if (and (not syntactic-keywords)
-	     (let ((beg-function syntax-begin-function))
-	       (or (eq beg-function 'beginning-of-defun)
-                   (if (symbolp beg-function)
-                       (get beg-function 'font-lock-syntax-paren-check))))
-	     (not beginning-of-defun-function))
+             (not beginning-of-defun-function)
+             open-paren-in-column-0-is-defun-start)
  	;; Try to detect when a string or comment contains something that
-	;; looks like a defun and would thus confuse font-lock.
+	;; looks like a defun and would thus confuse beginning-of-defun.
  	(nconc keywords
  	       `((,(if defun-prompt-regexp
  		       (concat "^\\(?:" defun-prompt-regexp "\\)?\\s(")





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 12 Nov 2015 19:17:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 12 14:17:41 2015
Received: from localhost ([127.0.0.1]:35073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZwxNN-0004p3-Hj
	for submit <at> debbugs.gnu.org; Thu, 12 Nov 2015 14:17:41 -0500
Received: from mtaout20.012.net.il ([80.179.55.166]:41474)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1ZwxN2-0004oc-Ss
 for 21871 <at> debbugs.gnu.org; Thu, 12 Nov 2015 14:17:40 -0500
Received: from conversion-daemon.a-mtaout20.012.net.il by
 a-mtaout20.012.net.il (HyperSendmail v2007.08) id
 <0NXP00F00UNHDC00@HIDDEN> for 21871 <at> debbugs.gnu.org;
 Thu, 12 Nov 2015 21:17:19 +0200 (IST)
Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NXP00ETYUWVWCA0@HIDDEN>;
 Thu, 12 Nov 2015 21:17:19 +0200 (IST)
Date: Thu, 12 Nov 2015 21:17:05 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0	don't get bold red highlighting.
In-reply-to: <20151112185424.38599.qmail@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Alan Mackenzie <acm@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Message-id: <831tbvhvta.fsf@HIDDEN>
References: <20151110163034.GH2626@HIDDEN>
 <20151112185424.38599.qmail@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 21871
Cc: acm@HIDDEN, 21871 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> Date: 12 Nov 2015 18:54:24 -0000
> From: Alan Mackenzie <acm@HIDDEN>
> Cc: Alan Mackenzie <acm@HIDDEN>
> 
> The fix to bug #16247 meant no longer setting syntax-begin-function to a
> non-nil value.  This is the condition which used to cause the appropriate
> font-lock-keywords form to get added to lisp-font-lock-keywords-1/2.  It
> no longer is.

Stefan?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 12 Nov 2015 18:54:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 12 13:54:46 2015
Received: from localhost ([127.0.0.1]:35066 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Zwx0t-0004HQ-V4
	for submit <at> debbugs.gnu.org; Thu, 12 Nov 2015 13:54:46 -0500
Received: from mail.muc.de ([193.149.48.3]:55733)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <acm@HIDDEN>) id 1Zwx0r-0004HH-RC
 for 21871 <at> debbugs.gnu.org; Thu, 12 Nov 2015 13:54:26 -0500
Received: (qmail 38600 invoked by uid 3782); 12 Nov 2015 18:54:24 -0000
Date: 12 Nov 2015 18:54:24 -0000
Message-ID: <20151112185424.38599.qmail@HIDDEN>
From: Alan Mackenzie <acm@HIDDEN>
To: 21871 <at> debbugs.gnu.org
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0 don't get bold red highlighting.
Organization: muc.de e.V.
In-Reply-To: <mailman.2173.1447351928.7904.bug-gnu-emacs@HIDDEN>
X-Newsgroups: gnu.emacs.bug
User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.1-RELEASE-p16
 (amd64))
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 21871
Cc: Glenn Morris <rgm@HIDDEN>, Alan Mackenzie <acm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

In article <mailman.2173.1447351928.7904.bug-gnu-emacs@HIDDEN> you wrote:
> On Thu, Nov 12, 2015 at 11:36:55AM -0500, Glenn Morris wrote:
>> Alan Mackenzie wrote:

>> > Thinking about it, this is surely a bug in the documentation.

>> I disagree, since it works as documented in Emacs 24.3.
>> It seems to have been broken since 24.4.

> Thanks for that tip.  The code for it (in font-lock-compile-keywords) is
> still there, but somehow one of a list of conditions which prevent it
> being activated has become set.

> I'm looking into it.

The fix to bug #16247 meant no longer setting syntax-begin-function to a
non-nil value.  This is the condition which used to cause the appropriate
font-lock-keywords form to get added to lisp-font-lock-keywords-1/2.  It
no longer is.

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 12 Nov 2015 18:11:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 12 13:11:05 2015
Received: from localhost ([127.0.0.1]:34986 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZwwKu-0003AN-DR
	for submit <at> debbugs.gnu.org; Thu, 12 Nov 2015 13:11:04 -0500
Received: from mail.muc.de ([193.149.48.3]:30643)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <acm@HIDDEN>) id 1ZwwKa-00039b-O3
 for 21871 <at> debbugs.gnu.org; Thu, 12 Nov 2015 13:11:03 -0500
Received: (qmail 28911 invoked by uid 3782); 12 Nov 2015 18:10:43 -0000
Received: from acm.muc.de (p5B14648C.dip0.t-ipconnect.de [91.20.100.140]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Thu, 12 Nov 2015 19:10:43 +0100
Received: (qmail 6239 invoked by uid 1000); 12 Nov 2015 18:12:41 -0000
Date: Thu, 12 Nov 2015 18:12:41 +0000
To: Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0	don't get bold red highlighting.
Message-ID: <20151112181241.GG3120@HIDDEN>
References: <20151110163034.GH2626@HIDDEN>
 <20151112124449.55828.qmail@HIDDEN>
 <756117yy1k.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <756117yy1k.fsf@HIDDEN>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 21871
Cc: 21871 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

Hello, Glenn.

On Thu, Nov 12, 2015 at 11:36:55AM -0500, Glenn Morris wrote:
> Alan Mackenzie wrote:

> > Thinking about it, this is surely a bug in the documentation.

> I disagree, since it works as documented in Emacs 24.3.
> It seems to have been broken since 24.4.

Thanks for that tip.  The code for it (in font-lock-compile-keywords) is
still there, but somehow one of a list of conditions which prevent it
being activated has become set.

I'm looking into it.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 12 Nov 2015 16:37:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 12 11:37:23 2015
Received: from localhost ([127.0.0.1]:34912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZwusF-00062y-Lg
	for submit <at> debbugs.gnu.org; Thu, 12 Nov 2015 11:37:23 -0500
Received: from eggs.gnu.org ([208.118.235.92]:49230)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1Zwurw-00062V-0o
 for 21871 <at> debbugs.gnu.org; Thu, 12 Nov 2015 11:37:22 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rgm@HIDDEN>) id 1Zwurs-0000Qr-07
 for 21871 <at> debbugs.gnu.org; Thu, 12 Nov 2015 11:37:03 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54573)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@HIDDEN>)
 id 1Zwurp-0000PT-FU; Thu, 12 Nov 2015 11:36:57 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1Zwurn-0000Yl-OT; Thu, 12 Nov 2015 11:36:55 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0	don't get bold red highlighting.
References: <20151110163034.GH2626@HIDDEN>
 <20151112124449.55828.qmail@HIDDEN>
X-Spook: gamma spies Tsunami E. Coli Drug cartel Gang digicash AQAP
X-Ran: ty"02vK`B&n|sh"v=&9F@^H(Wr.FU2w_KNK#(r$h1G{6RP4~~eg~>j^bBeiDg<7-pn;a9.
X-Hue: green
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Thu, 12 Nov 2015 11:36:55 -0500
In-Reply-To: <20151112124449.55828.qmail@HIDDEN> (Alan Mackenzie's
 message of "12 Nov 2015 12:44:49 -0000")
Message-ID: <756117yy1k.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.4 (-----)
X-Debbugs-Envelope-To: 21871
Cc: 21871 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.4 (-----)

Alan Mackenzie wrote:

> Thinking about it, this is surely a bug in the documentation.

I disagree, since it works as documented in Emacs 24.3.
It seems to have been broken since 24.4.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.

Message received at 21871 <at> debbugs.gnu.org:


Received: (at 21871) by debbugs.gnu.org; 12 Nov 2015 12:45:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 12 07:45:11 2015
Received: from localhost ([127.0.0.1]:34163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZwrFX-0000JB-3m
	for submit <at> debbugs.gnu.org; Thu, 12 Nov 2015 07:45:11 -0500
Received: from mail.muc.de ([193.149.48.3]:35685)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <acm@HIDDEN>) id 1ZwrFC-0000IC-Qj
 for 21871 <at> debbugs.gnu.org; Thu, 12 Nov 2015 07:45:09 -0500
Received: (qmail 55829 invoked by uid 3782); 12 Nov 2015 12:44:49 -0000
Date: 12 Nov 2015 12:44:49 -0000
Message-ID: <20151112124449.55828.qmail@HIDDEN>
From: Alan Mackenzie <acm@HIDDEN>
To: 21871 <at> debbugs.gnu.org
Subject: Re: bug#21871: Emacs Lisp Mode (at least): spurious parens in column
 0	don't get bold red highlighting.
Organization: muc.de e.V.
In-Reply-To: <mailman.2066.1447172952.7904.bug-gnu-emacs@HIDDEN>
X-Newsgroups: gnu.emacs.bug
User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.1-RELEASE-p16
 (amd64))
X-Spam-Score: -0.4 (/)
X-Debbugs-Envelope-To: 21871
Cc: Alan Mackenzie <acm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.4 (/)

In article <mailman.2066.1447172952.7904.bug-gnu-emacs@HIDDEN> you wrote:
> In the Emacs manual page "Left Margin Paren", it says that:

>    To help you catch violations of this convention, Font Lock mode
>    highlights confusing opening delimiters (those that ought to be quoted)
>    in bold red.

> , where "this convention" is the convention of not putting opening parens
> in column 0 when they aren't at the beginning of defuns.

> In Emacs Lisp Mode, this highlighting isn't done.  It isn't in CC Mode,
> either.

> This is either a bug in the code, or a bug in the documentation.  I
> rather tend to the view that this bold red highlighting should be done
> when open-paren-in-column-0-is-defun-start is non-nil.  I think it did,
> at one stage, but searching the emacs-devel archives doesn't reveal what
> happened.

Thinking about it, this is surely a bug in the documentation.  The only
way Font Lock (or anything else) could pick out an offending paren would
be to scan a buffer from BOB.  This would rather defeat the point of the
paren in column 0 convention.

I'll patch the doc.

-- 
Alan Mackenzie (Nuremberg, Germany).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.
bug Marked as found in versions 24.5. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added indication that bug 21871 blocks19759 Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug Marked as found in versions 24.4. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Nov 2015 16:28:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 10 11:28:52 2015
Received: from localhost ([127.0.0.1]:60463 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZwBmu-0000yb-EM
	for submit <at> debbugs.gnu.org; Tue, 10 Nov 2015 11:28:52 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41152)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <acm@HIDDEN>) id 1ZwBms-0000yQ-GX
 for submit <at> debbugs.gnu.org; Tue, 10 Nov 2015 11:28:51 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <acm@HIDDEN>) id 1ZwBmo-0003nW-Ay
 for submit <at> debbugs.gnu.org; Tue, 10 Nov 2015 11:28:50 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:60766)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1ZwBmo-0003nS-95
 for submit <at> debbugs.gnu.org; Tue, 10 Nov 2015 11:28:46 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51129)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1ZwBmn-0004BF-D9
 for bug-gnu-emacs@HIDDEN; Tue, 10 Nov 2015 11:28:46 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <acm@HIDDEN>) id 1ZwBmi-0003mm-Aw
 for bug-gnu-emacs@HIDDEN; Tue, 10 Nov 2015 11:28:45 -0500
Received: from mail.muc.de ([193.149.48.3]:60909)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <acm@HIDDEN>)
 id 1ZwBmi-0003mg-0z
 for bug-gnu-emacs@HIDDEN; Tue, 10 Nov 2015 11:28:40 -0500
Received: (qmail 89999 invoked by uid 3782); 10 Nov 2015 16:28:38 -0000
Received: from acm.muc.de (p5B14697B.dip0.t-ipconnect.de [91.20.105.123]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 10 Nov 2015 17:28:37 +0100
Received: (qmail 4295 invoked by uid 1000); 10 Nov 2015 16:30:34 -0000
Date: Tue, 10 Nov 2015 16:30:34 +0000
To: bug-gnu-emacs@HIDDEN
Subject: Emacs Lisp Mode (at least): spurious parens in column 0 don't get
 bold red highlighting.
Message-ID: <20151110163034.GH2626@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.3 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.3 (----)

Hello, Emacs.

In the Emacs manual page "Left Margin Paren", it says that:

   To help you catch violations of this convention, Font Lock mode
   highlights confusing opening delimiters (those that ought to be quoted)
   in bold red.

, where "this convention" is the convention of not putting opening parens
in column 0 when they aren't at the beginning of defuns.

In Emacs Lisp Mode, this highlighting isn't done.  It isn't in CC Mode,
either.

This is either a bug in the code, or a bug in the documentation.  I
rather tend to the view that this bold red highlighting should be done
when open-paren-in-column-0-is-defun-start is non-nil.  I think it did,
at one stage, but searching the emacs-devel archives doesn't reveal what
happened.

-- 
Alan Mackenzie (Nuremberg, Germany).




Acknowledgement sent to Alan Mackenzie <acm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#21871; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 2 Sep 2017 13:30:02 UTC

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