Subject: bug#20070: 24.3; have commands such as downcase-region act on a rectangle region

From: Juri Linkov <[email-masked]>
Date: Mon, 16 Mar 2015 22:55:36 +0200

> What are BEG1, END1, BEG2, END2, etc. values here?

They should have the same type as the return values of
region-beginning/region-end and the interactive space "r"
which are of the marker type.  So the patch in bug#19829 should be
improved by another patch (both will be installed after finishing
designing this feature):

diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 044939f..a314d33 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -676,9 +676,9 @@ (defun cua--extract-rectangle-positions ()
         (lambda (s e l r _v)
            (goto-char s)
            (move-to-column l)
-           (setq s (point))
+           (setq s (point-marker))
            (move-to-column r)
-           (setq e (point))
+           (setq e (point-marker))
            (setq rect (cons (cons s e) rect)))))
     (nreverse rect)))
 
diff --git a/lisp/rect.el b/lisp/rect.el
index 271f720..7a2c5a3 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -265,7 +265,8 @@ (defun extract-rectangle-positions (start end)
     (apply-on-rectangle
      (lambda (startcol endcol)
        (move-to-column startcol)
-       (push (cons (prog1 (point) (move-to-column endcol)) (point))
+       (push (cons (prog1 (point-marker) (move-to-column endcol))
+		   (point-marker))
 	     positions))
      start end)
     (nreverse positions)))