From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie_JWA Newsgroups: gmane.emacs.devel Subject: Re: recenter-top-bottom Date: Wed, 7 Nov 2007 14:16:23 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0539119196==" X-Trace: ger.gmane.org 1194441199 20372 80.91.229.12 (7 Nov 2007 13:13:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Nov 2007 13:13:19 +0000 (UTC) Cc: Richard Stallman To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 07 14:13:20 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 1Ipkic-0004GI-HE for ged-emacs-devel@m.gmane.org; Wed, 07 Nov 2007 14:13:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpkiR-00035I-AK for ged-emacs-devel@m.gmane.org; Wed, 07 Nov 2007 08:13:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ipkhs-0002et-MT for emacs-devel@gnu.org; Wed, 07 Nov 2007 08:12:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ipkhq-0002bd-LI for emacs-devel@gnu.org; Wed, 07 Nov 2007 08:12:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ipkhq-0002bK-EG for emacs-devel@gnu.org; Wed, 07 Nov 2007 08:12:30 -0500 Original-Received: from gw-eur4.philips.com ([161.85.125.10]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1Ipkhk-0000il-JV; Wed, 07 Nov 2007 08:12:25 -0500 Original-Received: from smtpscan-eur8.philips.com (smtpscan-eur8.mail.philips.com [130.144.57.173]) by gw-eur4.philips.com (Postfix) with ESMTP id B9FCB49709; Wed, 7 Nov 2007 13:11:44 +0000 (UTC) Original-Received: from smtpscan-eur8.philips.com (localhost [127.0.0.1]) by localhost.philips.com (Postfix) with ESMTP id BD14D119; Wed, 7 Nov 2007 13:12:20 +0000 (GMT) Original-Received: from smtprelay-eur2.philips.com (smtprelay-eur2.philips.com [130.144.57.171]) by smtpscan-eur8.philips.com (Postfix) with ESMTP id 83939411; Wed, 7 Nov 2007 13:12:20 +0000 (GMT) Original-Received: from ehvrmh02.diamond.philips.com (ehvrmh02-srv.diamond.philips.com [130.139.27.125]) by smtprelay-eur2.philips.com (Postfix) with ESMTP id 4BCFFAB; Wed, 7 Nov 2007 13:12:20 +0000 (GMT) X-Mailer: Lotus Notes Release 6.0.3 September 26, 2003 X-MIMETrack: Serialize by Router on ehvrmh02/H/SERVER/PHILIPS(Release 6.5.5FP2HF490 | September 8, 2007) at 07/11/2007 14:16:32 X-detected-kernel: by monty-python.gnu.org: Solaris 8 (2) 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:82731 Archived-At: --===============0539119196== Content-type: multipart/alternative; Boundary="0__=4EBBF91FDFD59AFC8f9e8a93df938690918c4EBBF91FDFD59AFC" Content-Disposition: inline --0__=4EBBF91FDFD59AFC8f9e8a93df938690918c4EBBF91FDFD59AFC Content-type: text/plain; charset=US-ASCII [Apologies for the lack of threading, etc.] > With a prefix arg, it's the same as `recenter'. Otherwise, it alternately > moves the current line to the center, top, and bottom of the window. In > this, it's a bit like `C-M-l'. It's a trivial change, but I find it useful - > I have no need for repeated `C-l' to keep doing the same thing. > It looks good to me. What do others think? I wouldn't like it, because I'd find it too slow. I've had defuns bound to C-S-/ for years, which move point directly to the top/bottom of the window without passing Go or collecting $200. If I want to zap point to BOW, I want it done NOW, atomically, not as a triple key-sequence. For this reason, I'd find the new command an irritation. I think it would thus be better to have a user option to request this new behaviour: something like this (untested): [I've also edited the doc string; "alternately" is inappropriate for three things; "successively" is right.] (defvar recenter-triple-action-flag t ; or nil ??? "....") (defun recenter-top-bottom (&optional arg) "Move current line successively to window center, top, and bottom. <===== With prefix ARG, move current line to window-line ARG. If option `recenter-triple-action-flag' is NIL, just recenter." ; <===== (interactive "P") (cond ((and recenter-triple-action-flag ; <========= (eq this-command last-command) (not arg)) (setq this-command 'recenter-top-bottom-1) (recenter 0)) ((and recenter-triple-action-flag ; <========= (eq 'recenter-top-bottom-1 last-command) (not arg)) (setq this-command 'recenter-top-bottom-2) (recenter -1)) (t (recenter arg)))) Perhaps its behaviour could be changed so that the current window line is the criterion for where to go, thusly: (or ) -> -> -> . This would make the new command more consistent with C-M-l `reposition-window'. -- Alan Mackenzie (Nuremberg, Germany). --0__=4EBBF91FDFD59AFC8f9e8a93df938690918c4EBBF91FDFD59AFC Content-type: text/html; charset=US-ASCII Content-Disposition: inline

[Apologies for the lack of threading, etc.]

>     With a prefix arg, it's the same as `recenter'. Otherwise, it alternately
>     moves the current line to the center, top, and bottom of the window. In
>     this, it's a bit like `C-M-l'. It's a trivial change, but I find it useful -
>     I have no need for repeated `C-l' to keep doing the same thing.

> It looks good to me.  What do others think?


I wouldn't like it, because I'd find it too slow.  I've
had defuns bound to C-S-<right>/<left> for years, which
move point directly to the top/bottom of the window
without passing Go or collecting $200.  If I want to zap
point to BOW, I want it done NOW, atomically, not as a
triple key-sequence.

For this reason, I'd find the new command an irritation.

I think it would thus be better to have a user option to
request this new behaviour: something like this (untested):

[I've also edited the doc string; "alternately" is
 inappropriate for three things; "successively" is right.]

(defvar recenter-triple-action-flag t  ; or nil ???
  "....")

(defun recenter-top-bottom (&optional arg)
 "Move current line successively to window center, top, and bottom.  <=====
With prefix ARG, move current line to window-line ARG.

If option `recenter-triple-action-flag' is NIL, just recenter."   ; <=====
 (interactive "P")
 (cond ((and recenter-triple-action-flag           ; <=========

              (eq this-command last-command) (not arg))
        (setq this-command 'recenter-top-bottom-1)
        (recenter 0))
       ((and recenter-triple-action-flag           ; <=========

              (eq 'recenter-top-bottom-1 last-command) (not arg))
        (setq this-command 'recenter-top-bottom-2)
        (recenter -1))
       (t
        (recenter arg))))

Perhaps its behaviour could be changed so that the
current window line is the criterion for where to go,
thusly:
(or <RANDOM> <BOTTOM>) -> <MIDDLE>
<MIDDLE> -> <TOP>
<TOP> -> <BOTTOM>.
This would make the new command more consistent with
C-M-l `reposition-window'.

--

Alan Mackenzie (Nuremberg, Germany).
--0__=4EBBF91FDFD59AFC8f9e8a93df938690918c4EBBF91FDFD59AFC-- --===============0539119196== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0539119196==--