diff options
| author | Chong Yidong | 2009-06-04 01:11:06 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-06-04 01:11:06 +0000 |
| commit | 466c6fcc73b56d5f4405b0cfc5e262e8a572de0f (patch) | |
| tree | def20fed81945754e535f7a9e309cda1f40327db | |
| parent | 29da768fb92f17111c53e0bd3caba1de1e4f4ec4 (diff) | |
| download | emacs-466c6fcc73b56d5f4405b0cfc5e262e8a572de0f.tar.gz emacs-466c6fcc73b56d5f4405b0cfc5e262e8a572de0f.zip | |
* 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.el | 19 |
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 | |||
| 412 | (erase-buffer)) | 412 | (erase-buffer)) |
| 413 | (signal 'quit nil))) | 413 | (signal 'quit nil))) |
| 414 | (let ((point (point)) | 414 | (let ((point (point)) |
| 415 | ; make next-line always come back to same column | 415 | ;; make next-line always come back to same column |
| 416 | (goal-column (current-column)) | 416 | (column (current-column)) |
| 417 | ; a counter for empty lines in other buffer | 417 | ;; a counter for empty lines in other buffer |
| 418 | (n (1- (count-lines (point-min) (point)))) | 418 | (n (1- (count-lines (point-min) (point)))) |
| 419 | chars other) | 419 | chars other) |
| 420 | (save-excursion | 420 | (save-excursion |
| @@ -423,13 +423,17 @@ First column's text sSs Second column's text | |||
| 423 | (skip-chars-forward " \t" point) | 423 | (skip-chars-forward " \t" point) |
| 424 | (make-local-variable '2C-separator) | 424 | (make-local-variable '2C-separator) |
| 425 | (setq 2C-separator (buffer-substring (point) point) | 425 | (setq 2C-separator (buffer-substring (point) point) |
| 426 | 2C-window-width (current-column))) | 426 | 2C-window-width (+ (fringe-columns 'left) |
| 427 | (fringe-columns 'right) | ||
| 428 | (scroll-bar-columns 'left) | ||
| 429 | (scroll-bar-columns 'right) | ||
| 430 | (current-column)))) | ||
| 427 | (2C-two-columns) | 431 | (2C-two-columns) |
| 428 | (setq other (2C-other)) | 432 | (setq other (2C-other)) |
| 429 | ; now we're ready to actually split | 433 | ;; now we're ready to actually split |
| 430 | (save-excursion | 434 | (save-excursion |
| 431 | (while (not (eobp)) | 435 | (while (not (eobp)) |
| 432 | (if (not (and (= (current-column) goal-column) | 436 | (if (not (and (= (current-column) column) |
| 433 | (string= chars | 437 | (string= chars |
| 434 | (buffer-substring (point) | 438 | (buffer-substring (point) |
| 435 | (save-excursion | 439 | (save-excursion |
| @@ -448,7 +452,8 @@ First column's text sSs Second column's text | |||
| 448 | (1+ (point))))) | 452 | (1+ (point))))) |
| 449 | (delete-region point (point)) | 453 | (delete-region point (point)) |
| 450 | (setq n 0)) | 454 | (setq n 0)) |
| 451 | (forward-line 1))))) | 455 | (forward-line 1) |
| 456 | (move-to-column column))))) | ||
| 452 | 457 | ||
| 453 | 458 | ||
| 454 | 459 | ||