GNU bug report logs -
#20070
24.3; have commands such as downcase-region act on a rectangle region
Previous Next
Full log
View this message in rfc822 format
>> A list of pairs would be much cleaner, indeed. The problem is that
>> there are 2 arguments already in region-handling commands: BEG and END.
>> Using one of them for a list of pairs, and leaving another unused
>> is not a nice thing to do.
>
> I think this "lack of niceness" is not strong enough to override the
> advantage of using a list of pairs.
I still have doubts about the API, but anyway here is the implementation
that (ab)uses the first arg BEG:
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 8755353..b77a0e6 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -306,14 +306,25 @@
return Qnil;
}
-DEFUN ("downcase-region", Fdowncase_region, Sdowncase_region, 2, 2, "r",
+DEFUN ("downcase-region", Fdowncase_region, Sdowncase_region, 2, 2,
+ "(list (funcall region-extract-function 'positions) nil)",
doc: /* Convert the region to lower case. In programs, wants two arguments.
These arguments specify the starting and ending character numbers of
the region to operate on. When used as a command, the text between
point and the mark is operated on. */)
(Lisp_Object beg, Lisp_Object end)
{
- casify_region (CASE_DOWN, beg, end);
+ if (CONSP (beg))
+ {
+ while (CONSP (beg))
+ {
+ casify_region (CASE_DOWN, XCAR (XCAR (beg)), XCDR (XCAR (beg)));
+ beg = XCDR (beg);
+ }
+ }
+ else
+ casify_region (CASE_DOWN, beg, end);
+
return Qnil;
}
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.