GNU bug report logs - #19829
25.0.50; query-replace in rectangle regions do not honor boundaries

Previous Next

Package: emacs;

Reported by: Bastien <bzg <at> gnu.org>

Date: Tue, 10 Feb 2015 15:00:02 UTC

Severity: normal

Merged with 20070, 20626

Found in versions 24.3, 25.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Juri Linkov <juri <at> linkov.net>
Cc: Bastien <bzg <at> gnu.org>, 19829 <at> debbugs.gnu.org
Subject: bug#19829: 25.0.50; Design of commands operating on rectangular regions
Date: Tue, 07 Jul 2015 08:20:28 -0400
>> IOW, either your REGION arg uses a standard format (e.g. a list of
>> (START . END) boundaries), or it should be just a constant saying "use
>> things like region-extract-function ".
> Or better to check the value returned by region-extract-function
> in `interactive' with:
>   (defun region-nonstandard ()
>     (> (length (funcall region-extract-function 'positions)) 1))
> like the patch below does.

The idea of a constant saying "use the region" is also to distinguish it
from the case where the function is called non-interactively with
boundaries which aren't necessarily related to the current region.

>   region-noncontiguous

I like this name (tho with a final "-p") since it says precisely what
it means.

> Then we could replace in `interactive' calls `region-beginning'
> with `region-beginning-nonstandard' defined as:

No, I'd just replace it with the special constant that says "use things
like region-extract-function".  This constant could be just t or `region'.

> But I'm still not sure whether ugly is nicer than hideous,
> so this patch doesn't use it yet.

I think the first thing is to figure out what is the ideal API, ignoring
backward compatibility.  In this ideal case, I think we'd just want
a single arg which takes a "region descriptor" (along the lines of what
you described earlier, tho its format would be opaque) with methods like
`region-contiguous-p', `region-beginning', `region-end',
`region-chunks', `region-extract', ...

Then we can try and figure how to adapt it to the real world and how to
get from here to there.  But I think it mostly means we'll want to go
from two args (START/END) to just a single arg.  So adding an argument
doesn't seem to be the obvious best choice.


        Stefan




This bug report was last modified 9 years and 195 days ago.

Previous Next


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