diff options
| author | Stefan Monnier | 2017-12-12 09:11:17 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2017-12-12 09:11:17 -0500 |
| commit | 489d6466372f488adc53897435fff290394b62f7 (patch) | |
| tree | 1c58e54384e1c858a1225f96a2cc6e8f3b239f90 | |
| parent | 8c5be9cbaabc02f7c78f2bafb68e2e4ab35e130f (diff) | |
| download | emacs-489d6466372f488adc53897435fff290394b62f7.tar.gz emacs-489d6466372f488adc53897435fff290394b62f7.zip | |
* lisp/subr.el (run-mode-hooks): Set parse-sexp-lookup-properties
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.
| -rw-r--r-- | lisp/progmodes/js.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 1 | ||||
| -rw-r--r-- | lisp/subr.el | 9 | ||||
| -rw-r--r-- | lisp/textmodes/mhtml-mode.el | 1 | ||||
| -rw-r--r-- | lisp/textmodes/texinfo.el | 1 |
5 files changed, 8 insertions, 5 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 1f86909362e..3d3ea079cff 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -3869,7 +3869,6 @@ If one hasn't been set, or if it's stale, prompt for a new one." | |||
| 3869 | (setq-local prettify-symbols-alist js--prettify-symbols-alist) | 3869 | (setq-local prettify-symbols-alist js--prettify-symbols-alist) |
| 3870 | 3870 | ||
| 3871 | (setq-local parse-sexp-ignore-comments t) | 3871 | (setq-local parse-sexp-ignore-comments t) |
| 3872 | (setq-local parse-sexp-lookup-properties t) | ||
| 3873 | (setq-local which-func-imenu-joiner-function #'js--which-func-joiner) | 3872 | (setq-local which-func-imenu-joiner-function #'js--which-func-joiner) |
| 3874 | 3873 | ||
| 3875 | ;; Comments | 3874 | ;; Comments |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 2a867bb3655..bebb1bcba94 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -2392,7 +2392,6 @@ whose value is the shell name (don't quote it)." | |||
| 2392 | (funcall mksym "rules") | 2392 | (funcall mksym "rules") |
| 2393 | :forward-token (funcall mksym "forward-token") | 2393 | :forward-token (funcall mksym "forward-token") |
| 2394 | :backward-token (funcall mksym "backward-token"))) | 2394 | :backward-token (funcall mksym "backward-token"))) |
| 2395 | (setq-local parse-sexp-lookup-properties t) | ||
| 2396 | (unless sh-use-smie | 2395 | (unless sh-use-smie |
| 2397 | (setq-local sh-kw-alist (sh-feature sh-kw)) | 2396 | (setq-local sh-kw-alist (sh-feature sh-kw)) |
| 2398 | (let ((regexp (sh-feature sh-kws-for-done))) | 2397 | (let ((regexp (sh-feature sh-kws-for-done))) |
diff --git a/lisp/subr.el b/lisp/subr.el index bf51c934cff..8468255ad2f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1876,8 +1876,15 @@ running their FOO-mode-hook." | |||
| 1876 | (push hook delayed-mode-hooks)) | 1876 | (push hook delayed-mode-hooks)) |
| 1877 | ;; Normal case, just run the hook as before plus any delayed hooks. | 1877 | ;; Normal case, just run the hook as before plus any delayed hooks. |
| 1878 | (setq hooks (nconc (nreverse delayed-mode-hooks) hooks)) | 1878 | (setq hooks (nconc (nreverse delayed-mode-hooks) hooks)) |
| 1879 | (and syntax-propertize-function | ||
| 1880 | (not (buffer-local-p 'parse-sexp-lookup-properties)) | ||
| 1881 | ;; `syntax-propertize' sets `parse-sexp-lookup-properties' for us, but | ||
| 1882 | ;; in order for the sexp primitives to automatically call | ||
| 1883 | ;; `syntax-propertize' we need `parse-sexp-lookup-properties' to be | ||
| 1884 | ;; set first. | ||
| 1885 | (setq-local parse-sexp-lookup-properties t)) | ||
| 1879 | (setq delayed-mode-hooks nil) | 1886 | (setq delayed-mode-hooks nil) |
| 1880 | (apply 'run-hooks (cons 'change-major-mode-after-body-hook hooks)) | 1887 | (apply #'run-hooks (cons 'change-major-mode-after-body-hook hooks)) |
| 1881 | (if (buffer-file-name) | 1888 | (if (buffer-file-name) |
| 1882 | (with-demoted-errors "File local-variables error: %s" | 1889 | (with-demoted-errors "File local-variables error: %s" |
| 1883 | (hack-local-variables 'no-mode))) | 1890 | (hack-local-variables 'no-mode))) |
diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 09da155f487..3e37edefb71 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el | |||
| @@ -366,7 +366,6 @@ Code inside a <script> element is indented using the rules from | |||
| 366 | `js-mode'; and code inside a <style> element is indented using | 366 | `js-mode'; and code inside a <style> element is indented using |
| 367 | the rules from `css-mode'." | 367 | the rules from `css-mode'." |
| 368 | (setq-local indent-line-function #'mhtml-indent-line) | 368 | (setq-local indent-line-function #'mhtml-indent-line) |
| 369 | (setq-local parse-sexp-lookup-properties t) | ||
| 370 | (setq-local syntax-propertize-function #'mhtml-syntax-propertize) | 369 | (setq-local syntax-propertize-function #'mhtml-syntax-propertize) |
| 371 | (setq-local font-lock-fontify-region-function | 370 | (setq-local font-lock-fontify-region-function |
| 372 | #'mhtml--submode-fontify-region) | 371 | #'mhtml--submode-fontify-region) |
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index be8bcc55fec..8070132d203 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el | |||
| @@ -610,7 +610,6 @@ value of `texinfo-mode-hook'." | |||
| 610 | (setq font-lock-defaults | 610 | (setq font-lock-defaults |
| 611 | '(texinfo-font-lock-keywords nil nil nil backward-paragraph)) | 611 | '(texinfo-font-lock-keywords nil nil nil backward-paragraph)) |
| 612 | (setq-local syntax-propertize-function texinfo-syntax-propertize-function) | 612 | (setq-local syntax-propertize-function texinfo-syntax-propertize-function) |
| 613 | (setq-local parse-sexp-lookup-properties t) | ||
| 614 | (setq-local add-log-current-defun-function #'texinfo-current-defun-name) | 613 | (setq-local add-log-current-defun-function #'texinfo-current-defun-name) |
| 615 | 614 | ||
| 616 | ;; Outline settings. | 615 | ;; Outline settings. |