emacs-devel
[Top][All Lists]
Advanced

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

RE: recenter-top-bottom


From: Drew Adams
Subject: RE: recenter-top-bottom
Date: Thu, 15 Nov 2007 07:52:23 -0800

> Looks OK, except I'd rather not fool around with last-command and
> this-command:
>
> (defvar recenter-last-op nil)
>
>    ;; First time - save mode and recenter.
>    (let ((bottom (1+ (count-lines 1 (window-end))))
>          (current (1+ (count-lines 1 (point))))
>          (total (window-height)))
>      (setq recenter-last-op (if (< (- bottom current) (/ total 3))
>                                 'recenter-tb-middle-1)
>                               'recenter-tb-middle)

I was specifically trying to avoid a new global variable, thinking setting
`this-command' was cleaner. Doesn't matter to me, though - go for it, and
please add whatever comments RMS wants.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]