Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!usc!zaphod.mps.ohio-state.edu!mips!apple!oliveb!orc!mipos3!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.emacs Subject: Re: insert char. in first column. Message-ID: <1990Feb28.162605.28657@iwarp.intel.com> Date: 28 Feb 90 16:26:05 GMT References: <13714@fs2.NISC.SRI.COM> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 23 In-Reply-To: cwilson@NISC.SRI.COM (Chan Wilson) In article <13714@fs2.NISC.SRI.COM>, cwilson@NISC (Chan Wilson) writes: | This has got to be simple, I just know it. But how do you do it? | | I want to be able to insert a character in the first column of a given | region, whether it be a tab, a >, or whatnot. How is this done? Assuming you are GNU-Emacs-ing, since you didn't say... First, define your region (set-mark-command, or whatever), then... C-x n (narrow-to-region) M-< (beginning-of-buffer) M-x replace-regexp RET ^ RET tab-or->-or-whatnot RET C-x w (widen) With the appropriate conversions to elisp, you can do it from within a function. Just another Emacs hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/