summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-06-04 01:11:06 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-06-04 01:11:06 +0000
commit466c6fcc73b56d5f4405b0cfc5e262e8a572de0f (patch)
treedef20fed81945754e535f7a9e309cda1f40327db
parent29da768fb92f17111c53e0bd3caba1de1e4f4ec4 (diff)
downloademacs-466c6fcc73b56d5f4405b0cfc5e262e8a572de0f.tar.gz
* 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.
-rw-r--r--lisp/textmodes/two-column.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index 8cbe801fc40..d8d298909c1 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -412,9 +412,9 @@ First column's text sSs Second column's text
(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 @@ First column's text sSs Second column's text
(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 @@ First column's text sSs Second column's text
(1+ (point)))))
(delete-region point (point))
(setq n 0))
- (forward-line 1)))))
+ (forward-line 1)
+ (move-to-column column)))))