summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2007-07-28 11:51:38 +0000
committerAlan Mackenzie <acm@muc.de>2007-07-28 11:51:38 +0000
commit3d38de912c3e88b885e7d4b36d59276a07f19f2a (patch)
treecbf56f1ec752868d906b70da4d2faf147e0f0a95
parentd445096897022e3c326ebbe912f6255b337bc5cf (diff)
downloademacs-3d38de912c3e88b885e7d4b36d59276a07f19f2a.tar.gz
emacs-3d38de912c3e88b885e7d4b36d59276a07f19f2a.tar.bz2
emacs-3d38de912c3e88b885e7d4b36d59276a07f19f2a.zip
Fix problem with modes derived from CC Mode: Move macro
`c-make-emacs-variables-local' from cc-mode.el to cc-langs.el. Call it from c-make-init-lang-vars-fun (cc-langs.el) instead of c-init-language-vars-for (cc-mode.el).
-rw-r--r--lisp/progmodes/cc-langs.el10
-rw-r--r--lisp/progmodes/cc-mode.el9
2 files changed, 10 insertions, 9 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 9c749c11b6a..c5d9c162520 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -2875,6 +2875,14 @@ way."
(defconst c-lang-variable-inits (cc-eval-when-compile c-lang-variable-inits))
(defconst c-emacs-variable-inits (cc-eval-when-compile c-emacs-variable-inits))
+;; Make the `c-lang-setvar' variables buffer local in the current buffer.
+;; These are typically standard emacs variables such as `comment-start'.
+(defmacro c-make-emacs-variables-local ()
+ `(progn
+ ,@(mapcar (lambda (init)
+ `(make-local-variable ',(car init)))
+ (cdr c-emacs-variable-inits))))
+
(defun c-make-init-lang-vars-fun (mode)
"Create a function that initializes all the language dependent variables
for the given mode.
@@ -2898,6 +2906,7 @@ accomplish that conveniently."
;; that could be in the result from `cl-macroexpand-all'.
(let ((c-buffer-is-cc-mode ',mode)
current-var source-eval)
+ (c-make-emacs-variables-local)
(condition-case err
(if (eq c-version-sym ',c-version-sym)
@@ -2956,6 +2965,7 @@ accomplish that conveniently."
(init (append (cdr c-emacs-variable-inits)
(cdr c-lang-variable-inits)))
current-var)
+ (c-make-emacs-variables-local)
(condition-case err
(while init
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index f201f9bab6c..8669a41c2f0 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -154,21 +154,12 @@
(defun c-leave-cc-mode-mode ()
(setq c-buffer-is-cc-mode nil))
-;; Make the `c-lang-setvar' variables buffer local in the current buffer.
-;; These are typically standard emacs variables such as `comment-start'.
-(defmacro c-make-emacs-variables-local ()
- `(progn
- ,@(mapcar (lambda (init)
- `(make-local-variable ',(car init)))
- (cdr c-emacs-variable-inits))))
-
(defun c-init-language-vars-for (mode)
"Initialize the language variables for one of the language modes
directly supported by CC Mode. This can be used instead of the
`c-init-language-vars' macro if the language you want to use is one of
those, rather than a derived language defined through the language
variable system (see \"cc-langs.el\")."
- (c-make-emacs-variables-local)
(cond ((eq mode 'c-mode) (c-init-language-vars c-mode))
((eq mode 'c++-mode) (c-init-language-vars c++-mode))
((eq mode 'objc-mode) (c-init-language-vars objc-mode))