changeset 33772:4787f33fe54f

(string-rectangle): Revert last change. (string-rectangle-line): New arg DELETE. (string-rectangle): Check delete-selection-mode.
author Dave Love <fx@gnu.org>
date Wed, 22 Nov 2000 17:32:14 +0000
parents 1681bda84ed2
children b4aa82f6177e
files lisp/rect.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/rect.el	Wed Nov 22 17:05:38 2000 +0000
+++ b/lisp/rect.el	Wed Nov 22 17:32:14 2000 +0000
@@ -334,17 +334,20 @@
 The left edge of the rectangle specifies the column for insertion.
 This command does not delete or overwrite any existing text."
   (interactive "*r\nsString rectangle: ")
-  (apply-on-rectangle 'string-rectangle-line start end string))
+  (apply-on-rectangle 'string-rectangle-line start end string
+		      (bound-and-true-p 'delete-selection-mode)))
 
-(defun string-rectangle-line (startcol endcol string)
+(defun string-rectangle-line (startcol endcol string delete)
   (move-to-column-force startcol)
+  (if delete
+      (delete-rectangle-line startcol endcol nil))
   (insert string))
 
 ;;;###autoload
 (defun replace-rectangle (start end string)
   "Like `string-rectangle', but replace the original region."
   (interactive "*r\nsString rectangle: ")
-  (apply-on-rectangle 'string-rectangle-line start end string))
+  (apply-on-rectangle 'string-rectangle-line start end string t))
 
 ;;;###autoload
 (defun clear-rectangle (start end &optional fill)