GNU bug report logs -
#19829
25.0.50; query-replace in rectangle regions do not honor boundaries
Previous Next
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
>> +(defun region ()
>> + `(region
>> + (positions ,@(funcall region-extract-function 'positions))))
>
> I don't think we want such a short name. How 'bout `region-boundaries'?
> Also, why `(region (positions ,@<foo>)) rather than something simpler
> like `(region ,@<foo>)?
The goal is to design the interface as general as possible
to be able to define potential future non-rectangular regions.
For instance, a circular region could be defined in the future as:
(region
(shape . circle)
(radius . 42)
(center . ...)
...
Then to distinguish a rectangular region we could add (shape . rectangle)
to the current information:
(region
(shape . rectangle)
(positions . ...)
...
>> -(defun query-replace (from-string to-string &optional delimited start end backward)
>> +(defun query-replace (from-string to-string &optional delimited start end backward region)
> [...]
>> + (if (use-region-p) (region-beginning))
>> + (if (use-region-p) (region-end))
>> + (nth 3 common)
>> + (if (use-region-p) (region)))))
>
> I think we should re-use one of START or END rather than add a REGION argument.
Stuffing the region information into one of its boundary args would be too ugly.
I guess this is why you designed a cleaner interface by adding a REGION argument
to several commands:
(defun kill-region (beg end &optional region)
(defun kill-ring-save (beg end &optional region)
(defun copy-region-as-kill (beg end &optional region)
with such a clean docstring:
"The optional argument REGION if non-nil, indicates that we're not just killing
some text between BEG and END, but we're killing the region.
that will fit other commands like ‘downcase-region’ and ‘shell-command-on-region’
when replacing “killing the region” with a more general “operating on the region”.
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.