# HG changeset patch # User Alan Mackenzie # Date 1169407791 0 # Node ID 9848399916bc367fad4ee0c32df5acf8c020f83f # Parent 7a7888bbf03db2bb27250d7b0521dfafe90a967a Correct the handling of K&R stuff in c-where-wrt-brace-construct. diff -r 7a7888bbf03d -r 9848399916bc lisp/progmodes/cc-cmds.el --- a/lisp/progmodes/cc-cmds.el Sun Jan 21 19:24:06 2007 +0000 +++ b/lisp/progmodes/cc-cmds.el Sun Jan 21 19:29:51 2007 +0000 @@ -1383,8 +1383,7 @@ ;; ;; This function might do hidden buffer changes. (save-excursion - (let* (pos - kluge-start + (let* (kluge-start decl-result brace-decl-p (start (point)) (paren-state (c-parse-state)) @@ -1417,11 +1416,12 @@ (setq kluge-start (point)) (setq decl-result (car (c-beginning-of-decl-1 + ;; NOTE: If we're in a K&R region, this might be the start + ;; of a parameter declaration, not the actual function. (and least-enclosing ; LIMIT for c-b-of-decl-1 (c-safe-position least-enclosing paren-state))))) ;; Has the declaration we've gone back to got braces? - (setq pos (point)) ; the search limit for c-recognize-knr-p (setq brace-decl-p (save-excursion (and (c-syntactic-re-search-forward "[;{]" nil t t) @@ -1431,7 +1431,7 @@ ;; ';' in a K&R argdecl. In ;; that case the declaration ;; should contain a block. - (c-in-knr-argdecl pos)))))) + (c-in-knr-argdecl)))))) (cond ((= (point) kluge-start) ; might be BOB or unbalanced parens.