Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mgm.mit.edu!wolfgang From: wolfgang@mgm.mit.edu (Wolfgang Rupprecht) Newsgroups: comp.emacs Subject: Re: Need mlisp for "prefix-region" Message-ID: <2621@bloom-beacon.MIT.EDU> Date: 28 Jan 88 23:37:25 GMT References: <3910015@nucsrl.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: wolfgang@mgm.mit.edu (Wolfgang Rupprecht) Organization: Freelance Software Consultant, Cambridge, Ma. Lines: 23 In article <3910015@nucsrl.UUCP> naim@nucsrl.UUCP (Naim Abdullah) writes: >Can some mlisp guru post the function "prefix-region" (as >found in mg) in mlisp so that I can put it in my load path ? How about: (defun prefix-region (point mark string) "Prefix the region between POINT and MARK with STRING." (interactive "*r\nsPrefix: ") (save-excursion (save-restriction (narrow-to-region point mark) (goto-char point) (replace-regexp "^" string)))) -- Wolfgang Rupprecht ARPA: wolfgang@mgm.mit.edu (IP 18.82.0.114) Freelance Consultant UUCP: mit-eddie!mgm.mit.edu!wolfgang Boston, Ma. VOICE: Hey_Wolfgang!_(617)_267-4365 Wolfgang Rupprecht ARPA: wolfgang@mgm.mit.edu (IP 18.82.0.114) Freelance Consultant UUCP: mit-eddie!mgm.mit.edu!wolfgang Boston, Ma. VOICE: Hey_Wolfgang!_(617)_267-4365