comparison lisp/rect.el @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
27 ;;; Commentary: 27 ;;; Commentary:
28 28
29 ;; This package provides the operations on rectangles that are documented 29 ;; This package provides the operations on rectangles that are documented
30 ;; in the XEmacs Reference Manual. 30 ;; in the XEmacs Reference Manual.
31 31
32 ;; ### NOTE: this file has been almost completely rewritten by Didier Verna 32 ;; #### NOTE: this file has been almost completely rewritten by Didier Verna
33 ;; <verna@inf.enst.fr>, Jul 99. The purpose of this rewrite is to be less 33 ;; <verna@inf.enst.fr>, Jul 99. The purpose of this rewrite is to be less
34 ;; intrusive and fill lines with whitespaces only when needed. A few functions 34 ;; intrusive and fill lines with whitespaces only when needed. A few functions
35 ;; are untouched though, as noted above their definition. 35 ;; are untouched though, as noted above their definition.
36 36
37 37
38 ;;; Code: 38 ;;; Code:
39 39
40 ;; ### NOTE: this function is untouched, but not used anymore. 40 ;; #### NOTE: this function is untouched, but not used anymore.
41 ;; `apply-on-rectangle' is used instead. It's still there because it's 41 ;; `apply-on-rectangle' is used instead. It's still there because it's
42 ;; documented so people might use it in their code, so I've decided not to 42 ;; documented so people might use it in their code, so I've decided not to
43 ;; touch it. --dv 43 ;; touch it. --dv
44 ;; XEmacs: extra-args 44 ;; XEmacs: extra-args
45 (defun operate-on-rectangle (function start end coerce-tabs &rest extra-args) 45 (defun operate-on-rectangle (function start end coerce-tabs &rest extra-args)
202 as a list of strings, one for each line of the rectangle." 202 as a list of strings, one for each line of the rectangle."
203 (let ((lines (list nil))) 203 (let ((lines (list nil)))
204 (apply-on-rectangle 'extract-rectangle-line start end lines) 204 (apply-on-rectangle 'extract-rectangle-line start end lines)
205 (nreverse (cdr lines)))) 205 (nreverse (cdr lines))))
206 206
207 ;; ### NOTE: this is actually the only function that needs to do complicated 207 ;; #### NOTE: this is actually the only function that needs to do complicated
208 ;; stuff like what's happening in `operate-on-rectangle', because the buffer 208 ;; stuff like what's happening in `operate-on-rectangle', because the buffer
209 ;; might be read-only. --dv 209 ;; might be read-only. --dv
210 (defun extract-rectangle-line (startcol endcol lines) 210 (defun extract-rectangle-line (startcol endcol lines)
211 (let (start end begextra endextra line) 211 (let (start end begextra endextra line)
212 (move-to-column startcol) 212 (move-to-column startcol)