unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "weber" <hugows@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Keep-only-column
Date: 9 Feb 2007 05:00:21 -0800	[thread overview]
Message-ID: <1171026021.769643.202100@h3g2000cwc.googlegroups.com> (raw)
In-Reply-To: <5338usF1q7sdgU1@mid.individual.net>

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

      reply	other threads:[~2007-02-09 13:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 19:15 Keep-only-column weber
2007-02-08 19:23 ` Keep-only-column weber
2007-02-08 19:43   ` Keep-only-column Joost Kremers
2007-02-08 19:46     ` Keep-only-column weber
2007-02-08 21:55   ` Keep-only-column Marc Tfardy
2007-02-09 10:47     ` Keep-only-column weber
2007-02-09 10:58     ` Keep-only-column Marc Tfardy
2007-02-09 11:10       ` Keep-only-column weber
2007-02-09 12:35         ` Keep-only-column weber
2007-02-09 12:49         ` Keep-only-column Marc Tfardy
2007-02-09 13:00           ` weber [this message]

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=1171026021.769643.202100@h3g2000cwc.googlegroups.com \
    --to=hugows@gmail.com \
    --cc=help-gnu-emacs@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.
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).