Function: double-column

double-column is an interactive and byte-compiled function defined in makesum.el.gz.

Signature

(double-column START END)

Documentation

Reformat buffer contents from START to END into two columns.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/makesum.el.gz
(defun double-column (start end)
  "Reformat buffer contents from START to END into two columns."
  (interactive "r")
  (let (half lines
        (nlines (count-lines start end))
	(from-end (- (point-max) end)))
    (when (> nlines 1)
      (setq half (/ (1+ nlines) 2))
      (goto-char start)
      (save-excursion
       (forward-line half)
       (dotimes (_ (- nlines half))
         (push (buffer-substring (point) (line-end-position))
               lines)
	 (delete-region (point) (progn (forward-line 1) (point)))))
      (dolist (line (nreverse lines))
        (end-of-line)
	(indent-to 41)
        (insert line)
        (forward-line 1)))
    (goto-char (- (point-max) from-end))))