emacs-devel
[Top][All Lists]
Advanced

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

Re: recenter-ratio (was: Re: Toolbars on MacOSX)


From: David Kastrup
Subject: Re: recenter-ratio (was: Re: Toolbars on MacOSX)
Date: 13 May 2004 10:02:48 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Juri Linkov <address@hidden> writes:

> The following patch introduces a new variable with the default value 2.
> Its value defines a ratio at which the cursor is placed by default
> from the top of the window relative to the window height.  It even
> can be set to the Golden Ratio if one wishes so:
> 
> (setq recenter-ratio (expt (/ (1+ (sqrt 5)) 2) 2))

> -     arg = make_number (ht / 2);
> +     arg = make_number (ht / XFLOATINT (Vrecenter_ratio));

> +  DEFVAR_LISP ("recenter-ratio", &Vrecenter_ratio,
> +            doc: /* Ratio to recenter cursor.  */);
> +  Vrecenter_ratio = 2;

[...]

Nobody can understand how this variable needs to be set.  And the
same goes for the description.  Please make it the inverse instead,
something like
arg = make_number (ht * XFLOATINT (Vrecenter_ratio))

...
recenter_ratio = 0.5;

You also need to make sure that one can't crash Emacs with unusual
settings of the variable: For example, if on some small window heights
recentering fails to bring the cursor back on the window after the
change.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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