Commit eb148b90 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(string-rectangle-line): Delete the rectangle first.

(string-rectangle): Doc fix.
parent 06cab243
...@@ -227,9 +227,8 @@ rectangle, all continuous whitespace starting at that column is deleted." ...@@ -227,9 +227,8 @@ rectangle, all continuous whitespace starting at that column is deleted."
;;;###autoload ;;;###autoload
(defun string-rectangle (start end string) (defun string-rectangle (start end string)
"Insert STRING on each line of the region-rectangle, shifting text right. "Replace rectangle contents with STRING on each line.
The left edge of the rectangle specifies the column for insertion. The length of STRING need not be the same as the rectangle width.
This command does not delete or overwrite any existing text.
Called from a program, takes three args; START, END and STRING." Called from a program, takes three args; START, END and STRING."
(interactive "r\nsString rectangle: ") (interactive "r\nsString rectangle: ")
...@@ -238,7 +237,8 @@ Called from a program, takes three args; START, END and STRING." ...@@ -238,7 +237,8 @@ Called from a program, takes three args; START, END and STRING."
(defun string-rectangle-line (startpos begextra endextra) (defun string-rectangle-line (startpos begextra endextra)
(let (whitespace) (let (whitespace)
(goto-char startpos) ;; Delete the width of the rectangle.
(delete-region startpos (point))
;; Compute horizontal width of following whitespace. ;; Compute horizontal width of following whitespace.
(let ((ocol (current-column))) (let ((ocol (current-column)))
(skip-chars-forward " \t") (skip-chars-forward " \t")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment