emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Charles Cave <charles_cave@optusnet.com.au>
To: emacs-orgmode@gnu.org
Subject: Re: small function suggestion (org-examplize-region)
Date: Wed, 18 Mar 2009 05:35:40 +0000 (UTC)	[thread overview]
Message-ID: <loom.20090318T053435-232@post.gmane.org> (raw)
In-Reply-To: 8287.1237340098@gamaville.dokosmarshall.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)))))

  reply	other threads:[~2009-03-18  5:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 18:02 small function suggestion (org-examplize-region) Eric Schulte
2009-03-17 19:00 ` Manish
2009-03-18  8:38   ` Carsten Dominik
2009-03-18  0:50 ` Charles Cave
2009-03-18  1:34   ` Nick Dokos
2009-03-18  5:35     ` Charles Cave [this message]
2009-03-18  8:32       ` Mikael Fornius
2009-03-18 16:07       ` Daniel Clemente

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20090318T053435-232@post.gmane.org \
    --to=charles_cave@optusnet.com.au \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).