]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-align.el
(msdos-shells): Add defvar.
[gnu-emacs] / lisp / progmodes / cc-align.el
index c5dd091f29194d468ca28d7f8f766a5456831b26..36b4fd2545cd0da43c4f7704bdf5f55ba37711c7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cc-align.el --- custom indentation functions for CC Mode
 
-;; Copyright (C) 1985,1987,1992-2003 Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2003, 2004, 2005 Free Software Foundation, Inc.
 
 ;; Authors:    1998- Martin Stjernholm
 ;;             1992-1999 Barry A. Warsaw
@@ -24,9 +24,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with this program; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -158,7 +158,7 @@ foo (xyz, aaa + bbb + ccc
 Only continuation lines like this are touched, nil is returned on lines
 which are the start of an argument.
 
-Within a gcc asm block, \":\" is recognised as an argument separator,
+Within a gcc asm block, \":\" is recognized as an argument separator,
 but of course only between operand specifications, not in the expressions
 for the operands.
 
@@ -175,7 +175,8 @@ Works with: arglist-cont, arglist-cont-nonempty."
       (let ((open-paren (elt c-syntactic-element 2))
            (paren-state (c-parse-state)))
        (while (not (eq (car paren-state) open-paren))
-         (goto-char (car paren-state))
+         (unless (consp (car paren-state)) ;; ignore matched braces
+           (goto-char (car paren-state)))
          (setq paren-state (cdr paren-state)))))
 
     (let ((start (point)) c)
@@ -1171,6 +1172,7 @@ Otherwise, no determination is made."
             ;;(/= (point-max)
             ;;    (save-excursion (skip-syntax-forward " ") (point))
             (zerop (forward-line 1))
+            (bolp)                     ; forward-line has funny behavior at eob.
             (not (looking-at "^[ \t]*$")))
        'stop
       nil)))