From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: recenter-top-bottom Date: Thu, 15 Nov 2007 07:52:23 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1195142007 3365 80.91.229.12 (15 Nov 2007 15:53:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Nov 2007 15:53:27 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 15 16:53:32 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ish1g-0006im-2A for ged-emacs-devel@m.gmane.org; Thu, 15 Nov 2007 16:53:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ish1T-0003wO-6W for ged-emacs-devel@m.gmane.org; Thu, 15 Nov 2007 10:52:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ish1Q-0003wI-Bq for emacs-devel@gnu.org; Thu, 15 Nov 2007 10:52:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ish1M-0003v1-MD for emacs-devel@gnu.org; Thu, 15 Nov 2007 10:52:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ish1M-0003uy-KB for emacs-devel@gnu.org; Thu, 15 Nov 2007 10:52:48 -0500 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ish1B-0006vI-5y; Thu, 15 Nov 2007 10:52:37 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id lAFFqYQf014437; Thu, 15 Nov 2007 08:52:34 -0700 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id lAF1POXX027655; Thu, 15 Nov 2007 08:52:33 -0700 Original-Received: from dhcp-amer-whq-csvpn-gw3-141-144-81-159.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3367566481195141929; Thu, 15 Nov 2007 07:52:09 -0800 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:83276 Archived-At: > 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.