summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-vars.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-12-01 15:06:49 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-12-01 15:06:49 -0500
commit517505322a965a042d2d05385a25f7c13704e022 (patch)
tree4dc8d0ff2b1a3048f3584aaffd60ae17fc82336b /lisp/progmodes/cc-vars.el
parent808699f13673a881949ab94d3c0e87f5ba9cd4cf (diff)
downloademacs-517505322a965a042d2d05385a25f7c13704e022.tar.gz
Merge some of the differences from the standalone CC-mode.
The main change is to only use the `category' text-property only when available. For that many calls are changed to use c-get-char-property, c-next-single-property-change, c-sc-scan-lists, c-sc-parse-partial-sexp, c-unmark-<->-as-paren. * lisp/progmodes/cc-align.el (c-lineup-respect-col-0): New function. * lisp/progmodes/cc-cmds.el (c-forward-into-nomenclature) (c-backward-into-nomenclature): Use cc-subword if subword-mode is not available. (c-beginning-of-defun, c-end-of-defun, c-mark-function) (c-indent-line-or-region): Use c-region-is-active-p. * lisp/progmodes/cc-defs.el (c-version): Bump up to 5.33. (c-use-category): New const. (c-next-single-property-change): New macro. (c-region-is-active-p): Prefer region-active-p when available. (c-search-backward-char-property): Fix old min/max typo; probably a copy/paste error. (c-mark-<-as-paren, c-mark->-as-paren, c-unmark-<->-as-paren): Turn them into macros that obey c-use-category. (c-sc-scan-lists-no-category+1+1, c-sc-scan-lists-no-category+1-1) (c-sc-scan-lists-no-category-1+1, c-sc-scan-lists-no-category-1-1) (c-sc-scan-lists, c-sc-parse-partial-sexp) (c-looking-at-non-alphnumspace): New macros. (c-sc-parse-partial-sexp-no-category): New function. (c-emacs-features): Add `category-properties' element. * lisp/progmodes/cc-engine.el (c-invalidate-state-cache, c-parse-state): Handle the case where categories are not available. (c-record-parse-state-state, c-replay-parse-state-state): Handle marker values. (c-before-change-check-<>-operators): Look for the `syntax-table' property rather than for the corresponding `category'. (c-looking-at-decl-block): Remove unused var `c-disallow-comma-in-<>-arglists'. (c-forward-<>-arglist-recur): Remove unused var `orig-record-found-types'. * lisp/progmodes/cc-langs.el (c-modified-constant): New lang var. (c-known-type-key): Don't make a list just to throw it away. * lisp/progmodes/cc-bytecomp.el (cc-bytecomp-unbound-variables) (cc-bytecomp-original-functions, cc-bytecomp-original-properties) (cc-bytecomp-loaded-files): Re-set each time the file is loaded. (cc-bytecomp-obsolete-var, cc-bytecomp-ignore-obsolete) (cc-bytecomp-obsolete-fun): Delete unused functions. * lisp/progmodes/cc-mode.el (c-just-done-before-change): New var. (c-basic-common-init): Initialize it. (c-common-init): Only use mode-require-final-newline when available. (c-before-change): Check and set c-just-done-before-change. (c-after-change): Re-set c-just-done-before-change. (c-advise-fl-for-region): New macro. (lazy-lock-defer-rest-after-change, lazy-lock-defer-line-after-change) (font-lock-after-change-function, jit-lock-after-change): Advise if needed.
Diffstat (limited to 'lisp/progmodes/cc-vars.el')
-rw-r--r--lisp/progmodes/cc-vars.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index ac8dbfc4c45..635e382c755 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -271,12 +271,13 @@ nil."
:group 'c)
;;;###autoload(put 'c-basic-offset 'safe-local-variable 'integerp)
+
(defcustom c-tab-always-indent t
"*Controls the operation of the TAB key.
If t, hitting TAB always just indents the current line. If nil, hitting
TAB indents the current line if point is at the left margin or in the
line's indentation, otherwise it inserts a `real' tab character \(see
-note\). If some other value (not nil or t), then tab is inserted only
+note\). If some other value (not nil or t), then tab is inserted only
within literals \(comments and strings), but the line is always
reindented.
@@ -540,7 +541,7 @@ variable in a mode hook."
(const :format "IDL " idl-mode) (regexp :format "%v"))
(cons :format "%v"
(const :format "Pike " pike-mode) (regexp :format "%v"))
- (cons :format "%v"
+ (cons :format "%v"
(const :format "AWK " awk-mode) (regexp :format "%v")))
(cons :format " %v"
(const :format "Other " other) (regexp :format "%v"))))
@@ -1175,7 +1176,7 @@ can always override the use of `c-default-style' by making calls to
(objc-method-args-cont . c-lineup-ObjC-method-args)
;; Anchor pos: At the method start (always at boi).
(objc-method-call-cont . (c-lineup-ObjC-method-call-colons
- c-lineup-ObjC-method-call +))
+ c-lineup-ObjC-method-call +))
;; Anchor pos: At the open bracket.
(extern-lang-open . 0)
(namespace-open . 0)
@@ -1771,4 +1772,8 @@ It treats escaped EOLs as whitespace.")
(cc-provide 'cc-vars)
+;;; Local Variables:
+;;; indent-tabs-mode: t
+;;; tab-width: 8
+;;; End:
;;; cc-vars.el ends here