Next Previous Up Top Contents Index

5.3.13 Examples

5.3.13.2 Example 2

This example creates a new editor command calledGoto Line which moves the current point to the specified line number.

(in-package 'editor)
(defcommand "Goto Line" (p)
   "Moves the current point to a specified line number.
    The number can either be supplied via the prefix
    argument, or, if this is nil, it is prompted for."
   "Moves the current point to a specified line number."
   (let ((line-number  
          (or p (prompt-for-integer  
                 :prompt "Line number: "
                 :help "Type in the number of the line to
                  go to"))))
        (beginning-of-buffer-command nil)
        (next-line-command line-number)))


LispWorks Editor User Guide - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker