help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to move the cursor to the bottom of the screen?


From: Thierry Volpiatto
Subject: Re: How to move the cursor to the bottom of the screen?
Date: Thu, 10 Jan 2008 10:32:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Alan Mackenzie <acm@muc.de> writes:

> Hi, Ye!
>
> On Wed, Jan 09, 2008 at 02:23:38PM -0500, Ye ilho wrote:
>> > > I am simply trying to go to the top/middle/bottom of the screen I see
>> > > at the moment.
>> > > I also tried your suggestion but that will take me to the
>> > > beginning/end of buffer but not necessarily what I see on the screen
>> > > at the moment.
>
>> >
>> >
>> > Try
>
>> >    M-r
>> >    C-- M-r
>> >    C-1 M-r
>
>
>> Thank you! That was what I was looking for.
>
> That's not quite what you were looking for - You said "in one
> keystroke".  You can get this by having special commands for this.  Here
> are the commands I use:
>
>
> (defun screen-top ()
>   "Move the point to the top of the screen."
>   (interactive)
>   (move-to-window-line 0))
>
> (defun screen-bottom ()
>   "Move the point to the bottom of the screen."
>   (interactive)
>   (move-to-window-line -1))
>           
> (global-set-key [C-left] 'screen-top)
> (global-set-key [C-right] 'screen-bottom)

Thats much better than the original keys M-- M-r and C-n M-r
I change it a little like that we can do C-u n C-right or left

(defun screen-top (&optional n)
  "Move the point to the top of the screen."
  (interactive "p")
  (move-to-window-line (or n 0)))

(defun screen-bottom (&optional n)
  "Move the point to the bottom of the screen."
  (interactive "P")
  (move-to-window-line (- (prefix-numeric-value n))))


>
>
> Copy these lines into your .emacs file (if necessary, create this file
> by doing C-x C-f ~/.emacs).  C-<left> will then go to top of screen,
> C-<right> to bottom of screen.  Modify the last two of these lines if
> you prefer different key sequences.
>
>> -- 
>> YES, JESUS LOVES YOU, TOO.
>> For God so loved the world that he gave his one and only Son, that
>> whoever believes in him shall not perish but have eternal life(John
>> 3:16).
>
> This is very off-topic, but I've never understood the logic connecting
> the second bit of that sentence to the first.  Couldn't God have somehow
> arranged eternal life without being complicit in torturing somebody to
> death first?

-- 
A+ Thierry
Pub key: http://pgp.mit.edu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]