From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: recenter-ratio (was: Re: Toolbars on MacOSX) Date: 13 May 2004 10:02:48 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040512.171251.91443934.mituharu@math.s.chiba-u.ac.jp> <87wu3h0wv6.fsf_-_@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084446703 11165 80.91.224.253 (13 May 2004 11:11:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 May 2004 11:11:43 +0000 (UTC) Cc: steventamm@mac.com, YAMAMOTO Mitsuharu , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 13 13:11:35 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOE7j-0003oC-00 for ; Thu, 13 May 2004 13:11:35 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOE7j-00029g-00 for ; Thu, 13 May 2004 13:11:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BODhT-0001mf-Lv for emacs-devel@quimby.gnus.org; Thu, 13 May 2004 06:44:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BODDC-0005SU-9V for emacs-devel@gnu.org; Thu, 13 May 2004 06:13:10 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BOCF6-0000lu-UO for emacs-devel@gnu.org; Thu, 13 May 2004 05:11:37 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOBB4-0004ww-PG for emacs-devel@gnu.org; Thu, 13 May 2004 04:02:51 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1BOBB4-0004It-4B; Thu, 13 May 2004 04:02:50 -0400 Original-To: Juri Linkov In-Reply-To: <87wu3h0wv6.fsf_-_@mail.jurta.org> Original-Lines: 33 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23311 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23311 Juri Linkov 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