Mercurial > emacs
comparison lisp/rect.el @ 22205:8576d32229fc
(close-rectangle): New command.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 24 May 1998 00:52:38 +0000 |
parents | d8478556c7f0 |
children | 84c3c863f0bd |
comparison
equal
deleted
inserted
replaced
22204:e1921cd8a532 | 22205:8576d32229fc |
---|---|
200 (delete-region startpos (point)) | 200 (delete-region startpos (point)) |
201 ;; Open the desired width, plus same amount of whitespace we just deleted. | 201 ;; Open the desired width, plus same amount of whitespace we just deleted. |
202 (indent-to (+ endcol whitewidth)))) | 202 (indent-to (+ endcol whitewidth)))) |
203 | 203 |
204 ;;;###autoload | 204 ;;;###autoload |
205 (defun close-rectangle (start end) | |
206 "Delete all whitespace following a specified column in each line. | |
207 The left edge of the rectangle specifies the position in each line | |
208 at which whitespace deletion should begin. On each line in the | |
209 rectangle, all continuous whitespace starting at that column is deleted." | |
210 (interactive "r") | |
211 (operate-on-rectangle '(lambda (startpos begextra endextra) | |
212 (save-excursion | |
213 (goto-char startpos) | |
214 (delete-region (point) | |
215 (progn | |
216 (skip-syntax-forward " ") | |
217 (point))))) | |
218 start end t)) | |
219 | |
220 | |
221 ;;;###autoload | |
205 (defun string-rectangle (start end string) | 222 (defun string-rectangle (start end string) |
206 "Insert STRING on each line of the region-rectangle, shifting text right. | 223 "Insert STRING on each line of the region-rectangle, shifting text right. |
207 The left edge of the rectangle specifies the column for insertion. | 224 The left edge of the rectangle specifies the column for insertion. |
208 This command does not delete or overwrite any existing text. | 225 This command does not delete or overwrite any existing text. |
209 | 226 |