aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love1999-08-23 14:28:34 +0000
committerDave Love1999-08-23 14:28:34 +0000
commite037c34cee7b2b579d764ce7cd9c50af32cd8034 (patch)
treefa95695144f9f2176c647a649f2762e0c35983e0
parent2ea6666cf7299da741c2c7d61787dc21babd9cec (diff)
downloademacs-e037c34cee7b2b579d764ce7cd9c50af32cd8034.tar.gz
emacs-e037c34cee7b2b579d764ce7cd9c50af32cd8034.zip
Add/fix various doc strings. Add `*' to all the interactive specs.
-rw-r--r--lisp/rect.el76
1 files changed, 41 insertions, 35 deletions
diff --git a/lisp/rect.el b/lisp/rect.el
index 437f030395d..1e1a9baa851 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -24,7 +24,7 @@
24 24
25;;; Commentary: 25;;; Commentary:
26 26
27;; This package provides the operations on rectangles that are ocumented 27;; This package provides the operations on rectangles that are documented
28;; in the Emacs manual. 28;; in the Emacs manual.
29 29
30;; ### NOTE: this file has been almost completely rewritten by Didier Verna 30;; ### NOTE: this file has been almost completely rewritten by Didier Verna
@@ -111,7 +111,7 @@ Point is at the end of the segment of this line within the rectangle."
111(defun apply-on-rectangle (function start end &rest args) 111(defun apply-on-rectangle (function start end &rest args)
112 "Call FUNCTION for each line of rectangle with corners at START, END. 112 "Call FUNCTION for each line of rectangle with corners at START, END.
113FUNCTION is called with two arguments: the start and end columns of the 113FUNCTION is called with two arguments: the start and end columns of the
114rectangle, plus ARGS extra arguments. Point is at the beginning of line when 114rectangle, plus ARGS extra arguments. Point is at the beginning of line when
115the function is called." 115the function is called."
116 (let (startcol startpt endcol endpt) 116 (let (startcol startpt endcol endpt)
117 (save-excursion 117 (save-excursion
@@ -203,21 +203,23 @@ the function is called."
203 203
204;;;###autoload 204;;;###autoload
205(defun delete-rectangle (start end &optional fill) 205(defun delete-rectangle (start end &optional fill)
206 "Delete (don't save) text in rectangle with corners at point and mark (START 206 "Delete (don't save) text in the region-rectangle.
207and END when called from a program). The same range of columns is deleted in 207The same range of columns is deleted in each line starting with the
208each line starting with the line where the region begins and ending with the 208line where the region begins and ending with the line where the region
209line where the region ends. 209ends.
210 210
211With a prefix (or a FILL) argument, also fill lines where nothing has to be 211When called from a program the rectangle's corners are START and END.
212deleted." 212With a prefix (or a FILL) argument, also fill lines where nothing has
213 (interactive "r\nP") 213to be deleted."
214 (interactive "*r\nP")
214 (apply-on-rectangle 'delete-rectangle-line start end fill)) 215 (apply-on-rectangle 'delete-rectangle-line start end fill))
215 216
216;;;###autoload 217;;;###autoload
217(defun delete-extract-rectangle (start end &optional fill) 218(defun delete-extract-rectangle (start end &optional fill)
218 "Delete the contents of the rectangle with corners at START and END, and 219 "Delete the contents of the region-rectangle.
219return it as a list of strings, one for each line of the rectangle. 220Return it as a list of strings, one for each line of the rectangle.
220 221
222When called from a program the rectangle's corners are START and END.
221With an optional FILL argument, also fill lines where nothing has to be 223With an optional FILL argument, also fill lines where nothing has to be
222deleted." 224deleted."
223 (let ((lines (list nil))) 225 (let ((lines (list nil)))
@@ -226,24 +228,25 @@ deleted."
226 228
227;;;###autoload 229;;;###autoload
228(defun extract-rectangle (start end) 230(defun extract-rectangle (start end)
229 "Return the contents of the rectangle with corners at START and END, 231 "Return the contents of the rectangle with corners at START and END.
230as a list of strings, one for each line of the rectangle." 232Return it as a list of strings, one for each line of the rectangle."
231 (let ((lines (list nil))) 233 (let ((lines (list nil)))
232 (apply-on-rectangle 'extract-rectangle-line start end lines) 234 (apply-on-rectangle 'extract-rectangle-line start end lines)
233 (nreverse (cdr lines)))) 235 (nreverse (cdr lines))))
234 236
235(defvar killed-rectangle nil 237(defvar killed-rectangle nil
236 "Rectangle for yank-rectangle to insert.") 238 "Rectangle for `yank-rectangle' to insert.")
237 239
238;;;###autoload 240;;;###autoload
239(defun kill-rectangle (start end &optional fill) 241(defun kill-rectangle (start end &optional fill)
240 "Delete the rectangle with corners at point and mark (START and END when 242 "Delete the region-rectangle and save it as the last killed one.
241called from a program) and save it as the last killed one. You might prefer to 243
242use `delete-extract-rectangle' from a program. 244When called from a program the rectangle's corners are START and END.
245You might prefer to use `delete-extract-rectangle' from a program.
243 246
244With a prefix (or a FILL) argument, also fill lines where nothing has to be 247With a prefix (or a FILL) argument, also fill lines where nothing has to be
245deleted." 248deleted."
246 (interactive "r\nP") 249 (interactive "*r\nP")
247 (when buffer-read-only 250 (when buffer-read-only
248 (setq killed-rectangle (extract-rectangle start end)) 251 (setq killed-rectangle (extract-rectangle start end))
249 (barf-if-buffer-read-only)) 252 (barf-if-buffer-read-only))
@@ -253,7 +256,7 @@ deleted."
253;;;###autoload 256;;;###autoload
254(defun yank-rectangle () 257(defun yank-rectangle ()
255 "Yank the last killed rectangle with upper left corner at point." 258 "Yank the last killed rectangle with upper left corner at point."
256 (interactive) 259 (interactive "*")
257 (insert-rectangle killed-rectangle)) 260 (insert-rectangle killed-rectangle))
258 261
259;; this one is untoutched --dv 262;; this one is untoutched --dv
@@ -281,14 +284,15 @@ and point is at the lower right corner."
281 284
282;;;###autoload 285;;;###autoload
283(defun open-rectangle (start end &optional fill) 286(defun open-rectangle (start end &optional fill)
284 "Blank out rectangle with corners at point and mark (START and END when 287 "Blank out the region-rectangle, shifting text right.
285called from a program), shifting text right. The text previously in the region 288
286is not overwritten by the blanks, but instead winds up to the right of the 289The text previously in the region is not overwritten by the blanks,
287rectangle. 290but instead winds up to the right of the rectangle.
288 291
292When called from a program the rectangle's corners are START and END.
289With a prefix (or a FILL) argument, fill with blanks even if there is no text 293With a prefix (or a FILL) argument, fill with blanks even if there is no text
290on the right side of the rectangle." 294on the right side of the rectangle."
291 (interactive "r\nP") 295 (interactive "*r\nP")
292 (apply-on-rectangle 'open-rectangle-line start end fill) 296 (apply-on-rectangle 'open-rectangle-line start end fill)
293 (goto-char start)) 297 (goto-char start))
294 298
@@ -314,8 +318,9 @@ The left edge of the rectangle specifies the position in each line
314at which whitespace deletion should begin. On each line in the 318at which whitespace deletion should begin. On each line in the
315rectangle, all continuous whitespace starting at that column is deleted. 319rectangle, all continuous whitespace starting at that column is deleted.
316 320
321When called from a program the rectangle's corners are START and END.
317With a prefix (or a FILL) argument, also fill too short lines." 322With a prefix (or a FILL) argument, also fill too short lines."
318 (interactive "r\nP") 323 (interactive "*r\nP")
319 (apply-on-rectangle 'delete-whitespace-rectangle-line start end fill)) 324 (apply-on-rectangle 'delete-whitespace-rectangle-line start end fill))
320 325
321;; not used any more --dv 326;; not used any more --dv
@@ -325,11 +330,12 @@ With a prefix (or a FILL) argument, also fill too short lines."
325 330
326;;;###autoload 331;;;###autoload
327(defun string-rectangle (start end string) 332(defun string-rectangle (start end string)
328 "Insert STRING on each line of the rectangle with corners at point and mark 333 "Insert STRING on each line of the region-rectangle, shifting text right.
329(START and END when called from a program), shifting text right. The left edge 334
330of the rectangle specifies the column for insertion. This command does not 335When called from a program the rectangle's corners are START and END.
331delete or overwrite any existing text." 336The left edge of the rectangle specifies the column for insertion.
332 (interactive "r\nsString rectangle: ") 337This command does not delete or overwrite any existing text."
338 (interactive "*r\nsString rectangle: ")
333 (apply-on-rectangle 'string-rectangle-line start end string)) 339 (apply-on-rectangle 'string-rectangle-line start end string))
334 340
335(defun string-rectangle-line (startcol endcol string) 341(defun string-rectangle-line (startcol endcol string)
@@ -338,13 +344,13 @@ delete or overwrite any existing text."
338 344
339;;;###autoload 345;;;###autoload
340(defun clear-rectangle (start end &optional fill) 346(defun clear-rectangle (start end &optional fill)
341 "Blank out the rectangle with corners at point and mark (START and END when 347 "Blank out the region-rectangle.
342called from a program). The text previously in the region is overwritten with 348The text previously in the region is overwritten with blanks.
343blanks.
344 349
350When called from a program the rectangle's corners are START and END.
345With a prefix (or a FILL) argument, also fill with blanks the parts of the 351With a prefix (or a FILL) argument, also fill with blanks the parts of the
346rectangle which were empty." 352rectangle which were empty."
347 (interactive "r\nP") 353 (interactive "*r\nP")
348 (apply-on-rectangle 'clear-rectangle-line start end fill)) 354 (apply-on-rectangle 'clear-rectangle-line start end fill))
349 355
350(defun clear-rectangle-line (startcol endcol fill) 356(defun clear-rectangle-line (startcol endcol fill)