emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/textmodes two-column.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp/textmodes two-column.el
Date: Thu, 04 Jun 2009 01:11:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/06/04 01:11:06

Modified files:
        lisp/textmodes : two-column.el 

Log message:
        * textmodes/two-column.el (2C-split): Call move-to-column, to
        compensate for the 2007-10-19 change from next-line to
        forward-line (Bug#3435).  Account for fringe and scroll-bar when
        setting 2C-window-width.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/textmodes/two-column.el?cvsroot=emacs&r1=1.44&r2=1.45

Patches:
Index: two-column.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/two-column.el,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- two-column.el       9 Jan 2009 04:19:13 -0000       1.44
+++ two-column.el       4 Jun 2009 01:11:06 -0000       1.45
@@ -412,9 +412,9 @@
             (erase-buffer))
         (signal 'quit nil)))
   (let ((point (point))
-       ; make next-line always come back to same column
-       (goal-column (current-column))
-       ; a counter for empty lines in other buffer
+       ;; make next-line always come back to same column
+       (column (current-column))
+       ;; a counter for empty lines in other buffer
        (n (1- (count-lines (point-min) (point))))
        chars other)
     (save-excursion
@@ -423,13 +423,17 @@
       (skip-chars-forward " \t" point)
       (make-local-variable '2C-separator)
       (setq 2C-separator (buffer-substring (point) point)
-           2C-window-width (current-column)))
+           2C-window-width (+ (fringe-columns 'left)
+                              (fringe-columns 'right)
+                              (scroll-bar-columns 'left)
+                              (scroll-bar-columns 'right)
+                              (current-column))))
     (2C-two-columns)
     (setq other (2C-other))
-    ; now we're ready to actually split
+    ;; now we're ready to actually split
     (save-excursion
       (while (not (eobp))
-       (if (not (and (= (current-column) goal-column)
+       (if (not (and (= (current-column) column)
                      (string= chars
                               (buffer-substring (point)
                                                 (save-excursion
@@ -448,7 +452,8 @@
                                                 (1+ (point)))))
          (delete-region point (point))
          (setq n 0))
-       (forward-line 1)))))
+       (forward-line 1)
+       (move-to-column column)))))
 
 
 




reply via email to

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