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

Re: 'recenter' in fred?



At 1:25 PM 5/13/95, Paul Shannon wrote:
>What's the equivalent to the emacs 'recenter' function -- usually
>bound to control-L?
>
>Thanks.
>
> - Paul Shannon
>   pshannon@nrao.edu
>   National Radio Astronomy Observatory
>   Charlottesville, Virginia

Slightly modifying ed-scroll-cursor-to-top (from the file
"Examples:assorted-fred-commands.lisp") yields:

(defmethod ed-scroll-cursor-to-middle ((w fred-mixin))
  (let* ((frec (frec w))
         (bpos (buffer-position (fred-buffer w)))
         (lines (frec-full-lines frec))
         (context (round lines 2)))
    (set-mark (fred-display-start-mark w)
              (frec-screen-line-start frec bpos (- context)))
    (with-focused-view w
      (frec-draw-contents frec t))))

which should do what you want; bind it to control-l like so:

(comtab-set-key *comtab* '(:control #\l) 'ed-scroll-cursor-to-middle)

- Steve Hain

Digitool, Inc.
______________________________________________________________________________
                       One Main Street   7th Floor   Cambridge, MA 02142   USA
                              Internet: slh@digitool.com   AppleLink: digitool
                                      World Wide Web: http://www.digitool.com/
                                         Tel: 617 441-5000   Fax: 617 576-7680