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: Thu, 15 Feb 2007 22:31:52 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Alan Mackenzie <acmacm> 07/02/15 22:31:52

Index: cc-cmds.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-cmds.el,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- cc-cmds.el  4 Feb 2007 11:16:54 -0000       1.53
+++ cc-cmds.el  15 Feb 2007 22:31:52 -0000      1.54
@@ -4238,6 +4238,7 @@
                                    (c-collect-line-comments c-lit-limits))
                              c-lit-type)))
                     (pos (point))
+                    (start-col (current-column))
                     (comment-text-end
                      (or (and (eq c-lit-type 'c)
                               (save-excursion
@@ -4254,6 +4255,11 @@
                 ;;
                 ;; If point is on the 'B' then the line will be
                 ;; broken after "Bla b".
+                ;;
+                ;; If we have an empty comment, /*   */, the next
+                ;; lot of code pushes point to the */.  We fix
+                ;; this by never allowing point to end up to the
+                ;; right of where it started.
                 (while (and (< (current-column) (cdr fill))
                             (not (eolp)))
                   (forward-char 1))
@@ -4276,7 +4282,10 @@
                         ((< (point) (+ (car c-lit-limits) 2))
                          (goto-char (+ (car c-lit-limits) 2))))
                   (funcall do-line-break)
-                  (insert-and-inherit (car fill))))
+                  (insert-and-inherit (car fill))
+                  (if (> (current-column) start-col)
+                      (move-to-column start-col)))) ; can this hit the
+                                                    ; middle of a TAB?
             ;; Inside a comment that should be broken.
             (let ((comment-start comment-start)
                   (comment-end comment-end)




reply via email to

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