help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Character first of all lines


From: Reiner Steib
Subject: Re: Character first of all lines
Date: Fri, 11 Jul 2003 21:06:43 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

On Fri, Jul 11 2003, Piet van Oostrum wrote:

>>>>>> Luiz Siqueira Neto <cybersamurai@mac.com> (LSN) wrote:
> LSN> # x = 1
> LSN> # print x

Probably in most modes, `comment-region' or `comment-dwim' are useful
commands for this.

> (defun quote-region (start end string)
>   "Quote the region with the given STRING.
> Called from a program, takes three args: START, END, and STRING."
>   (interactive "r\nsQuote region with string: ")

Doesn't `string-rectangle' more or less do the same?  Assuming you
point and mark are at column 0 (i.e. my rectangle has zero width).

,----[ C-h k C-x r t ]
| C-x r t runs the command string-rectangle
|    which is an interactive compiled Lisp function in `rect'.
| (string-rectangle START END STRING)
| 
| Replace rectangle contents with STRING on each line.
| The length of STRING need not be the same as the rectangle width.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]