Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!mailrus!uflorida!mephisto!bbn!gateway!BBN.COM!jr From: jr@BBN.COM (John Robinson) Newsgroups: comp.emacs Subject: Re: Filling of paragraphs in GNU emacs. Message-ID: <48910@bbn.COM> Date: 29 Nov 89 22:03:31 GMT References: <1989Nov28.222213.3721@hcr.uucp> Sender: news@bbn.COM Organization: BBN news/mail gateway Lines: 30 I couldn't resist rising to this one. auto-fill-mode works, basically, by calling the value of auto-fill-hook when you type a space. In text auto-fill mode (and perhaps others), this is bound to the function do-auto-fill, which is defined in simple.el. What is needed is a do-auto-justify, which we attempt to define here. It makes use of the function justify-current-line, in fill.el: (defun do-auto-justify () (let ((ocol (current-column))) (do-auto-fill) (or (= ocol (current-column)) (save-excursion (forward-line -1) (justify-current-line))))) Then, hang it onto auto-fill-hook: (setq auto-fill-hook 'do-auto-justify) Now if I type a bunch of stuff I should get my lines all nicely justified with lots of snappy extra spaces inserted each time it goes to a new line. There, does that look okay to you all? I thought so. Nothing like interpretive systems to check out new things fast (ahem, well I had to use the debugger once on this, but you know how it goes... ) -- /jr, nee John Robinson Life did not take over the globe by combat, jr@bbn.com or bbn!jr but by networking -- Lynn Margulis Brought to you by Super Global Mega Corp .com