[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Moveto absolute line number (zmacs)



    Date: Wed, 20 Jun 90 07:01:34 MDT
    From: drstrip@cs.sandia.gov (David R Strip [1411])

    Anyone got a zmacs function that moves to line n?
    Thanks
    Strip
    drstrip@cs.sandia.gov

(defcom com-go-to-line-N "Go to absolute line N in buffer" (KM)
  (move-point (or (forward-line (interval-first-bp *interval*)
				*numeric-arg* nil *interval*)
		  (barf)))
  dis-bps)

You can install this command on a key as you like:

(set-comtab *standard-comtab*
	    `(#\Hyper-G com-to-go-line-N))

Then hyper-102 hyper-G will take you to line 102 (zero is the first line of
the buffer; this is consistent with Source Compare, by the way).