mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-30 19:53:09 +00:00
(close-rectangle): New command.
This commit is contained in:
parent
f68af055fb
commit
ecb079ed6d
17
lisp/rect.el
17
lisp/rect.el
@ -201,6 +201,23 @@ but instead winds up to the right of the rectangle."
|
||||
;; Open the desired width, plus same amount of whitespace we just deleted.
|
||||
(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.
|
||||
|
Loading…
Reference in New Issue
Block a user