all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kalle Olavi Niemitalo <kon@iki.fi>
To: Mathias Dahl <mathias.dahl@gmail.com>
Cc: Kaushal Modi <kaushal.modi@gmail.com>,
	Emacs developers <emacs-devel@gnu.org>,
	Tino Calancha <tino.calancha@gmail.com>
Subject: Re: [PATCH] New command to invert lines in region
Date: Sun, 16 Oct 2016 21:25:46 +0300	[thread overview]
Message-ID: <87wph89mmt.fsf@Niukka.kon.iki.fi> (raw)
In-Reply-To: <CABrcCQ4VpjxLO6ZWpkg5ay46tYJ==Y+WP25-Ki9r50Vo6QvJ6w@mail.gmail.com> (Mathias Dahl's message of "Sun, 16 Oct 2016 00:25:12 +0200")

Mathias Dahl <mathias.dahl@gmail.com> writes:

> I wrote my own naïve version that I think is much simpler to
> understand and which seems to be as quick as the current version (I tested
> on a buffer with 100 000 lines.)

If I use point-to-register to set a marker at the beginning of
the region and another at the end of the region, then the
original version of reverse-region keeps the markers where they
are, but your version moves both markers to the beginning of the
region, because it deletes all the original lines before it
inserts anything.

It might be nice if reverse-region and sort-columns moved any
markers along with the lines.  I don't know how much that would
slow them down or whether there would be any practical use for
such a feature.



      parent reply	other threads:[~2016-10-16 18:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03 10:43 [PATCH] New command to invert lines in region Tino Calancha
2016-10-03 11:02 ` Kaushal Modi
2016-10-03 11:21   ` Tino Calancha
2016-10-03 11:33     ` Tino Calancha
2016-10-15 22:25       ` Mathias Dahl
2016-10-15 23:57         ` Kaushal Modi
2016-10-16 11:03           ` Mathias Dahl
2016-10-16 13:24         ` Noam Postavsky
2016-10-16 14:00           ` Eli Zaretskii
2016-10-16 18:25         ` Kalle Olavi Niemitalo [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

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

  git send-email \
    --in-reply-to=87wph89mmt.fsf@Niukka.kon.iki.fi \
    --to=kon@iki.fi \
    --cc=emacs-devel@gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=mathias.dahl@gmail.com \
    --cc=tino.calancha@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.