aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2014-08-24 20:38:11 +0000
committerAlan Mackenzie2014-08-24 20:38:11 +0000
commit66bb9533fc77963c495de7f33ec6dc8e4d342a55 (patch)
tree672208bbf8ba6c8adfaba88b4b47dc6e02c0f720
parent849abe1dc11852666082627c5c385d682e9eca47 (diff)
downloademacs-66bb9533fc77963c495de7f33ec6dc8e4d342a55.tar.gz
emacs-66bb9533fc77963c495de7f33ec6dc8e4d342a55.zip
Make ">>" act as double template ender in C++ Mode.
cc-langs.el (c->-op-cont-tokens): New lang-const split off from c->-op-cont-re. (c->-op-cont-tokens): Change to use the above. (c->-op-without->-cont-regexp): New lang-const. cc-engine.el (c-forward-<>-arglist-recur): Use c->-op-without->-cont-regexp in place of c->-op-cont-tokens.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/progmodes/cc-engine.el2
-rw-r--r--lisp/progmodes/cc-langs.el39
3 files changed, 41 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 920eea268f4..5b1c0b1b386 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12014-08-24 Alan Mackenzie <acm@muc.de>
2
3 Make ">>" act as double template ender in C++ Mode.
4 * progmodes/cc-langs.el (c->-op-cont-tokens): New lang-const split
5 off from c->-op-cont-re.
6 (c->-op-cont-tokens): Change to use the above.
7 (c->-op-without->-cont-regexp): New lang-const.
8 * progmodes/cc-engine.el (c-forward-<>-arglist-recur): Use
9 c->-op-without->-cont-regexp in place of c->-op-cont-tokens.
10
11
12014-08-23 Alan Mackenzie <acm@muc.de> 122014-08-23 Alan Mackenzie <acm@muc.de>
2 13
3 * progmodes/cc-fonts.el (c-font-lock-declarators): Fix infinite 14 * progmodes/cc-fonts.el (c-font-lock-declarators): Fix infinite
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 626e131ed22..8283bb38eae 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -5944,7 +5944,7 @@ comment at the start of cc-engine.el for more info."
5944 ;; Either an operator starting with '>' or the end of 5944 ;; Either an operator starting with '>' or the end of
5945 ;; the angle bracket arglist. 5945 ;; the angle bracket arglist.
5946 5946
5947 (if (looking-at c->-op-cont-regexp) 5947 (if (looking-at c->-op-without->-cont-regexp)
5948 (progn 5948 (progn
5949 (goto-char (match-end 0)) 5949 (goto-char (match-end 0))
5950 t) ; Continue the loop. 5950 t) ; Continue the loop.
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 42b6f5964c2..2bf660a32eb 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1217,22 +1217,41 @@ operators."
1217 1217
1218(c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp)) 1218(c-lang-defvar c-<-op-cont-regexp (c-lang-const c-<-op-cont-regexp))
1219 1219
1220(c-lang-defconst c->-op-cont-tokens
1221 ;; A list of second and subsequent characters of all multicharacter tokens
1222 ;; that begin with ">".
1223 t (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
1224 t
1225 "\\`>."
1226 (lambda (op) (substring op 1)))
1227 java (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
1228 t
1229 "\\`>[^>]\\|\\`>>[^>]"
1230 (lambda (op) (substring op 1))))
1231
1220(c-lang-defconst c->-op-cont-regexp 1232(c-lang-defconst c->-op-cont-regexp
1221 ;; Regexp matching the second and subsequent characters of all 1233 ;; Regexp matching the second and subsequent characters of all
1222 ;; multicharacter tokens that begin with ">". 1234 ;; multicharacter tokens that begin with ">".
1223 t (c-make-keywords-re nil 1235 t (c-make-keywords-re nil (c-lang-const c->-op-cont-tokens)))
1224 (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
1225 t
1226 "\\`>."
1227 (lambda (op) (substring op 1))))
1228 java (c-make-keywords-re nil
1229 (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
1230 t
1231 "\\`>[^>]\\|\\`>>[^>]"
1232 (lambda (op) (substring op 1)))))
1233 1236
1234(c-lang-defvar c->-op-cont-regexp (c-lang-const c->-op-cont-regexp)) 1237(c-lang-defvar c->-op-cont-regexp (c-lang-const c->-op-cont-regexp))
1235 1238
1239(c-lang-defconst c->-op-without->-cont-regexp
1240 ;; Regexp matching the second and subsequent characters of all
1241 ;; multicharacter tokens that begin with ">" except for those beginning with
1242 ;; ">>".
1243 t (c-make-keywords-re nil
1244 (set-difference
1245 (c-lang-const c->-op-cont-tokens)
1246 (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
1247 t
1248 "\\`>>"
1249 (lambda (op) (substring op 1)))
1250 :test 'string-equal)))
1251
1252(c-lang-defvar c->-op-without->-cont-regexp
1253 (c-lang-const c->-op-without->-cont-regexp))
1254
1236(c-lang-defconst c-stmt-delim-chars 1255(c-lang-defconst c-stmt-delim-chars
1237 ;; The characters that should be considered to bound statements. To 1256 ;; The characters that should be considered to bound statements. To
1238 ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to 1257 ;; optimize `c-crosses-statement-barrier-p' somewhat, it's assumed to