all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@linkov.net>
Cc: "Pål Grønås Drange" <paal.drange@gmail.com>, 20070@debbugs.gnu.org
Subject: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region
Date: Sat, 14 Mar 2015 12:31:08 -0400	[thread overview]
Message-ID: <jwvmw3fo8hf.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87bnjyf29d.fsf@mail.linkov.net> (Juri Linkov's message of "Thu,  12 Mar 2015 21:23:58 +0200")

> Currently, `downcase-region' is defined with the interactive spec 'r'
> that calls the function with point and mark as 2 args.

Indeed, same problem as kill-region, to which I had to add a `region'
argument (which basically says "we're called interactively so use
whatever is the region rather than BEG and END").

> For backward-compatibility reasons this can't be changed.  So maybe
> a new interactive spec e.g. 'R' should call the function with 2 lists
> where the first list will contain a list of beginnings of all intervals
> in the rectangular region, and the second list of endings of intervals?

Obviously, there will be many more commands that need to be adjusted to
the extended notion of "region" which can now be composed of various extents.
I'm not sure we need/want a new "R", because I think all cases of "r"
are currently broken when the region is non contiguous (i.e. they all
need to use "the new system").

One way to handle it generically, is to change call-interactively such
that when the argument is "r", the command is called once for each
"extent".  Obviously, this won't work correctly for all cases, tho.

Another option is to make "r" behave along the lines of your "R" (tho
I much prefer a list of pairs than a pair of lists, so one of the two
args would end up "useless").

> Then a command using it will need to add another outermost loop to pop
> interval boundaries from both list arguments `begs' and `ends' to process
> intervals using the same logic like it processes a single region now.

Indeed.  Maybe such a loop would be common enough that it'd be
worthwhile adding some ad-hoc handling (e.g. make call-interactively do
the looping as suggested above, tho maybe only after checking some
special property of the command).


        Stefan





  reply	other threads:[~2015-03-14 16:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10  1:06 bug#20070: 24.3; have commands such as downcase-region act on a rectangle region Pål Grønås Drange
2015-03-11 20:28 ` Stefan Monnier
2015-03-12 19:23   ` Juri Linkov
2015-03-14 16:31     ` Stefan Monnier [this message]
2015-03-15 20:34       ` Juri Linkov
2015-03-15 20:41         ` Eli Zaretskii
2015-03-16 11:49           ` Nicolas Richard
2015-03-16 13:14           ` Stefan Monnier
2015-03-16 20:55           ` Juri Linkov
2015-03-16 22:07             ` Stefan Monnier
2015-03-16 13:19         ` Stefan Monnier
2015-03-16 20:58           ` Juri Linkov
2015-03-16 22:08             ` Stefan Monnier
2015-03-17 19:38               ` Juri Linkov
2015-03-25  0:37                 ` Stefan Monnier
2015-03-25 21:42                   ` Juri Linkov
2015-03-17  7:10             ` Eli Zaretskii
2015-06-30 20:44   ` Juri Linkov

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=jwvmw3fo8hf.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20070@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=paal.drange@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.