diff options
| author | Richard M. Stallman | 1998-06-06 17:52:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-06-06 17:52:43 +0000 |
| commit | eb148b90e292a4793c94aa268bbd1adb840cb0c4 (patch) | |
| tree | c431efbdd554fd5ca356f9b414520f6632475798 | |
| parent | 06cab243ef0882adb4edb488a086d13277cd17be (diff) | |
| download | emacs-eb148b90e292a4793c94aa268bbd1adb840cb0c4.tar.gz emacs-eb148b90e292a4793c94aa268bbd1adb840cb0c4.zip | |
(string-rectangle-line): Delete the rectangle first.
(string-rectangle): Doc fix.
| -rw-r--r-- | lisp/rect.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/rect.el b/lisp/rect.el index 895c3ae0078..c9b8d2d659d 100644 --- a/lisp/rect.el +++ b/lisp/rect.el | |||
| @@ -227,9 +227,8 @@ rectangle, all continuous whitespace starting at that column is deleted." | |||
| 227 | 227 | ||
| 228 | ;;;###autoload | 228 | ;;;###autoload |
| 229 | (defun string-rectangle (start end string) | 229 | (defun string-rectangle (start end string) |
| 230 | "Insert STRING on each line of the region-rectangle, shifting text right. | 230 | "Replace rectangle contents with STRING on each line. |
| 231 | The left edge of the rectangle specifies the column for insertion. | 231 | The length of STRING need not be the same as the rectangle width. |
| 232 | This command does not delete or overwrite any existing text. | ||
| 233 | 232 | ||
| 234 | Called from a program, takes three args; START, END and STRING." | 233 | Called from a program, takes three args; START, END and STRING." |
| 235 | (interactive "r\nsString rectangle: ") | 234 | (interactive "r\nsString rectangle: ") |
| @@ -238,7 +237,8 @@ Called from a program, takes three args; START, END and STRING." | |||
| 238 | 237 | ||
| 239 | (defun string-rectangle-line (startpos begextra endextra) | 238 | (defun string-rectangle-line (startpos begextra endextra) |
| 240 | (let (whitespace) | 239 | (let (whitespace) |
| 241 | (goto-char startpos) | 240 | ;; Delete the width of the rectangle. |
| 241 | (delete-region startpos (point)) | ||
| 242 | ;; Compute horizontal width of following whitespace. | 242 | ;; Compute horizontal width of following whitespace. |
| 243 | (let ((ocol (current-column))) | 243 | (let ((ocol (current-column))) |
| 244 | (skip-chars-forward " \t") | 244 | (skip-chars-forward " \t") |