Commit 47003633 authored by Stefan Monnier's avatar Stefan Monnier

CC-mode: Set open-paren-in-column-0-is-defun-start to nil;

plus misc cleanup.
* lisp/progmodes/cc-mode.el (c-basic-common-init):
Set open-paren-in-column-0-is-defun-start.
(adaptive-fill-first-line-regexp, font-lock-syntactic-keywords):
Remove declarations, unused.
(run-mode-hooks): Remove declaration.
(font-lock-defaults): Use plain `defvar' to declare.
(c-run-mode-hooks): Test existence of run-mode-hooks with fboundp.
* lisp/progmodes/cc-langs.el (c-filter-ops): Avoid `setq'.
(c-make-mode-syntax-table): Don't micro-optimize.
(c-keywords, c-keyword-member-alist): Simplify.
(c-kwds-lang-consts): Don't eval at compile-time.
(c-primary-expr-regexp): Comment out unused vars.
* lisp/progmodes/cc-fonts.el (c-font-lock-context): Declare at top-level.
(c-font-byte-compile): New var.
(c--compile): New function.  Use it instead of `byte-compile'.
(c-cpp-matchers): Quote the value returned by
`c-make-syntactic-matcher' in case it's not self-evaluating.
(c-basic-matchers-before): Avoid a plain MATCHER as keyword, wrap it in
parentheses instead (in case MATCHER happens to be a list).
(c-font-lock-enum-tail): Remove unused var `start'.
(c-font-lock-objc-methods): Silence byte-compiler warnings.
* lisp/progmodes/cc-engine.el (c-syntactic-re-search-forward): Sink an `if'
test into an argument.
* lisp/progmodes/cc-defs.el (c-point, c-major-mode-is, c-put-char-property)
(c-get-char-property): Don't use `eval' just to unquote a constant.
(c-use-extents): Remove.  Use (featurep 'xemacs), compiled
more efficiently.
(c-put-char-property-fun): Don't call `byte-compile' by hand.
(c-clear-char-property, c-clear-char-properties): Check that `property'
is a quoted constant.
(c-emacs-features): Remove `infodock', `syntax-properties', and
`pps-extended-state' (never used), `8-bit' and `1-bit' (use (featurep
'xemacs) instead).  Use `with-temp-buffer' and let-bind vars after
changing buffer, so we don't have to setq them again afterwards.
(c-lang-const): Remove redundant symbolp assertions.
(c-find-assignment-for-mode): Use `or'.
* lisp/Makefile.in (compile-one-process): Remove cc-mode dependency.
parent a2dcba1c
2014-09-10 Stefan Monnier <monnier@iro.umontreal.ca>
CC-mode: Set open-paren-in-column-0-is-defun-start to nil;
plus misc cleanup.
* progmodes/cc-mode.el (c-basic-common-init):
Set open-paren-in-column-0-is-defun-start.
(adaptive-fill-first-line-regexp, font-lock-syntactic-keywords):
Remove declarations, unused.
(run-mode-hooks): Remove declaration.
(font-lock-defaults): Use plain `defvar' to declare.
(c-run-mode-hooks): Test existence of run-mode-hooks with fboundp.
* progmodes/cc-langs.el (c-filter-ops): Avoid `setq'.
(c-make-mode-syntax-table): Don't micro-optimize.
(c-keywords, c-keyword-member-alist): Simplify.
(c-kwds-lang-consts): Don't eval at compile-time.
(c-primary-expr-regexp): Comment out unused vars.
* progmodes/cc-fonts.el (c-font-lock-context): Declare at top-level.
(c-font-byte-compile): New var.
(c--compile): New function. Use it instead of `byte-compile'.
(c-cpp-matchers): Quote the value returned by
`c-make-syntactic-matcher' in case it's not self-evaluating.
(c-basic-matchers-before): Avoid a plain MATCHER as keyword, wrap it in
parentheses instead (in case MATCHER happens to be a list).
(c-font-lock-enum-tail): Remove unused var `start'.
(c-font-lock-objc-methods): Silence byte-compiler warnings.
* progmodes/cc-engine.el (c-syntactic-re-search-forward): Sink an `if'
test into an argument.
* progmodes/cc-defs.el (c-point, c-major-mode-is, c-put-char-property)
(c-get-char-property): Don't use `eval' just to unquote a constant.
(c-use-extents): Remove. Use (featurep 'xemacs), compiled
more efficiently.
(c-put-char-property-fun): Don't call `byte-compile' by hand.
(c-clear-char-property, c-clear-char-properties): Check that `property'
is a quoted constant.
(c-emacs-features): Remove `infodock', `syntax-properties', and
`pps-extended-state' (never used), `8-bit' and `1-bit' (use (featurep
'xemacs) instead). Use `with-temp-buffer' and let-bind vars after
changing buffer, so we don't have to setq them again afterwards.
(c-lang-const): Remove redundant symbolp assertions.
(c-find-assignment-for-mode): Use `or'.
* Makefile.in (compile-one-process): Remove cc-mode dependency.
2014-09-09 Sam Steingold <sds@gnu.org>
* progmodes/sql.el (sql-default-directory): Fix type annotation.
......
......@@ -387,7 +387,7 @@ compile-after-backup: backup-compiled-files compile-always
# There is no reason to use this rule unless you only have a single
# core and CPU time is an issue.
.PHONY: compile-one-process
compile-one-process: $(LOADDEFS) compile-first $(lisp)/progmodes/cc-mode.elc
compile-one-process: $(LOADDEFS) compile-first
$(emacs) $(BYTE_COMPILE_FLAGS) \
--eval "(batch-byte-recompile-directory 0)" $(lisp)
......
This diff is collapsed.
......@@ -2222,6 +2222,8 @@ comment at the start of cc-engine.el for more info."
((and (not not-in-delimiter) ; inside a comment starter
(not (bobp))
(progn (backward-char)
;; FIXME: We never add category-properties to
;; c-emacs-features!
(and (not (and (memq 'category-properties c-emacs-features)
(looking-at "\\s!")))
(looking-at c-comment-start-regexp))))
......@@ -4119,10 +4121,10 @@ comment at the start of cc-engine.el for more info."
(c-end-of-current-token last-token-end-pos))
(setq last-token-end-pos (point))))))
;; Inside a token.
(if lookbehind-submatch
;; See the NOTE above.
(goto-char state-pos)
(goto-char (min last-token-end-pos bound))))
(goto-char (if lookbehind-submatch
;; See the NOTE above.
state-pos
(min last-token-end-pos bound))))
(t
;; A real match.
......
This diff is collapsed.
This diff is collapsed.
......@@ -95,14 +95,9 @@
(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.
(cc-bytecomp-defvar font-lock-defaults)
(cc-bytecomp-defvar font-lock-syntactic-keywords)
(defvar font-lock-defaults)
;; Menu support for both XEmacs and Emacs. If you don't have easymenu
;; with your version of Emacs, you are incompatible!
......@@ -552,11 +547,8 @@ 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.
;; 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))
(when (memq 'col-0-paren c-emacs-features)
(set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil))
(c-clear-found-types)
......@@ -816,7 +808,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 (cc-bytecomp-fboundp 'run-mode-hooks)
(if (fboundp 'run-mode-hooks)
`(run-mode-hooks ,@hooks)
`(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks))))
......@@ -1232,8 +1224,8 @@ This function is called from `c-common-init', once per mode initialization."
(font-lock-mark-block-function
. c-mark-function)))
(make-local-variable 'font-lock-fontify-region-function)
(setq font-lock-fontify-region-function 'c-font-lock-fontify-region)
(set (make-local-variable 'font-lock-fontify-region-function)
#'c-font-lock-fontify-region)
(if (featurep 'xemacs)
(make-local-hook 'font-lock-mode-hook))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment