GNU bug report logs - #23272
25.0.92; syntax-propertize-via-font-lock considered harmful

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Mon, 11 Apr 2016 22:55:01 UTC

Severity: normal

Tags: moreinfo

Found in version 25.0.92

Done: Stefan Kangas <stefan <at> marxist.se>

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 23272 in the body.
You can then email your comments to 23272 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#23272; Package emacs. (Mon, 11 Apr 2016 22:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 11 Apr 2016 22:55:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.92; syntax-propertize-via-font-lock considered harmful
Date: Tue, 12 Apr 2016 01:54:01 +0300
It makes it impossible to call syntax-propertize without enabling
font-lock-mode first, e.g. when delay-mode-hooks is used.

Example:

(with-temp-buffer
  (insert "-- -*- mode: ada -*-")
  (delay-mode-hooks
    (set-auto-mode))
  (syntax-propertize (point)))

=> (error "Font-lock trying to use keywords before setting them up")

I've hit this when working on a patch in
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23223#38.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23272; Package emacs. (Wed, 30 Oct 2019 15:58:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 23272 <at> debbugs.gnu.org
Subject: Re: 25.0.92; syntax-propertize-via-font-lock considered harmful
Date: Wed, 30 Oct 2019 16:56:54 +0100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> It makes it impossible to call syntax-propertize without enabling
> font-lock-mode first, e.g. when delay-mode-hooks is used.
>
> Example:
>
> (with-temp-buffer
>   (insert "-- -*- mode: ada -*-")
>   (delay-mode-hooks
>     (set-auto-mode))
>   (syntax-propertize (point)))
>
> => (error "Font-lock trying to use keywords before setting them up")

I'm unable to reproduce this bug on the current trunk.  Has this been
fixed in the three years since it was reported?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 30 Oct 2019 15:58:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23272; Package emacs. (Wed, 20 Nov 2019 23:23:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 23272 <at> debbugs.gnu.org
Subject: Re: bug#23272: 25.0.92; syntax-propertize-via-font-lock considered
 harmful
Date: Thu, 21 Nov 2019 01:22:41 +0200
On 30.10.2019 17:56, Lars Ingebrigtsen wrote:
> I'm unable to reproduce this bug on the current trunk.  Has this been
> fixed in the three years since it was reported?

I think it's still there as a possibility, but the odds of triggering it 
are becoming more rare with each year.

Looking at the backtrace, it requires a major mode that uses 
font-lock-syntactic-keywords and calls syntax-propertize-via-font-lock 
to set its syntax-propertize-function.

Since Emacs 26 (where the bug still reproduces), ada-mode has both 
switched to a proper syntax-propertize-function instead of the one 
mentioned above and moved out of Emacs core, so "mode: ada" isn't doing 
anything in 'emacs -Q'.

So the repro scenario is like this now:

(define-derived-mode foo-mode fundamental-mode "Foo"
  (setq-local syntax-propertize-function
	      (syntax-propertize-via-font-lock nil)))

(with-temp-buffer
  (insert "-- -*- mode: foo -*-")
  (delay-mode-hooks
    (set-auto-mode))
  (syntax-propertize (point)))

The resulting backtrace:

Debugger entered--Lisp error: (error "Font-lock trying to use keywords 
before setting th...")
  signal(error ("Font-lock trying to use keywords before setting th..."))
  error("Font-lock trying to use keywords before setting th...")
  font-lock-compile-keywords(nil t)
  font-lock-fontify-syntactic-keywords-region(1 21)
  #f(compiled-function (start end) #<bytecode 0x15817a4f1981>)(1 21)
  syntax-propertize(21)

Considering font-lock-syntactic-keywords are obsolete since Emacs 24, 
this is not very important, and people should feel free to close this if 
a fix is not found soon.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23272; Package emacs. (Thu, 21 Nov 2019 12:35:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 23272 <at> debbugs.gnu.org
Subject: Re: bug#23272: 25.0.92; syntax-propertize-via-font-lock considered
 harmful
Date: Thu, 21 Nov 2019 13:34:14 +0100
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Since Emacs 26 (where the bug still reproduces), ada-mode has both
> switched to a proper syntax-propertize-function instead of the one 
> mentioned above and moved out of Emacs core, so "mode: ada" isn't
> doing anything in 'emacs -Q'.
>
> So the repro scenario is like this now:
>
> (define-derived-mode foo-mode fundamental-mode "Foo"
>   (setq-local syntax-propertize-function
> 	      (syntax-propertize-via-font-lock nil)))
>
> (with-temp-buffer
>   (insert "-- -*- mode: foo -*-")
>   (delay-mode-hooks
>     (set-auto-mode))
>   (syntax-propertize (point)))

Ah; thanks for the explanation.

> Considering font-lock-syntactic-keywords are obsolete since Emacs 24,
> this is not very important, and people should feel free to close this
> if a fix is not found soon.

OK; I'll leave it open for now, but probably closing this in a month or
so if nothing further happens.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Sat, 29 Feb 2020 02:20:02 GMT) Full text and rfc822 format available.

Notification sent to Dmitry Gutov <dgutov <at> yandex.ru>:
bug acknowledged by developer. (Sat, 29 Feb 2020 02:20:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 23272-done <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#23272: 25.0.92;
 syntax-propertize-via-font-lock considered harmful
Date: Sat, 29 Feb 2020 03:19:26 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> Considering font-lock-syntactic-keywords are obsolete since Emacs 24,
>> this is not very important, and people should feel free to close this
>> if a fix is not found soon.
>
> OK; I'll leave it open for now, but probably closing this in a month or
> so if nothing further happens.

That was 14 weeks ago, and there have been no further comments.

I'm therefore closing this bug now.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 28 Mar 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 82 days ago.

Previous Next


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