Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
131ca136
Commit
131ca136
authored
Mar 27, 1993
by
Eric S. Raymond
Browse files
(fill-rectangle) Added. Inspired by Lynn Slater's insert-box package in LCD,
but the interface and implementation are different.
parent
b0912e2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
lisp/rect.el
lisp/rect.el
+24
-0
No files found.
lisp/rect.el
View file @
131ca136
...
...
@@ -191,6 +191,30 @@ but instead winds up to the right of the rectangle."
(
point
)))
(
indent-to
column
)))
;;;###autoload
(
defun
fill-rectangle
(
start
end
text
)
"Fill each line of the rectangle with corners at point and mark with
text, shifting text right. The text previously in the region is not
overwritten by the blanks, but instead winds up to the right of the
rectangle. Called from a program, takes three args; START, END and
TEXT."
(
interactive
"r\nsText:"
)
(
operate-on-rectangle
'fill-rectangle-line
start
end
nil
)
(
goto-char
start
))
(
defun
fill-rectangle-line
(
startpos
begextra
endextra
)
(
let
((
column
(
+
(
current-column
)
begextra
endextra
)))
(
goto-char
startpos
)
(
let
((
ocol
(
current-column
)))
(
skip-chars-forward
" \t"
)
(
setq
column
(
+
column
(
-
(
current-column
)
ocol
))))
(
delete-region
(
point
)
;; Use skip-chars-backward's LIM argument to leave
;; characters before STARTPOS undisturbed.
(
progn
(
skip-chars-backward
" \t"
startpos
)
(
point
)))
(
insert
text
)))
;;;###autoload
(
defun
clear-rectangle
(
start
end
)
"Blank out rectangle with corners at point and mark.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment