Hi!
This is usefull minor mode I created some time ago. Is there way for
something like this to get into standart distribution?
;;
;; Vertical mode for emacs
;;
;; Copyright 1998-2000 Pavel Machek <pavel(a)ucw.cz>
;; Distribute under GNU GPL version 2 or later.
;;
; 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.
;
(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))
--
I'm pavel(a)ucw.cz. "In my country we have almost anarchy and I don't
care."
Panos Katsaloulis describing me w.r.t. patents at discuss(a)linmodems.org