bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24749: Making sure syntax-propertize is called


From: Stefan Monnier
Subject: bug#24749: Making sure syntax-propertize is called
Date: Mon, 03 Jun 2019 13:47:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

[ Resending after unarchiving the bug.  ]

> Shouldn't this be pushed (or even backported) to emacs 26?

While I clearly think it's an improvement, I don't think it fixes
a regression: it's more like it fixes bugs that have been with us for
"ever".
So, I don't see any urgency.  

It should be pretty safe, tho, so it's probably OK to add it to
emacs-26.  It's Eli's call (and given the situation, I think in his
shoes I probably would say "I'd rather not").

> Some modes (e.g pascal, perl) don't set parse-sexp-lookup-properties
> but have the syntax-propertize-function.  This leads to
> really-hard-to-debug behavior in batch mode.  For some reason in
> interactive session parse-sexp-lookup-properties is set to
> t (font-lock I guess, and maybe something else).

Indeed, font-lock is the most common caller of syntax-propertize, so
that explains why interactive use typically is not affected.

Note: you can also set parse-sexp-lookup-properties's default value to
t and forget about the problem ;-)

> Also, it's a bit confusing that many modes do still set
> parse-sexp-lookup-properties explicitly:
>  
>  lisp/emacs-lisp/syntax.el:293:      (set (make-local-variable 
> 'parse-sexp-lookup-properties) t)
>  lisp/ChangeLog.9:10944:      Don't switch the syntax-table.  Don't set 
> parse-sexp-lookup-properties.
>  lisp/ChangeLog.15:7269:      Set parse-sexp-lookup-properties buffer-locally 
> here.
>  lisp/progmodes/cc-defs.el:1996:      (setq parse-sexp-lookup-properties t
>  lisp/progmodes/cc-mode.el:580:      (set (make-local-variable 
> 'parse-sexp-lookup-properties) t))
>  lisp/progmodes/ruby-mode.el:754:  (setq-local parse-sexp-lookup-properties t)
>  lisp/progmodes/ada-mode.el:1149:    (set (make-local-variable 
> 'parse-sexp-lookup-properties) t))
>  lisp/progmodes/python.el:5352:  (set (make-local-variable 
> 'parse-sexp-lookup-properties) t)
>  lisp/progmodes/cperl-mode.el:1759:   (set (make-local-variable 
> 'parse-sexp-lookup-properties) t)
>  lisp/progmodes/cperl-mode.el:6762:   (set (make-local-variable 
> 'parse-sexp-lookup-properties) t))))
>  lisp/font-lock.el:1545:    (set (make-local-variable 
> 'parse-sexp-lookup-properties) t))
>  lisp/subr.el:1982:         ;; `syntax-propertize' sets 
> `parse-sexp-lookup-properties' for us, but
>  lisp/subr.el:1986:         (setq-local parse-sexp-lookup-properties t))
>  test/lisp/gnus/message-tests.el:47:          (setq-local 
> parse-sexp-lookup-properties t)

While this is likely unneeded in several of those matches, it's also
harmless.  Feel free to remove them in those cases where you can
determine it's indeed not needed (typically because you know the code
won't be used in Emacs<27).


         Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]