[Top][All Lists]

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

[debbugs-tracker] bug#24749: closed (Making sure syntax-propertize is ca

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#24749: closed (Making sure syntax-propertize is called)
Date: Tue, 12 Dec 2017 14:13:04 +0000

Your message dated Tue, 12 Dec 2017 09:12:14 -0500
with message-id <address@hidden>
and subject line Re: bug#24749: Making sure syntax-propertize is called
has caused the debbugs.gnu.org bug report #24749,
regarding Making sure syntax-propertize is called
to be marked as done.

(If you believe you have received this mail in error, please contact

24749: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24749
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Making sure syntax-propertize is called Date: Thu, 20 Oct 2016 17:14:40 -0400
Package: Emacs
Version: 25.2.50

Nowadays, syntax-propertize is automatically called ondemand by the sexp
functions, but only if parse-sexp-lookup-properties is non-nil.
See bug#4920 for an example of the problem and the fix we installed.

I suggest we install the patch below instead, so as to fix this bug in
more/all major modes at once.


diff --git a/lisp/subr.el b/lisp/subr.el
index 8c29395..38bfc5f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1844,8 +1844,15 @@ run-mode-hooks
        (push hook delayed-mode-hooks))
     ;; Normal case, just run the hook as before plus any delayed hooks.
     (setq hooks (nconc (nreverse delayed-mode-hooks) hooks))
+    (and syntax-propertize-function
+         (not (buffer-local-p 'parse-sexp-lookup-properties))
+         ;; `syntax-propertize' sets `parse-sexp-lookup-properties' for us, but
+         ;; in order for the sexp primitives to automatically call
+         ;; `syntax-propertize' we need `parse-sexp-lookup-properties' to be
+         ;; set first.
+         (setq-local parse-sexp-lookup-properties t))
     (setq delayed-mode-hooks nil)
-    (apply 'run-hooks (cons 'change-major-mode-after-body-hook hooks))
+    (apply #'run-hooks (cons 'change-major-mode-after-body-hook hooks))
     (if (buffer-file-name)
         (with-demoted-errors "File local-variables error: %s"
           (hack-local-variables 'no-mode)))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index f1fa7cb..848e357 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3728,7 +3728,6 @@ js-mode
   (setq-local prettify-symbols-alist js--prettify-symbols-alist)
   (setq-local parse-sexp-ignore-comments t)
-  (setq-local parse-sexp-lookup-properties t)
   (setq-local which-func-imenu-joiner-function #'js--which-func-joiner)
   ;; Comments
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 4cb8886..fd87c1e 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2214,7 +2214,6 @@ sh-set-shell
                       (funcall mksym "rules")
                       :forward-token  (funcall mksym "forward-token")
                       :backward-token (funcall mksym "backward-token")))
-        (setq-local parse-sexp-lookup-properties t)
        (if sh-make-vars-local
        (message "Indentation setup for shell type %s" sh-shell))
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 9f72659..6982fb9 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -620,7 +620,6 @@ texinfo-mode
   (setq font-lock-defaults
        '(texinfo-font-lock-keywords nil nil nil backward-paragraph))
   (setq-local syntax-propertize-function texinfo-syntax-propertize-function)
-  (setq-local parse-sexp-lookup-properties t)
   (setq-local add-log-current-defun-function #'texinfo-current-defun-name)
   ;; Outline settings.

--- End Message ---
--- Begin Message --- Subject: Re: bug#24749: Making sure syntax-propertize is called Date: Tue, 12 Dec 2017 09:12:14 -0500 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
Version: 27.1

> Should this finally be applied to master then?



--- End Message ---

reply via email to

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