[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keep-only-column
From: |
weber |
Subject: |
Re: Keep-only-column |
Date: |
9 Feb 2007 05:00:21 -0800 |
User-agent: |
G2/1.0 |
On 9 fev, 09:49, Marc Tfardy <m-t-o___CUT__IT...@web.de> wrote:
> weber schrieb:
>
> > Here's a version to apply the function to a region.
> > If there is a easier way plese tell me!
>
> > (defun keep-column-on-region (beg end &optional arg)
> > "Apply keep-column over region."
> > (interactive "r\np")
> > (save-excursion
> > (if mark-active
> > (let ((beg (region-beginning))
> > (end (copy-marker (region-end))))
> > (goto-char beg)
> > (while (< (point) end)
> > (beginning-of-line)
> > (keep-column arg)
> > (next-line 1))))))
>
> You use interactive "r" which put automatically boundary of region in
> beg and end, but you still compute beg (and end) self in you code.
> Why?
>
> regards
>
> Marc
True.... but it didn't work otherwise...
I think the problem is that sometimes a region may be not marked
("selected") ?
I'm accepting improvements :)
Cheers
weber
- Keep-only-column, weber, 2007/02/08
- Re: Keep-only-column, weber, 2007/02/08
- Re: Keep-only-column, Joost Kremers, 2007/02/08
- Re: Keep-only-column, Marc Tfardy, 2007/02/08
- Re: Keep-only-column, weber, 2007/02/09
- Re: Keep-only-column, Marc Tfardy, 2007/02/09
- Re: Keep-only-column, weber, 2007/02/09
- Re: Keep-only-column, weber, 2007/02/09
- Re: Keep-only-column, Marc Tfardy, 2007/02/09
- Re: Keep-only-column,
weber <=