From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.devel Subject: Re: Preserving sanity in Emacs [Re: rampant region highlighting] Date: Tue, 08 Apr 2008 18:52:43 +0100 Message-ID: <47FBB0EB.3070908@harpegolden.net> References: <47F945C3.1060103@harpegolden.net> <20080406230056.GB5362@muc.de> <47F961D2.7080002@harpegolden.net> <20080407212617.GC2078@muc.de> <47FAA940.10302@harpegolden.net> <20080408103110.GC2937@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207677217 32025 80.91.229.12 (8 Apr 2008 17:53:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2008 17:53:37 +0000 (UTC) Cc: Glenn Morris , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 08 19:54:10 2008 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 1JjI17-0000im-LK for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 19:53:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjI0U-00043m-DM for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 13:53:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JjI0C-0003xB-F2 for emacs-devel@gnu.org; Tue, 08 Apr 2008 13:53:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JjI09-0003wM-Aw for emacs-devel@gnu.org; Tue, 08 Apr 2008 13:52:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjI09-0003wE-38 for emacs-devel@gnu.org; Tue, 08 Apr 2008 13:52:57 -0400 Original-Received: from harpegolden.net ([65.99.215.13]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JjI04-0002oD-F7; Tue, 08 Apr 2008 13:52:52 -0400 Original-Received: from golden1.harpegolden.net (86-43-174-84.b-ras2.prp.dublin.eircom.net [86.43.174.84]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 2" (verified OK)) by harpegolden.net (Postfix) with ESMTP id C82908421; Tue, 8 Apr 2008 17:52:50 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080110) In-Reply-To: <20080408103110.GC2937@muc.de> X-Enigmail-Version: 0.95.0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:94725 Archived-At: Alan Mackenzie wrote: > Morning, David! Morning. Ish. (I'm largely nocturnal by default) >>> So, how do you move point rapidly to somewhere else in a buffer? >>> There's not much point using the key, if the moment you >>> try to do something you're jump-scrolled back to where you started. > >> That just depends on whether you conceptualise a "page down" keypress >> as "move the point down by a page, and scroll to follow" or "scroll the >> viewport down (or up) by a page". > > No it doesn't. You should be a politician. ;-) The key sequences you > need depend on what has been implemented, not the conceptualisation which > gave rise to that implementation. I want to scroll with and > then type text at the place I've scrolled to. How? > Maybe I wasn't clear: PgUp/Dn would still move the point around the buffer, as I would consider them analogous to cursor keys (cursor keys also move the point around the buffer in emacs - and when they move the point to somewhere currently offscreen, emacs scrolls the viewport to bring it back on...). i.e. PgUp/Dn means "move the point one page up or down" C-M-Pgdown mightn't move the point, but only scroll the viewport. viewport here is ancient amiga terminology, no idea what the youngsters call it, I mean in a (perhaps virtual) 2D plane, the viewport is the "window" onto the plane that is viewed. +---Plane=----------------+ | | | +-VP-+ | | | | | | +----+ | | | | | +-------------------------+ 2D scrolling is moving a viewport around a 2D plane, or equivalently, moving the 2D plane around beneath the viewport. Note that I mean that's the model that is desired - in programming terms, the 2D plane might be an entirely fictional entity, contents of the viewport JIT rendered into place. That's AFAIK what emacs basically does, the current viewport position over the buffer being "window-start". >> (though I guess that should be for shift-selection by pages in emacs, >> and M-pgdn/up for scroll-other-window is handy. C-pgdn/up is taken >> too, for scroll-left/right (not the most intuitive binding, that, byt >> hey, I tend to use line wrapping anyway), but that really only leaves >> C-M-pgdn/up for page-up-leaving-point-where-it-is. > > Exactly! Bindings involving arrow keys and scrolling keys are precious. > > So lets get back to the point. Do you have a mechanism, not involving > the mouse, by which, having scrolled and left point not on the visible > part of the buffer in the window, you can indicate a position to move > point to and then move it there? Not as such, but one could easily be imagined, like a keypress. However, I think you've missed the point - if I'm scrolling with the mouse wheel or scroll bar, my hand is already on the mouse, so clicking is hardly a chore, and mouse scrolling can thus be a viewport scroll by default, with a click to summon the point to the current viewport location. If I'm "scrolling" with PgUp/Dn, by the above, the "scrolling" is just a side effect, the PgUp/Dn can be conceptualised as /moving the point/ up or down by one page in the buffer, and emacs then happens to autoscroll the viewport to bring the point back onscreen. So a keybinding for moving the point onscreen to the current viewport position would only be "needed" for the C-M-pgdn/up (just calling it that for example purposes) case, to be equivalent to the mouse click. And I don't think the need is particularly strong, because it would only apply when you decide to C-M-pgdn/up to gawk at something, but then change your mind and want to move the point to it - when you start out wanting to move the point up and down by pages, you just PgUp/PgDn.