]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/two-column.el
Merge.
[gnu-emacs] / lisp / textmodes / two-column.el
index d8d298909c1d3afeb024b90ca2b3c00525829ca5..de9ac10d0e94784d2edd601ed88a4901f2a22419 100644 (file)
@@ -1,7 +1,6 @@
 ;;; two-column.el --- minor mode for editing of two-column text
 
-;; Copyright (C) 1992, 1993, 1994, 1995, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1992-1995, 2001-2011 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
 ;; Adapted-By: ESR, Daniel Pfeiffer
 (defcustom 2C-mode-line-format
        '("-%*- %15b --"  (-3 . "%p")  "--%[("  mode-name
          minor-mode-alist  "%n"  mode-line-process  ")%]%-")
-  "*Value of `mode-line-format' for a buffer in two-column minor mode."
+  "Value of `mode-line-format' for a buffer in two-column minor mode."
   :type 'sexp
   :group 'two-column)
 
 
 (defcustom 2C-other-buffer-hook 'text-mode
-  "*Hook run in new buffer when it is associated with current one."
+  "Hook run in new buffer when it is associated with current one."
   :type 'function
   :group 'two-column)
 
 
 (defcustom 2C-separator ""
-  "*A string inserted between the two columns when merging.
+  "A string inserted between the two columns when merging.
 This gets set locally by \\[2C-split]."
   :type 'string
   :group 'two-column)
@@ -230,7 +229,7 @@ This gets set locally by \\[2C-split]."
 
 
 (defcustom 2C-window-width 40
-  "*The width of the first column.  (Must be at least `window-min-width')
+  "The width of the first column.  (Must be at least `window-min-width')
 This value is local for every buffer that sets it."
   :type 'integer
   :group 'two-column)
@@ -240,7 +239,7 @@ This value is local for every buffer that sets it."
 
 
 (defcustom 2C-beyond-fill-column 4
-  "*Base for calculating `fill-column' for a buffer in two-column minor mode.
+  "Base for calculating `fill-column' for a buffer in two-column minor mode.
 The value of `fill-column' becomes `2C-window-width' for this buffer
 minus this value."
   :type 'integer
@@ -334,7 +333,7 @@ first and the associated buffer to its right."
   ;; first go to full width, so that we can certainly split into two windows
   (unless (window-full-width-p)
     (enlarge-window 99999 t))
-  (split-window-horizontally
+  (split-window-right
    (max window-min-width (min 2C-window-width
                              (- (frame-width) window-min-width))))
   (if (2C-other)
@@ -407,8 +406,7 @@ First column's text    sSs  Second column's text
        (if (y-or-n-p (concat "Overwrite associated buffer `"
                             (buffer-name (2C-other))
                             "'? "))
-          (save-excursion
-            (set-buffer (2C-other))
+          (with-current-buffer (2C-other)
             (erase-buffer))
         (signal 'quit nil)))
   (let ((point (point))
@@ -537,7 +535,8 @@ off trailing spaces with \\[delete-trailing-whitespace]."
     (if (get-buffer-window (2C-other t))
        (select-window (get-buffer-window (2C-other)))
       (switch-to-buffer (2C-other)))
-    (newline (goto-line line))
+    (goto-char (point-min))
+    (newline (forward-line (1- line)))
     (if col
        (move-to-column col)
       (end-of-line 1))))
@@ -632,5 +631,4 @@ on, this also realigns the two buffers."
 
 (provide 'two-column)
 
-;; arch-tag: 2021b5ab-d3a4-4a8c-a21c-1936b0f9e6b1
 ;;; two-column.el ends here