;; ;; Vertical mode (by Pavel Machek ) ;; Thanx to Martin Mares for make it ;; working ;; Copyright 1997 Pavel Machek, distribute under GPL, no warranty given ;; Version 0.2.0 ;; (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. In vertical mode, cursor moves down, nor right after each change. That allows you to indent texts pretty fast, insert '>' s into quoted mail etc." (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))