emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/cc-cmds.el,v


From: Alan Mackenzie
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/cc-cmds.el,v
Date: Tue, 07 Oct 2008 13:14:18 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Alan Mackenzie <acmacm> 08/10/07 13:14:18

Index: cc-cmds.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-cmds.el,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- cc-cmds.el  6 May 2008 07:18:11 -0000       1.72
+++ cc-cmds.el  7 Oct 2008 13:14:17 -0000       1.73
@@ -3096,8 +3096,8 @@
                    (c-parsing-error nil)
                    ;; shut up any echo msgs on indiv lines
                    (c-echo-syntactic-information-p nil)
-                   (in-macro (and c-auto-align-backslashes
-                                  (c-save-buffer-state ()
+                   (macro-start
+                    (and (c-save-buffer-state ()
                                     (save-excursion (c-beginning-of-macro)))
                                   start))
                    (c-fix-backslashes nil)
@@ -3105,37 +3105,32 @@
                (unwind-protect
                    (progn
                      (c-progress-init start end 'c-indent-region)
-                     (while (and (bolp)
+
+                     (while (and (bolp) ;; One line each time round the loop.
                                  (not (eobp))
                                  (< (point) endmark))
                        ;; update progress
                        (c-progress-update)
                        ;; skip empty lines
-                       (skip-chars-forward " \t\n")
-                       (beginning-of-line)
+                       (unless (or (looking-at "\\s *$")
+                                   (and macro-start (looking-at "\\s *\\\\$")))
                        ;; Get syntax and indent.
                        (c-save-buffer-state nil
                          (setq syntax (c-guess-basic-syntax)))
-                       (if (and c-auto-align-backslashes
-                                (assq 'cpp-macro syntax))
-                           ;; Record macro start.
-                           (setq in-macro (point)))
-                       (if in-macro
-                           (if (looking-at "\\s *\\\\$")
-                               (forward-line)
-                             (c-indent-line syntax t t)
-                             (if (progn (end-of-line)
-                                        (not (eq (char-before) ?\\)))
-                                 (progn
+                         (c-indent-line syntax t t))
+
+                       (if (assq 'cpp-macro syntax) ; New macro?
+                           (setq macro-start (point))
+                         (when (and macro-start ; End of old macro?
+                                    c-auto-align-backslashes
+                                    (not (eq (char-before (c-point 'eol)) 
?\\)))
                                    ;; Fixup macro backslashes.
-                                   (forward-line)
-                                   (c-backslash-region in-macro (point) nil)
-                                   (setq in-macro nil))
-                               (forward-line)))
-                         (c-indent-line syntax t t)
-                         (forward-line)))
-                     (if in-macro
-                         (c-backslash-region in-macro (c-point 'bopl) nil t)))
+                           (c-backslash-region macro-start (c-point 'bonl) nil)
+                           (setq macro-start nil)))
+                       (forward-line))
+
+                     (if (and macro-start c-auto-align-backslashes)
+                         (c-backslash-region macro-start (c-point 'bopl) nil 
t)))
                  (set-marker endmark nil)
                  (c-progress-fini 'c-indent-region))
                (c-echo-parsing-error quiet))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]