What's the general census of opinion of this little thing, is it
something that could go into edit-utils? Are there any reasons why it
shouldn't be included?
==================================================
;; Copyright (C) 1998-2000 Pavel Machek <pavel(a)ucw.cz>
;;
;; Author: Pavel Machek <pavel(a)ucw.cz>
;;; Commentary:
; This minor mode allows you to conviently edit things that are oriented vertically
; (like tables in computer programs): after each action, cursor moves down. Therefore,
; to move block of text to the right, you simply enter vertical mode and then hold
; spacebar, waiting for autorepeat to do the job for you.
;; Put this file into your load-path and the following into your ~/.emacs:
;; (require 'vertical-mode)
;;; Code:
(defun vertical-after-change (from to num)
"Function called after each change of text in vertical minor mode"
(goto-char vertical-goto-point)
(next-line 1))
(defun vertical-before-change (from to)
(setq vertical-goto-point from)
(setq vertical-goto-column (current-column)))
(defvar vertical-mode nil
"Vertical mode")
(make-variable-buffer-local 'vertical-goto-point)
(make-variable-buffer-local 'vertical-goto-column)
(make-variable-buffer-local 'vertical-mode)
(defun vertical-mode (&optional arg)
"This function toggles vertical mode on and off."
(interactive)
(setq vertical-mode
(if (null arg) (not vertical-mode)
(> (prefix-numeric-value arg) 0)))
(force-mode-line-update)
(make-local-hook 'before-change-functions)
(make-local-hook 'after-change-functions)
(if vertical-mode
(progn
(add-hook 'before-change-functions 'vertical-before-change nil t)
(add-hook 'after-change-functions 'vertical-after-change nil t))
(progn
(remove-hook 'before-change-functions 'vertical-before-change t)
(remove-hook 'after-change-functions 'vertical-after-change t))))
(setq
minor-mode-alist (cons
'(vertical-mode " Vertical") minor-mode-alist))
(provide 'vertical-mode)
;;; vertical-mode.el ends here
--
|---<Regards, Steve Youngs>-----------[GnuPG KeyID: EFD82ED2]---|
| XEmacs - It's not just an editor... |
| It's a way of life. |
|----------------------------------<mailto:youngsï¼ xemacs.org>---|