Commits

Anonymous committed 65a5ed6

pending-del.el fix for rectangular regions

  • Participants
  • Parent commits ecd7c12

Comments (0)

Files changed (3)

+1998-02-01  SL Baur  <steve@altair.xemacs.org>
+
+	* pending-del.el (pending-delete-active-region): Fixes for
+	rectangular regions.
+	From Chris Felaco <felaco@iatcmail.ed.ray.com>
+
 1998-01-25  SL Baur  <steve@altair.xemacs.org>
 
 	* Makefile (VERSION): Update to package standard 1.0.
 
 # This XEmacs package contains independent single file lisp packages
 
-VERSION = 1.05
+VERSION = 1.06
 AUTHOR_VERSION =
 MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
 PACKAGE = pc
 
 (defun pending-delete-active-region (&optional killp)
   (when (and (region-active-p)
-	     (eq (extent-object zmacs-region-extent) (current-buffer))
+	     (if zmacs-region-rectangular-p
+		 (eq (extent-object (car zmacs-region-extent))
+		     (current-buffer))
+	       (eq (extent-object zmacs-region-extent) (current-buffer)))
 	     (not buffer-read-only))
     ;; Here we used to check whether the point lies between the
     ;; beginning and end of the extent.  I don't see how it is
     ;; necessary, as the C code makes sure that this is so; it only
     ;; slow things down.
-    (if killp
-	(kill-region (region-beginning) (region-end))
-      (delete-region (region-beginning) (region-end)))
+    (if zmacs-region-rectangular-p
+	(if killp
+	    (kill-rectangle (region-beginning) (region-end))
+	  (delete-rectangle (region-beginning) (region-end)))
+      (if killp
+	  (kill-region (region-beginning) (region-end))
+	(delete-region (region-beginning) (region-end))))
     (zmacs-deactivate-region)
     t))
 
 (put 'self-insert-command 'pending-delete t)
 
 (put 'yank 'pending-delete t)
+(put 'yank-rectangle 'pending-delete t)
 (put 'x-yank-clipboard-selection 'pending-delete t)
 (put 'toolbar-paste 'pending-delete t)