Next Previous Up Top Contents Index

5.3.13 Examples

5.3.13.1 Example 1

The following simple example creates a new editor command calledWhat Line.

(in-package 'editor)
(defcommand "What Line" (p)  
    "Computes the line number of the current point and
     prints it in the Echo Area"
    "Prints the line number of the current point"  
    (let* ((cpoint (current-point))
           (svpoint (copy-point cpoint))
           (count 0))
          (beginning-of-buffer-command nil)
          (loop
             (if (point > cpoint svpoint)
                 (return))
             (unless (next-line-command)
                 (return))
             (incf count))
          (move-point cpoint svpoint)
          (message "Line Number: ~S " count)))


LispWorks Editor User Guide - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker