(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.
;; 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)
(init (append (cdr c-emacs-variable-inits)
(cdr c-lang-variable-inits)))
current-var)
+ (c-make-emacs-variables-local)
(condition-case err
(while init
(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))