GNU bug report logs - #27896
25.2; `C-M-%' with `rectangle-mark-mode'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 1 Aug 2017 04:18:02 UTC

Severity: minor

Found in version 25.2

Full log


Message #29 received at 27896 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "27896 <at> debbugs.gnu.org" <27896 <at> debbugs.gnu.org>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: [External] : Re: bug#27896: 25.2; `C-M-%' with
 `rectangle-mark-mode'
Date: Tue, 09 Feb 2021 11:24:46 +0200
>>> But we could somewhat easily change `C-M-%' to be slightly less
>>> surprising, and document its limitations.  That is, we say that no
>>> multi-line matches are impossible in rectangle mode, and we implement it
>>
>> The current limitation is inability to use some greedy
>> regexps in rectangle mode.  This is not much worse than
>> limiting query-replace to non-multi-line matches only.
>
> Aren't multi-line replacements already disallowed in rectangle mode by
> the filtering function?

Except in a degenerate case when a rectangular region covers lines
completely from beginning to end.

>>> by just narrowing to each successive line part, and executing the
>>> query-replace-regexp once per line.  (With some magic to handle `!' etc,
>>> I guess.)
>>
>> Actually not narrowing in the sense of narrow-to-region,
>> but temporarily setting the LIMIT arg of 'replace-search'
>> to the end of the region of the current line.
>
> Yup.
>
> But I guess it's not that easy to get this to work sensibly -- it'd only
> highlight matches in one line at a time, which would be odd.

Maybe it's possible to add special handling for lazy-highlighting
as well, but unfortunately implementing all this takes too much time.

So this is a question of priorities: does it make sense to spend
much time implementing this.  Are there any users of this feature?

I mean the feature of regexp and multi-line replacements in rectangle mode,
because non-regexp single-line string replacements already work fine
in rectangle mode.

Or it's enough to explain the current limitation in the documentation.




This bug report was last modified 4 years and 125 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.