emacs-31 749ce42049b: CC Mode: Set parse-sexp-lookup-properties for every mode

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit 749ce42049b9d2136efa0433b4c10cd9ad070156
Author: Alan Mackenzie <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    CC Mode: Set parse-sexp-lookup-properties for every mode
    
    This fixes a bug reported and diagnosed by Campbell Barton
    <[email protected]> on the emacs-devel list.
    
    * lisp/progmodes/cc-mode.el (c-basic-common-init): Set
    parse-sexp-lookup-properties or (for XEmacs) lookup-syntax-properties
    for every CC Mode mode.
---
 lisp/progmodes/cc-mode.el | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index f930d2d34f3..c00fef8a471 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -675,24 +675,16 @@ that requires a literal mode spec at compile time."
   (setq c-min-syn-tab-mkr nil)
   (setq c-max-syn-tab-mkr nil)
 
-  (when (or c-recognize-<>-arglists
-	    (c-major-mode-is 'awk-mode)
-	    (c-major-mode-is '(java-mode c-mode c++-mode objc-mode pike-mode)))
-    ;; We'll use the syntax-table text property to change the syntax
-    ;; of some chars for this language, so do the necessary setup for
-    ;; that.
-    ;;
-    ;; Note to other package developers: It's ok to turn this on in CC
-    ;; Mode buffers when CC Mode doesn't, but it's not ok to turn it
-    ;; off if CC Mode has turned it on.
-
-    ;; Emacs.
-    (when (boundp 'parse-sexp-lookup-properties)
-      (set (make-local-variable 'parse-sexp-lookup-properties) t))
-
-    ;; Same as above for XEmacs.
-    (when (boundp 'lookup-syntax-properties)
-      (set (make-local-variable 'lookup-syntax-properties) t)))
+  ;; We use the syntax-table text property to change the syntax of some
+  ;; chars, potentially in every language, so set this up.
+  ;; Emacs.
+  (when (boundp 'parse-sexp-lookup-properties)
+    (make-local-variable 'parse-sexp-lookup-properties)
+    (setq parse-sexp-lookup-properties t))
+  ;; Same as above for XEmacs.
+  (when (boundp 'lookup-syntax-properties)
+    (make-local-variable 'lookup-syntax-properties)
+    (setq lookup-syntax-properties t))
 
   ;; Use this in Emacs 21+ to avoid meddling with the rear-nonsticky
   ;; property on each character.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.