aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1998-06-06 17:52:43 +0000
committerRichard M. Stallman <[email protected]>1998-06-06 17:52:43 +0000
commiteb148b90e292a4793c94aa268bbd1adb840cb0c4 (patch)
treec431efbdd554fd5ca356f9b414520f6632475798 /lisp
parent06cab243ef0882adb4edb488a086d13277cd17be (diff)
(string-rectangle-line): Delete the rectangle first.
(string-rectangle): Doc fix.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/rect.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/rect.el b/lisp/rect.el
index 895c3ae007..c9b8d2d659 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -227,9 +227,8 @@ rectangle, all continuous whitespace starting at that column is deleted."
;;;###autoload
(defun string-rectangle (start end string)
- "Insert STRING on each line of the region-rectangle, shifting text right.
-The left edge of the rectangle specifies the column for insertion.
-This command does not delete or overwrite any existing text.
+ "Replace rectangle contents with STRING on each line.
+The length of STRING need not be the same as the rectangle width.
Called from a program, takes three args; START, END and STRING."
(interactive "r\nsString rectangle: ")
@@ -238,7 +237,8 @@ Called from a program, takes three args; START, END and STRING."
(defun string-rectangle-line (startpos begextra endextra)
(let (whitespace)
- (goto-char startpos)
+ ;; Delete the width of the rectangle.
+ (delete-region startpos (point))
;; Compute horizontal width of following whitespace.
(let ((ocol (current-column)))
(skip-chars-forward " \t")