unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23272: 25.0.92; syntax-propertize-via-font-lock considered harmful
@ 2016-04-11 22:54 Dmitry Gutov
  2019-10-30 15:56 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2016-04-11 22:54 UTC (permalink / raw)
  To: 23272

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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23272: 25.0.92; syntax-propertize-via-font-lock considered harmful
  2016-04-11 22:54 bug#23272: 25.0.92; syntax-propertize-via-font-lock considered harmful Dmitry Gutov
@ 2019-10-30 15:56 ` Lars Ingebrigtsen
  2019-11-20 23:22   ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-30 15:56 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 23272

Dmitry Gutov <dgutov@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23272: 25.0.92; syntax-propertize-via-font-lock considered harmful
  2019-10-30 15:56 ` Lars Ingebrigtsen
@ 2019-11-20 23:22   ` Dmitry Gutov
  2019-11-21 12:34     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2019-11-20 23:22 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 23272

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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23272: 25.0.92; syntax-propertize-via-font-lock considered harmful
  2019-11-20 23:22   ` Dmitry Gutov
@ 2019-11-21 12:34     ` Lars Ingebrigtsen
  2020-02-29  2:19       ` Stefan Kangas
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-21 12:34 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 23272

Dmitry Gutov <dgutov@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23272: 25.0.92; syntax-propertize-via-font-lock considered harmful
  2019-11-21 12:34     ` Lars Ingebrigtsen
@ 2020-02-29  2:19       ` Stefan Kangas
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2020-02-29  2:19 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Dmitry Gutov, 23272-done

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-29  2:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11 22:54 bug#23272: 25.0.92; syntax-propertize-via-font-lock considered harmful Dmitry Gutov
2019-10-30 15:56 ` Lars Ingebrigtsen
2019-11-20 23:22   ` Dmitry Gutov
2019-11-21 12:34     ` Lars Ingebrigtsen
2020-02-29  2:19       ` Stefan Kangas

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).