comparison lisp/rect.el @ 410:de805c49cfc1 r21-2-35

Import from CVS: tag r21-2-35
author cvs
date Mon, 13 Aug 2007 11:19:21 +0200
parents 2f8bb876ab1d
children 697ef44129c6
comparison
equal deleted inserted replaced
409:301b9ebbdf3b 410:de805c49cfc1
271 (insert (car lines)) 271 (insert (car lines))
272 (setq lines (cdr lines))))) 272 (setq lines (cdr lines)))))
273 273
274 274
275 (defun open-rectangle-line (startcol endcol fill) 275 (defun open-rectangle-line (startcol endcol fill)
276 (let (spaces) 276 (when (= (move-to-column startcol (or fill 'coerce)) startcol)
277 (when (= (move-to-column startcol (or fill 'coerce)) startcol) 277 (unless (and (not fill)
278 (unless (and (not fill) 278 (= (point) (point-at-eol)))
279 (= (point) (point-at-eol))) 279 (indent-to endcol))))
280 (indent-to endcol)))
281 ))
282 280
283 ;;;###autoload 281 ;;;###autoload
284 (defun open-rectangle (start end &optional fill) 282 (defun open-rectangle (start end &optional fill)
285 "Blank out the region-rectangle, shifting text right. 283 "Blank out the region-rectangle, shifting text right.
286 284
306 If `pending-delete-mode' is active the string replace the region. 304 If `pending-delete-mode' is active the string replace the region.
307 Otherwise this command does not delete or overwrite any existing text. 305 Otherwise this command does not delete or overwrite any existing text.
308 306
309 When called from a program, the rectangle's corners are START and END." 307 When called from a program, the rectangle's corners are START and END."
310 (interactive "*r\nsString rectangle: ") 308 (interactive "*r\nsString rectangle: ")
309 (defvar pending-delete-mode)
311 (apply-on-rectangle 'string-rectangle-line start end string 310 (apply-on-rectangle 'string-rectangle-line start end string
312 (and (boundp 'pending-delete-mode) pending-delete-mode))) 311 (and (boundp 'pending-delete-mode) pending-delete-mode)))
313 312
314 (defun replace-rectangle (start end string) 313 (defun replace-rectangle (start end string)
315 "Like `string-rectangle', but unconditionally replace the original region, 314 "Like `string-rectangle', but unconditionally replace the original region,