Xref: utzoo comp.emacs:6571 comp.text:4512 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!rpi!crdgw1!sungod!davidsen From: davidsen@sungod.crd.ge.com (William Davidsen) Newsgroups: comp.emacs,comp.text Subject: Re: Indent/set left margin in Micro-Emacs Message-ID: <1386@crdgw1.crd.ge.com> Date: 28 Jul 89 18:25:40 GMT References: <2339@bingvaxu.cc.binghamton.edu> Sender: news@crdgw1.crd.ge.com Reply-To: davidsen@crdos1.UUCP (bill davidsen) Followup-To: comp.emacs Organization: General Electric Corp. R&D, Schenectady, NY Lines: 51 In article <2339@bingvaxu.cc.binghamton.edu> cjoslyn@bingvaxu.cc.binghamton.edu (Cliff Joslyn) writes: | | I use MicroEMACS 3.8i (yes, I know it's old) on an AT, and am | considering writing an 'indent' or 'set left margin' macro, basically | rebinding 'fill-word' to look at some 'left margin' variable. But I | thought I'd ask first if someone has one. This is a true pain in the ass to do with 3.8{anything} and you should go for 3.9i or later to get the fast searches (about 20:1 faster). Here's how I do it for 3.9p (with the patches applied which I posted to the net). You are free to translate if you really like 3.8i ---------------------------------------------------------------- ;; left margin set set %margin @"New margin: " narrow-to-region beginning-of-file ; delete any leading blanks !while "TRUE" ; see if this is a zero length line end-of-line !if ¬ &equal $curcol 0 ; delete any leading whitespace beginning-of-line !while &or &equal $curchar &asc " " &equal $curchar &asc "~t" delete-next-character !endwhile ; indent the line %margin insert-string " " !endif ; next line, please !force next-line !if $status !else !break !endif !endwhile ; open up again widen-from-region write-message "Done" ---------------------------------------------------------------- You caught me in macro-writing mode, I just did a one-key "convert scribe input to nroff input" package last weekend. Hope this gives you an idea. bill davidsen (davidsen@crdos1.crd.GE.COM) {uunet | philabs}!crdgw1!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me