From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: Scroll preserving point position - other meaning Date: Thu, 15 Jan 2009 23:14:33 +0000 Message-ID: <20090115231432.GA13160@muc.de> References: <21472671.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1232061097 12669 80.91.229.12 (15 Jan 2009 23:11:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Jan 2009 23:11:37 +0000 (UTC) Cc: Help-gnu-emacs@gnu.org To: volodyan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 16 00:12:49 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LNbOC-0005AQ-KZ for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Jan 2009 00:12:41 +0100 Original-Received: from localhost ([127.0.0.1]:50214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNbMv-0002mq-52 for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Jan 2009 18:11:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNb9A-0005PX-Ac for help-gnu-emacs@gnu.org; Thu, 15 Jan 2009 17:57:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNb97-0005PH-H7 for Help-gnu-emacs@gnu.org; Thu, 15 Jan 2009 17:57:07 -0500 Original-Received: from [199.232.76.173] (port=43819 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNb97-0005PE-Cx for Help-gnu-emacs@gnu.org; Thu, 15 Jan 2009 17:57:05 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:3403 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNb94-0004Vt-V2 for Help-gnu-emacs@gnu.org; Thu, 15 Jan 2009 17:57:05 -0500 Original-Received: (qmail 68082 invoked by uid 3782); 15 Jan 2009 22:56:46 -0000 Original-Received: from acm.muc.de (pD9E50986.dip.t-dialin.net [217.229.9.134]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 15 Jan 2009 23:56:44 +0100 Original-Received: (qmail 14741 invoked by uid 1000); 15 Jan 2009 23:14:33 -0000 Content-Disposition: inline In-Reply-To: <21472671.post@talk.nabble.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61383 Archived-At: Hi, On Wed, Jan 14, 2009 at 11:29:57PM -0800, volodyan wrote: > Hi, > I am using Emacs with X and struggling to do the following. How can I > preserve point's position while scrolling IN TEXT? You can't. This is one of the few things, possibly the only thing, that you can't configure in Emacs. "Point" (that's the cursor position) is constrained to be on the screen; lots of code depends on this. The next question is what do you _really_ want to do? There are likely other things ways you can achieve this, whatever it is, in Emacs. > I spent hours roaming through Internet/searched the forum, but everyone > seems to be interested in preserving point's position on screen. I want > to be able to use scroll bar with a mouse or PageUp/Down to look > something up and then return, but the point insists on staying on > screen. It does. A couple of suggestions: (i) Split the screen with C-x 2 (That's "control-x" then "2"). Scroll within one of the windows. Point will stay the same in the other window. When you're ready, do C-x 0 to get rid of the "scrolly" window. (ii) Do C-x to set the "mark" to point. Scroll arbitrarily. Then do C-u C-x to jump back to the mark. > Another, I think related issue, if I want to find a matching > parentheses, I click on one and the region between the two is selected. > If this region fits the screen - fine. But if not, when I try scrolling > using a mouse to find another end of the region, the region gets > unselected. If you're at an open paren, C-M-n (that's "control-meta-n", i.e. hold the control and alt keys whilst you type n; the PC's alt key is called "meta" for historical reasons) will take you to the matching close paren. C-M-p will take you from (just after) a close paren back to the open paren. Think of "next" for n and "previous" for p. Actually, you don't have to be AT the paren, just outside it, somewhere. A related command is C-M-k, which "kills" the entire bit between the following parens. You can then "yank" (i.e. paste) it back again somewhere with C-y. > In all other graphical editors scrolling with a mouse doesn't move > point/unselects region. I just "upgraded" to Emacs from Eclipse and I > guess there is a way to get such behavior in Emacs. How? Emacs is primarily a text editor. :-) It works equally well on a terminal without a mouse, say over a comms line. Only some actions can be done conveniently with the mouse. I'd recommend you to learn some key sequences (such as the ones above) too. Try C-M-a and C-M-e sometime. :-) > Thanks for your help -- Alan Mackenzie (Nuremberg, Germany).