GNU bug report logs - #20911
24.5.3; Syntax should not require font-lock

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Sat, 27 Jun 2015 15:21:03 UTC

Severity: normal

Tags: notabug

Found in version 24.5.3

Done: Dmitry Gutov <dgutov <at> yandex.ru>

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 20911 in the body.
You can then email your comments to 20911 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#20911; Package emacs. (Sat, 27 Jun 2015 15:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Röhler <andreas.roehler <at> easy-emacs.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 27 Jun 2015 15:21:03 GMT) Full text and rfc822 format available.

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

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5.3; Syntax should not require font-lock
Date: Sat, 27 Jun 2015 17:19:55 +0200
python.el and others.

While working at a general-close mode, tests succeeded locally, but 
Travis CI repeatedly sent errors like this:

FAILED gen-close-python-doublequoted-tqs-test
FAILED gen-close-python-singlequoted-tqs-test

for example from
https://travis-ci.org/emacs-berlin/general-close/builds/68578148

These tests succeed, if boolean gen-verbose-p was set to t, which OTOH 
isn't intendet at batch-mode.

Both macros in question -- for example gen-test-with-python-buffer-- 
have this:

   `(when gen-verbose-p
 (switch-to-buffer (current-buffer))
 (font-lock-fontify-buffer))`

AFAICS the error is caused, because TQS-syntax in python.el is set by 
syntax-propertize-function

Documentation:
Mode-specific function to apply syntax-table' text properties. It is the 
work horse ofsyntax-propertize', which is called by things like
Font-Lock and indentation.


Setting up syntax seems to require font-lock - which doesn't feel right.

;;;;;;;;;;

GNU Emacs 24.5.3 (i686-pc-linux-gnu, GTK+ Version 2.24.23) of 2015-04-20




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Sat, 27 Jun 2015 15:32:02 GMT) Full text and rfc822 format available.

Notification sent to Andreas Röhler <andreas.roehler <at> easy-emacs.de>:
bug acknowledged by developer. (Sat, 27 Jun 2015 15:32:03 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>,
 20911-done <at> debbugs.gnu.org
Subject: Re: bug#20911: 24.5.3; Syntax should not require font-lock
Date: Sat, 27 Jun 2015 18:31:02 +0300
Tags: notabug

Hi!

On 06/27/2015 06:19 PM, Andreas Röhler wrote:

> Both macros in question -- for example gen-test-with-python-buffer--
> have this:
>
>     `(when gen-verbose-p
>   (switch-to-buffer (current-buffer))
>   (font-lock-fontify-buffer))`

Don't do that, then.

> AFAICS the error is caused, because TQS-syntax in python.el is set by
> syntax-propertize-function

Call (syntax-propertize (point-max)) instead.

> Documentation:
> Mode-specific function to apply syntax-table' text properties. It is the
> work horse of `syntax-propertize', which is called by things like
> Font-Lock and indentation.
>
>
> Setting up syntax seems to require font-lock - which doesn't feel right.

That only says that font-lock requires it, not vice versa. The docstring 
even mentions `syntax-propertize'.




Added tag(s) notabug. Request was from Dmitry Gutov <dgutov <at> yandex.ru> to control <at> debbugs.gnu.org. (Sat, 27 Jun 2015 15:35:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20911; Package emacs. (Sat, 27 Jun 2015 16:38:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>,
 20911-done <at> debbugs.gnu.org
Subject: Re: bug#20911: 24.5.3; Syntax should not require font-lock
Date: Sat, 27 Jun 2015 19:37:41 +0300
On 06/27/2015 06:31 PM, Dmitry Gutov wrote:

> Call (syntax-propertize (point-max)) instead.

Further, this call should probably be in the code that relies on the 
added text properties, not in the test.

Adjust the actual argument as appropriate: most of the time you only 
need the current buffer propertized until the current position, not 
necessarily until the end (which might take more time).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20911; Package emacs. (Sat, 27 Jun 2015 16:41:02 GMT) Full text and rfc822 format available.

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

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Dmitry Gutov <dgutov <at> yandex.ru>, 20911-done <at> debbugs.gnu.org
Subject: Re: bug#20911: 24.5.3; Syntax should not require font-lock
Date: Sat, 27 Jun 2015 18:40:10 +0200
Am 27.06.2015 um 18:37 schrieb Dmitry Gutov:
> On 06/27/2015 06:31 PM, Dmitry Gutov wrote:
>
>> Call (syntax-propertize (point-max)) instead.
>
> Further, this call should probably be in the code that relies on the 
> added text properties, not in the test.

Maybe, but this adresses python.el and other probably.

My tests succeed by adding an extra fontify- in test buffer - which is a 
workaround.

>
> Adjust the actual argument as appropriate: most of the time you only 
> need the current buffer propertized until the current position, not 
> necessarily until the end (which might take more time).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20911; Package emacs. (Sat, 27 Jun 2015 16:43:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>,
 20911-done <at> debbugs.gnu.org
Subject: Re: bug#20911: 24.5.3; Syntax should not require font-lock
Date: Sat, 27 Jun 2015 19:42:28 +0300
On 06/27/2015 07:40 PM, Andreas Röhler wrote:

> Maybe, but this adresses python.el and other probably.

Feel free to open a relevant bug for each affected mode, with a 
reproduction scenario that starts with disabling font-lock.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Jul 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 24 days ago.

Previous Next


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