unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Cristian Gutierrez <crgutier@dcc.uchile.cl>
Subject: Re: Emacs text cursor position
Date: Tue, 25 Jan 2005 16:04:49 -0300	[thread overview]
Message-ID: <87llahnxda.fsf@guti.no-ip.org> (raw)
In-Reply-To: 56c3c0f6.0501221905.233bd40c@posting.google.com

Este domingo, ummajera@yahoo.ca dijo:
> I'm trying to customize Emacs to my needs/wants and so far so good.
> The only snag I encountered is in the position of the cursor. I want
> to be able to to scroll the  buffer with mouse wheel or on the scroll
> bars and have the cursor remain on the original line, even if the
> cursor moves off-screen. Then when I start typing, emacs does C-l to
> center back on the cursor, if the cursor is off-screen.
>
> Is it possible to customize Emacs in this way? How can I set "mouse
> scroll" not to affect the position of the cursor?

Not exactly what you're asking (dunno about the mouse wheel), but I use
this hack to scroll text without getting the cursor off the center of
the screen:

,----
| ;; "smooth" scroll
| (defun guti-scroll-up (cuenta)
|   (interactive "p")
|   (move-to-window-line nil)
|   (scroll-up cuenta)
|   (forward-line cuenta)
|   )
| 
| (defun guti-scroll-down (cuenta)
|   (interactive "p")
|   (move-to-window-line nil)
|   (scroll-down cuenta)
|   (forward-line (* -1 cuenta))
|   )
| 
| (global-set-key (kbd "C-<") 'guti-scroll-down)
| (global-set-key (kbd "C->") 'guti-scroll-up)
`----

HTH,

-- 
Cristian Gutierrez			http://www.dcc.uchile.cl/~crgutier
crgutier[@]dcc.uchile.cl                        Jabber:crgutier@jabber.org

"If builders built buildings the way programmers write programs, then
the first woodpecker that came along would destroy civilization."
                              -- Weinberg's Second Law.

      parent reply	other threads:[~2005-01-25 19:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-23  3:05 Emacs text cursor position AM
2005-01-23  4:36 ` Eli Zaretskii
2005-01-23 13:33 ` David Hansen
2005-01-23 14:48 ` Thien-Thi Nguyen
2005-01-25 19:04 ` Cristian Gutierrez [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87llahnxda.fsf@guti.no-ip.org \
    --to=crgutier@dcc.uchile.cl \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).