Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!hplabs!hpfcso!jka From: jka@hpfcso.HP.COM (Jay Adams) Newsgroups: comp.emacs Subject: Re: auto-fill-indent-right-margin Message-ID: <8970001@hpfcso.HP.COM> Date: 7 Sep 89 01:30:18 GMT References: <1054@bimacs.BITNET> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 30 This is a little thing I tossed off once. It is essentially Spencer's idea w/ bells and whistles. - Jay (defvar auto-justify-mode '() "Non nil if auto justifying is turned on.") (or (assoc 'auto-justify-mode minor-mode-alist) (setq minor-mode-alist (cons '(auto-justify-mode " Justify") minor-mode-alist))) (defun auto-justify-mode () (interactive) "Toggle an auto fill mode that lines up right margins." (if (eq auto-fill-hook 'do-auto-fill-justify) (setq auto-fill-hook 'do-auto-fill auto-justify-mode nil) (setq auto-fill-hook 'do-auto-fill-justify auto-justify-mode t))) (defun do-auto-fill-justify () "Same as do-auto-fill \'cept fixes right margin on current line." (do-auto-fill) (save-excursion (previous-line 1) (justify-current-line)))