aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2014-11-22 21:41:00 +0000
committerAlan Mackenzie2014-11-22 21:41:00 +0000
commitec02f4fe1d5ac0f7e306872434f96fcdfe00aead (patch)
tree73a0ebf549bf120ebf905d0ba7affc69e7ea64bd
parentcc252fc141482e64f8824967449f1076a6feb540 (diff)
downloademacs-ec02f4fe1d5ac0f7e306872434f96fcdfe00aead.tar.gz
emacs-ec02f4fe1d5ac0f7e306872434f96fcdfe00aead.zip
Fix error with `mark-defun' and "protected:" in C++ Mode.
Fixes: debbugs:19134. progmodes/cc-cmds.el (c-where-wrt-brace-construct): Handle a return code of (label) from c-beginning-of-decl-1.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/progmodes/cc-cmds.el12
2 files changed, 16 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4c7b58341dd..422336332bf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12014-11-22 Alan Mackenzie <acm@muc.de>
2
3 Fix error with `mark-defun' and "protected:" in C++ Mode.
4 Fixes: debbugs:19134.
5
6 * progmodes/cc-cmds.el (c-where-wrt-brace-construct): Handle a
7 return code of (label) from c-beginning-of-decl-1.
8
12014-11-22 Ulf Jasper <ulf.jasper@web.de> 92014-11-22 Ulf Jasper <ulf.jasper@web.de>
2 10
3 * net/newst-backend.el (newsticker--sentinel-work): Tell 11 * net/newst-backend.el (newsticker--sentinel-work): Tell
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 5fa3b25401e..50cdd78ec36 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1417,12 +1417,15 @@ No indentation or other \"electric\" behavior is performed."
1417 (car (c-beginning-of-decl-1 1417 (car (c-beginning-of-decl-1
1418 ;; NOTE: If we're in a K&R region, this might be the start 1418 ;; NOTE: If we're in a K&R region, this might be the start
1419 ;; of a parameter declaration, not the actual function. 1419 ;; of a parameter declaration, not the actual function.
1420 ;; It might also leave us at a label or "label" like
1421 ;; "private:".
1420 (and least-enclosing ; LIMIT for c-b-of-decl-1 1422 (and least-enclosing ; LIMIT for c-b-of-decl-1
1421 (c-safe-position least-enclosing paren-state))))) 1423 (c-safe-position least-enclosing paren-state)))))
1422 1424
1423 ;; Has the declaration we've gone back to got braces? 1425 ;; Has the declaration we've gone back to got braces?
1424 (setq brace-decl-p 1426 (or (eq decl-result 'label)
1425 (save-excursion 1427 (setq brace-decl-p
1428 (save-excursion
1426 (and (c-syntactic-re-search-forward "[;{]" nil t t) 1429 (and (c-syntactic-re-search-forward "[;{]" nil t t)
1427 (or (eq (char-before) ?\{) 1430 (or (eq (char-before) ?\{)
1428 (and c-recognize-knr-p 1431 (and c-recognize-knr-p
@@ -1430,10 +1433,11 @@ No indentation or other \"electric\" behavior is performed."
1430 ;; ';' in a K&R argdecl. In 1433 ;; ';' in a K&R argdecl. In
1431 ;; that case the declaration 1434 ;; that case the declaration
1432 ;; should contain a block. 1435 ;; should contain a block.
1433 (c-in-knr-argdecl)))))) 1436 (c-in-knr-argdecl)))))))
1434 1437
1435 (cond 1438 (cond
1436 ((= (point) kluge-start) ; might be BOB or unbalanced parens. 1439 ((or (eq decl-result 'label) ; e.g. "private:" or invalid syntax.
1440 (= (point) kluge-start)) ; might be BOB or unbalanced parens.
1437 'outwith-function) 1441 'outwith-function)
1438 ((eq decl-result 'same) 1442 ((eq decl-result 'same)
1439 (if brace-decl-p 1443 (if brace-decl-p