summaryrefslogtreecommitdiff
path: root/lisp/rect.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-05-24 00:52:38 +0000
committerRichard M. Stallman <rms@gnu.org>1998-05-24 00:52:38 +0000
commitecb079ed6d2740f1b624781338236bf04b319919 (patch)
tree7c3ad1964fa48d120f0f08bc56daf92b25da9bba /lisp/rect.el
parentf68af055fb38837041554f7dcd2c52e63f6e05ef (diff)
downloademacs-ecb079ed6d2740f1b624781338236bf04b319919.tar.gz
(close-rectangle): New command.
Diffstat (limited to 'lisp/rect.el')
-rw-r--r--lisp/rect.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/rect.el b/lisp/rect.el
index 2904f94687a..b245e1102c5 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -202,6 +202,23 @@ but instead winds up to the right of the rectangle."
(indent-to (+ endcol whitewidth))))
;;;###autoload
+(defun close-rectangle (start end)
+ "Delete all whitespace following a specified column in each line.
+The left edge of the rectangle specifies the position in each line
+at which whitespace deletion should begin. On each line in the
+rectangle, all continuous whitespace starting at that column is deleted."
+ (interactive "r")
+ (operate-on-rectangle '(lambda (startpos begextra endextra)
+ (save-excursion
+ (goto-char startpos)
+ (delete-region (point)
+ (progn
+ (skip-syntax-forward " ")
+ (point)))))
+ start end t))
+
+
+;;;###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.