NextPrevUpTopContentsIndex

6.3.14.2 Example 2

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

(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 (editor:prompt-for-integer  
                 :prompt "Line number: "
                 :help "Type in the number of the line to
                  go to"))))
        (editor:beginning-of-buffer-command nil)
        (editor:next-line-command line-number)))

LispWorks Editor User Guide (Macintosh version) - 23 Feb 2006

NextPrevUpTopContentsIndex