unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7494: 24.0.50; Why is `prefix-region' in a library by itself?
@ 2010-11-26 22:48 Drew Adams
  2010-11-27  2:10 ` Leo
  2010-11-27  2:39 ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Drew Adams @ 2010-11-26 22:48 UTC (permalink / raw)
  To: 7494

(defun prefix-region (prefix)
  "Insert PREFIX at the beginning of each line between mark and point."
  (interactive "sPrefix string: ")
  (let ((end (region-end)))
    (save-excursion
      (goto-char (region-beginning))
      (beginning-of-line)
      (save-restriction
	(narrow-to-region (point) end)
	(while (not (eobp))
	  (insert prefix)
	  (forward-line 1))))))

(provide 'prefix-region)

What's that about?






^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-11-27 18:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26 22:48 bug#7494: 24.0.50; Why is `prefix-region' in a library by itself? Drew Adams
2010-11-27  2:10 ` Leo
2010-11-27  2:18   ` Drew Adams
2010-11-27  2:39 ` Stefan Monnier
2010-11-27  3:00   ` Drew Adams
2010-11-27  8:09     ` Eli Zaretskii
2010-11-27 14:20       ` Stefan Monnier
2010-11-27 15:35         ` Eli Zaretskii
2010-11-27 16:11       ` Drew Adams
2010-11-27 18:30         ` Stefan Monnier
2010-11-27  6:50   ` Thierry Volpiatto

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).