]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-guess-basic-syntax, CASE 5A.5): Anchor the "{" of a template function
authorAlan Mackenzie <acm@muc.de>
Tue, 29 Jan 2008 20:17:44 +0000 (20:17 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 29 Jan 2008 20:17:44 +0000 (20:17 +0000)
correctly on "template", not the following "<".

lisp/progmodes/cc-engine.el

index 929b000b83f758cf9be4cd022d5dd8d910417951..77b43657050d3e6b3072ac0ce945d6875b3bcfe2 100644 (file)
@@ -8030,12 +8030,15 @@ comment at the start of cc-engine.el for more info."
 
             ;; CASE 5A.5: ordinary defun open
             (t
-             (goto-char placeholder)
-             (if (or containing-decl-open macro-start)
-                 (c-add-syntax 'defun-open (c-point 'boi))
-               ;; Bogus to use bol here, but it's the legacy.
-               (c-add-syntax 'defun-open (c-point 'bol)))
-             )))
+             (save-excursion
+               (c-beginning-of-decl-1 lim)
+               (while (looking-at c-specifier-key)
+                 (goto-char (match-end 1))
+                 (c-forward-syntactic-ws indent-point))
+               (c-add-syntax 'defun-open (c-point 'boi))
+               ;; Bogus to use bol here, but it's the legacy.  (Resolved,
+               ;; 2007-11-09)
+               ))))
 
           ;; CASE 5B: After a function header but before the body (or
           ;; the ending semicolon if there's no body).