]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/subr.el (run-mode-hooks): Set parse-sexp-lookup-properties
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 12 Dec 2017 14:11:17 +0000 (09:11 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 12 Dec 2017 14:11:17 +0000 (09:11 -0500)
if syntax-propertize-function is set (bug#24749).
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/textmodes/texinfo.el (texinfo-mode):
* lisp/textmodes/mhtml-mode.el (mhtml-mode):
* lisp/progmodes/js.el (js-mode): Don't set parse-sexp-lookup-properties.

lisp/progmodes/js.el
lisp/progmodes/sh-script.el
lisp/subr.el
lisp/textmodes/mhtml-mode.el
lisp/textmodes/texinfo.el

index 1f86909362edb462c750568e55d2ffe0eb191bd6..3d3ea079cffba0d4b01830a4ca79f341d34d14f8 100644 (file)
@@ -3869,7 +3869,6 @@ If one hasn't been set, or if it's stale, prompt for a new one."
   (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
index 2a867bb36550676b739206070053699f4a8b63aa..bebb1bcba9433a2f3869cdbddb1ba1fe62515189 100644 (file)
@@ -2392,7 +2392,6 @@ whose value is the shell name (don't quote it)."
                       (funcall mksym "rules")
                       :forward-token  (funcall mksym "forward-token")
                       :backward-token (funcall mksym "backward-token")))
-        (setq-local parse-sexp-lookup-properties t)
         (unless sh-use-smie
           (setq-local sh-kw-alist (sh-feature sh-kw))
           (let ((regexp (sh-feature sh-kws-for-done)))
index bf51c934cff0794d767bed562c05f00c72e2b3ff..8468255ad2f02926ffec95c1f37e7084509d4730 100644 (file)
@@ -1876,8 +1876,15 @@ running their FOO-mode-hook."
        (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)))
index 09da155f4871d3b7a44297ac46f7d6a462c242c8..3e37edefb719fc3e6956e5d3f04c054111ac6c50 100644 (file)
@@ -366,7 +366,6 @@ Code inside a <script> element is indented using the rules from
 `js-mode'; and code inside a <style> element is indented using
 the rules from `css-mode'."
   (setq-local indent-line-function #'mhtml-indent-line)
-  (setq-local parse-sexp-lookup-properties t)
   (setq-local syntax-propertize-function #'mhtml-syntax-propertize)
   (setq-local font-lock-fontify-region-function
               #'mhtml--submode-fontify-region)
index be8bcc55feccf8035f65857a5c08936a17f111cf..8070132d2038b550a6480feb60c25df037126810 100644 (file)
@@ -610,7 +610,6 @@ value of `texinfo-mode-hook'."
   (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.