|
| From: | Charles Cave |
| Subject: | [Orgmode] Re: small function suggestion (org-examplize-region) |
| Date: | Wed, 18 Mar 2009 05:35:40 +0000 (UTC) |
| User-agent: | Loom/3.14 (http://gmane.org/) |
Nick Dokos <nicholas.dokos <at> hp.com> writes:
> My emacs (GNU Emacs 23.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.12.9)
> of 2009-03-06 on alphaville.usa.hp.com) doesn't seem to have prefix-region -
> where does it come from?
I forgot that this function is in my .emacs file. I always
thought it was built in to GNU Emacs.
Here it is....
(defun prefix-region (prefix)
"Add a prefix string to each line between mark and point."
(interactive "sPrefix string: ")
(if prefix
(let ((count (count-lines (mark) (point))))
(goto-char (min (mark) (point)))
(while (> count 0)
(setq count (1- count))
(beginning-of-line 1)
(insert prefix)
(end-of-line 1)
(forward-char 1)))))
| [Prev in Thread] | Current Thread | [Next in Thread] |