summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/generic-x.el24
2 files changed, 20 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1e8165a0a1e..dab13ce7e4d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2013-09-04 Glenn Morris <rgm@gnu.org>
+
+ * generic-x.el [rul-generic-mode]: Require cc-mode.
+ (c++-mode-syntax-table): Declare.
+ (rul-generic-mode-syntax-table): Init in the defvar.
+
2013-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
* autorevert.el (auto-revert-notify-handler): Explicitly ignore
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index c964b53952e..e722333d49b 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -1283,18 +1283,22 @@ like an INI file. You can add this hook to `find-file-hook'."
"WIN32SMINOR")
"Function argument constants used in InstallShield 3 and 5."))
-(defvar rul-generic-mode-syntax-table nil
+;; c++-mode-syntax-table used to be autoloaded, with an initial nil value.
+;; This file did not load cc-mode, and therefore rul-generic-mode-syntax-table
+;; would have different values according to whether or not cc-mode
+;; happened to be loaded before this file was.
+(require 'cc-mode)
+(defvar c++-mode-syntax-table)
+
+(defvar rul-generic-mode-syntax-table
+ (let ((table (make-syntax-table c++-mode-syntax-table)))
+ (modify-syntax-entry ?\r "> b" table)
+ (modify-syntax-entry ?\n "> b" table)
+ (modify-syntax-entry ?/ ". 124b" table)
+ (modify-syntax-entry ?* ". 23" table)
+ table)
"Syntax table to use in `rul-generic-mode' buffers.")
-(setq rul-generic-mode-syntax-table
- (make-syntax-table c++-mode-syntax-table))
-
-(modify-syntax-entry ?\r "> b" rul-generic-mode-syntax-table)
-(modify-syntax-entry ?\n "> b" rul-generic-mode-syntax-table)
-
-(modify-syntax-entry ?/ ". 124b" rul-generic-mode-syntax-table)
-(modify-syntax-entry ?* ". 23" rul-generic-mode-syntax-table)
-
;; here manually instead
(defun generic-rul-mode-setup-function ()
(make-local-variable 'parse-sexp-ignore-comments)