From: Alan Mackenzie Date: Fri, 25 Jan 2013 18:18:14 +0000 (+0000) Subject: AWK Mode: Fix indentation bug at top level. Bug #12274. X-Git-Tag: emacs-24.3.90~173^2~7^2~215 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b7aea0ffb633e0787654d2c570a8a2fa63703f18;p=emacs.git AWK Mode: Fix indentation bug at top level. Bug #12274. progmodes/cc-engine.el (c-guess-basic-syntax): Move CASE 5P to just before CASE 5D. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e94ec32147..eb9f254a5a8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-01-25 Alan Mackenzie + + AWK Mode: Fix indentation bug at top level. Bug #12274. + + * progmodes/cc-engine.el (c-guess-basic-syntax): Move CASE 5P to + just before CASE 5D. + 2013-01-25 Dmitry Antipov * net/socks.el (socks-nslookup-host): Use string-to-number. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 1eac45d06e0..d4e4d6de483 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -9842,6 +9842,18 @@ comment at the start of cc-engine.el for more info." ;; contains any class offset ))) + ;; CASE 5P: AWK pattern or function or continuation + ;; thereof. + ((c-major-mode-is 'awk-mode) + (setq placeholder (point)) + (c-add-stmt-syntax + (if (and (eq (c-beginning-of-statement-1) 'same) + (/= (point) placeholder)) + 'topmost-intro-cont + 'topmost-intro) + nil nil + containing-sexp paren-state)) + ;; CASE 5D: this could be a top-level initialization, a ;; member init list continuation, or a template argument ;; list continuation. @@ -10001,18 +10013,6 @@ comment at the start of cc-engine.el for more info." (goto-char (point-min))) (c-add-syntax 'objc-method-intro (c-point 'boi))) - ;; CASE 5P: AWK pattern or function or continuation - ;; thereof. - ((c-major-mode-is 'awk-mode) - (setq placeholder (point)) - (c-add-stmt-syntax - (if (and (eq (c-beginning-of-statement-1) 'same) - (/= (point) placeholder)) - 'topmost-intro-cont - 'topmost-intro) - nil nil - containing-sexp paren-state)) - ;; CASE 5N: At a variable declaration that follows a class ;; definition or some other block declaration that doesn't ;; end at the closing '}'. C.f. case 5D.5.