summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-mode.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2014-09-10 21:38:11 +0000
committerAlan Mackenzie <acm@muc.de>2014-09-10 21:38:11 +0000
commitc8b22035d67421b02c69a20d0809b732ab4c7f01 (patch)
tree06d52dd69befc22beb64bdd653c8a94561b7be97 /lisp/progmodes/cc-mode.el
parentd1bed1f79107c8377ffaea160acd815008fab4f7 (diff)
downloademacs-c8b22035d67421b02c69a20d0809b732ab4c7f01.tar.gz
CC Mode: revert recent changes and fix bug 17463 (cc-langs.elc gets
loaded at run-time). * progmodes/cc-langs.el (c-no-parens-syntax-table): Rename the c-lang-const to c-make-no-parens-syntax-table and correct the logic. (c-no-parens-syntax-table): Correct the logic of the c-lang-defvar.
Diffstat (limited to 'lisp/progmodes/cc-mode.el')
-rw-r--r--lisp/progmodes/cc-mode.el20
1 files changed, 14 insertions, 6 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 7eca7e562ea..1ce076734ff 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -95,9 +95,14 @@
(cc-require 'cc-menus)
(cc-require 'cc-guess)
+;; Silence the compiler.
+(cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
+(cc-bytecomp-defun run-mode-hooks) ; Emacs 21.1
+
;; We set these variables during mode init, yet we don't require
;; font-lock.
-(defvar font-lock-defaults)
+(cc-bytecomp-defvar font-lock-defaults)
+(cc-bytecomp-defvar font-lock-syntactic-keywords)
;; Menu support for both XEmacs and Emacs. If you don't have easymenu
;; with your version of Emacs, you are incompatible!
@@ -547,8 +552,11 @@ that requires a literal mode spec at compile time."
;; heuristic that open parens in column 0 are defun starters. Since
;; we have c-state-cache, that heuristic isn't useful and only causes
;; trouble, so turn it off.
- (when (memq 'col-0-paren c-emacs-features)
- (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil))
+;; 2006/12/17: This facility is somewhat confused, and doesn't really seem
+;; helpful. Comment it out for now.
+;; (when (memq 'col-0-paren c-emacs-features)
+;; (make-local-variable 'open-paren-in-column-0-is-defun-start)
+;; (setq open-paren-in-column-0-is-defun-start nil))
(c-clear-found-types)
@@ -808,7 +816,7 @@ Note that the style variables are always made local to the buffer."
(defmacro c-run-mode-hooks (&rest hooks)
;; Emacs 21.1 has introduced a system with delayed mode hooks that
;; requires the use of the new function `run-mode-hooks'.
- (if (fboundp 'run-mode-hooks)
+ (if (cc-bytecomp-fboundp 'run-mode-hooks)
`(run-mode-hooks ,@hooks)
`(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks))))
@@ -1224,8 +1232,8 @@ This function is called from `c-common-init', once per mode initialization."
(font-lock-mark-block-function
. c-mark-function)))
- (set (make-local-variable 'font-lock-fontify-region-function)
- #'c-font-lock-fontify-region)
+ (make-local-variable 'font-lock-fontify-region-function)
+ (setq font-lock-fontify-region-function 'c-font-lock-fontify-region)
(if (featurep 'xemacs)
(make-local-hook 'font-lock-mode-hook))