Next Previous Up Top Contents Index

5.3.13 Examples

5.3.13.3 Example 3

The following example illustrates how text might be copied between buffers. First, string is set to all the text infrom-buf. This text is then copied to the end of to-buf.

(in-package 'editor)
(defun copy-string (from-buf to-buf)
   (let ((string (points-to-string  
           (buffers-start from-buf)
           (buffers-end from-buf))))
        (insert-string (buffers-end to-buf) string)))

To test this example, two buffers namedt1 andt2 should be created. Then, to copy all the text fromt1 to the end oft2:

(in-package 'editor)
(copy-string (buffer-from-name "t1") 
						(buffer-from-name "t2"))


LispWorks Editor User Guide - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker