summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-engine.el14
-rw-r--r--lisp/progmodes/cc-fonts.el21
2 files changed, 20 insertions, 15 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index b2d1f15d398..94225d6e3e9 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -142,6 +142,11 @@
;; Put on the brace which introduces a brace list and on the commas
;; which separate the elements within it.
;;
+;; 'c-<>-c-types-set
+;; This property is set on an opening angle bracket, and indicates that
+;; any "," separators within the template/generic expression have been
+;; marked with a 'c-type property value 'c-<>-arg-sep (see above).
+;;
;; 'c-awk-NL-prop
;; Used in AWK mode to mark the various kinds of newlines. See
;; cc-awk.el.
@@ -6137,7 +6142,7 @@ comment at the start of cc-engine.el for more info."
(forward-char))))
(backward-char)
(if (let ((c-parse-and-markup-<>-arglists t)
- (c-restricted-<>-arglists t))
+ c-restricted-<>-arglists)
(c-forward-<>-arglist nil)) ; Should always work.
(when (> (point) to)
(setq bound-<> (point)))
@@ -8505,9 +8510,9 @@ multi-line strings (but not C++, for example)."
arg-start-pos)
;; If the '<' has paren open syntax then we've marked it as an angle
;; bracket arglist before, so skip to the end.
- (if (and (not c-parse-and-markup-<>-arglists)
- syntax-table-prop-on-<)
-
+ (if (and syntax-table-prop-on-<
+ (or (not c-parse-and-markup-<>-arglists)
+ (c-get-char-property (point) 'c-<>-c-types-set)))
(progn
(forward-char)
(if (and (c-go-up-list-forward)
@@ -8604,6 +8609,7 @@ multi-line strings (but not C++, for example)."
(c-unmark-<->-as-paren (point)))))
(c-mark-<-as-paren start)
(c-mark->-as-paren (1- (point)))
+ (c-put-char-property start 'c-<>-c-types-set t)
(c-truncate-lit-pos-cache start))
(setq res t)
nil)) ; Exit the loop.
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 12bb3d37513..f34f7f177db 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -934,17 +934,16 @@ casts and declarations are fontified. Used on level 2 and higher."
(save-excursion
(let ((pos (point)))
(c-backward-syntactic-ws (max (- (point) 500) (point-min)))
- (c-clear-char-properties
- (if (and (not (bobp))
- (memq (c-get-char-property (1- (point)) 'c-type)
- '(c-decl-arg-start
- c-decl-end
- c-decl-id-start
- c-decl-type-start
- c-not-decl)))
- (1- (point))
- pos)
- limit 'c-type)))
+ (when (and (not (bobp))
+ (memq (c-get-char-property (1- (point)) 'c-type)
+ '(c-decl-arg-start
+ c-decl-end
+ c-decl-id-start
+ c-decl-type-start
+ c-not-decl)))
+ (setq pos (1- (point))))
+ (c-clear-char-properties pos limit 'c-type)
+ (c-clear-char-properties pos limit 'c-<>-c-types-set)))
;; Update `c-state-cache' to the beginning of the region. This will
;; make `c-beginning-of-syntax' go faster when it's used later on,