From: Alan Mackenzie <acm@muc.de>
To: volodyan <volodyan@gmail.com>
Cc: Help-gnu-emacs@gnu.org
Subject: Re: Scroll preserving point position - other meaning
Date: Thu, 15 Jan 2009 23:14:33 +0000 [thread overview]
Message-ID: <20090115231432.GA13160@muc.de> (raw)
In-Reply-To: <21472671.post@talk.nabble.com>
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 <space> to set the "mark" to point. Scroll arbitrarily.
Then do C-u C-x <space> 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).
next prev parent reply other threads:[~2009-01-15 23:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 7:29 Scroll preserving point position - other meaning volodyan
2009-01-15 15:25 ` Lennart Borgman
[not found] ` <mailman.4942.1232033132.26697.help-gnu-emacs@gnu.org>
2009-01-15 16:38 ` Andreas Politz
2009-01-15 21:27 ` volodyan
2009-01-15 21:55 ` tyler
2009-01-15 23:14 ` Alan Mackenzie [this message]
2009-01-16 3:10 ` volodyan
[not found] <mailman.4926.1232027586.26697.help-gnu-emacs@gnu.org>
2009-01-15 15:25 ` Xah Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090115231432.GA13160@muc.de \
--to=acm@muc.de \
--cc=Help-gnu-emacs@gnu.org \
--cc=volodyan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.