all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to move the cursor to the bottom of the screen?
@ 2008-01-09 17:58 Ye ilho
  2008-01-09 18:44 ` B. Smith-Mannschott
  2008-01-10  9:05 ` Dmitri Minaev
  0 siblings, 2 replies; 13+ messages in thread
From: Ye ilho @ 2008-01-09 17:58 UTC (permalink / raw)
  To: help-gnu-emacs

Hi everyone,

I am sorry for my ignorance but I was trying to find out how to move
the cursor to the bottom/middle/top of the screen?
In other words, when I edit something, I sometimes want to go to the
top of the screen I see with one key stroke.
Is there any key for that? Or should I create a macro for this?
Please kindly let me know. Thanks in advance.

Ilho <><
-- 
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).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-09 17:58 How to move the cursor to the bottom of the screen? Ye ilho
@ 2008-01-09 18:44 ` B. Smith-Mannschott
  2008-01-09 19:07   ` Ye ilho
  2008-01-10  9:05 ` Dmitri Minaev
  1 sibling, 1 reply; 13+ messages in thread
From: B. Smith-Mannschott @ 2008-01-09 18:44 UTC (permalink / raw)
  To: Ye ilho; +Cc: help-gnu-emacs


On Jan 9, 2008, at 18:58, Ye ilho wrote:

> Hi everyone,
>
> I am sorry for my ignorance but I was trying to find out how to move
> the cursor to the bottom/middle/top of the screen?
> In other words, when I edit something, I sometimes want to go to the
> top of the screen I see with one key stroke.
> Is there any key for that? Or should I create a macro for this?
> Please kindly let me know. Thanks in advance.
>

C-h b

Will show you a list of key bindings.  In particular:

M-<             beginning-of-buffer
M->             end-of-buffer

M-< can be typed as:

[ESCape key] [< key]

On the mac you may be able to hold down command or option while typing  
< to get the same effect. Under windows the ALT key will do this.

/ ben

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
       [not found] <mailman.5929.1199901491.18990.help-gnu-emacs@gnu.org>
@ 2008-01-09 19:01 ` Exal de Jesus Garcia Carrillo
  2008-01-10 16:06 ` Stefan Kamphausen
  1 sibling, 0 replies; 13+ messages in thread
From: Exal de Jesus Garcia Carrillo @ 2008-01-09 19:01 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ye ilho em gnu.emacs.help escreveu :

>
> I am sorry for my ignorance but I was trying to find out how to move
> the cursor to the bottom/middle/top of the screen?

(scroll-up) and (scroll-down) 


- -- 
Spam protection: 
In my e-mail replace the words `no-spam' with `exal'.

.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFHhRoBoZmxoVJRtGIRAvNtAJ49OIHRa5FqDqyYPhqEaIIT/puP7gCghAQm
SLjrkKyFvAqn9oq4qvIK+tE=
=UY21
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-09 18:44 ` B. Smith-Mannschott
@ 2008-01-09 19:07   ` Ye ilho
  2008-01-09 19:15     ` Lennart Borgman (gmail)
  2008-01-10  4:34     ` Sanjeev Kumar.S
  0 siblings, 2 replies; 13+ messages in thread
From: Ye ilho @ 2008-01-09 19:07 UTC (permalink / raw)
  To: B. Smith-Mannschott; +Cc: help-gnu-emacs

> Will show you a list of key bindings.  In particular:
>
> M-<             beginning-of-buffer
> M->             end-of-buffer
>
> M-< can be typed as:
>
> [ESCape key] [< key]
>
> On the mac you may be able to hold down command or option while typing
> < to get the same effect. Under windows the ALT key will do this.
>
> / ben
>

Thank you, Ben. Perhaps I did not state my question correctly or I did
not understand your answer because I am a novice in emacs. Please bear
with me once again to state what I want to do.

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.

For example, if I see the content of file in my emacs screen as
follows, I want to somehow to go to abc with one key stroke.

======================
 abc
 def
 ghi
 jkl
 mno
======================

If I did not understand your answer correctly, please correct me.
Thank you once again.

Ilho <><

-- 
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).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-09 19:07   ` Ye ilho
@ 2008-01-09 19:15     ` Lennart Borgman (gmail)
  2008-01-09 19:23       ` Ye ilho
       [not found]       ` <mailman.5934.1199906623.18990.help-gnu-emacs@gnu.org>
  2008-01-10  4:34     ` Sanjeev Kumar.S
  1 sibling, 2 replies; 13+ messages in thread
From: Lennart Borgman (gmail) @ 2008-01-09 19:15 UTC (permalink / raw)
  To: Ye ilho; +Cc: help-gnu-emacs

Ye ilho wrote:
>> Will show you a list of key bindings.  In particular:
>>
>> M-<             beginning-of-buffer
>> M->             end-of-buffer
>>
>> M-< can be typed as:
>>
>> [ESCape key] [< key]
>>
>> On the mac you may be able to hold down command or option while typing
>> < to get the same effect. Under windows the ALT key will do this.
>>
>> / ben
>>
> 
> Thank you, Ben. Perhaps I did not state my question correctly or I did
> not understand your answer because I am a novice in emacs. Please bear
> with me once again to state what I want to do.
> 
> 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.
> 
> For example, if I see the content of file in my emacs screen as
> follows, I want to somehow to go to abc with one key stroke.
> 
> ======================
>  abc
>  def
>  ghi
>  jkl
>  mno
> ======================


Try

   M-r
   C-- M-r
   C-1 M-r

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-09 19:15     ` Lennart Borgman (gmail)
@ 2008-01-09 19:23       ` Ye ilho
  2008-01-10  8:15         ` Alan Mackenzie
       [not found]         ` <mailman.5947.1199954002.18990.help-gnu-emacs@gnu.org>
       [not found]       ` <mailman.5934.1199906623.18990.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 13+ messages in thread
From: Ye ilho @ 2008-01-09 19:23 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: help-gnu-emacs

> > 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.


-- 
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).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
       [not found]       ` <mailman.5934.1199906623.18990.help-gnu-emacs@gnu.org>
@ 2008-01-09 22:48         ` Barry Margolin
  0 siblings, 0 replies; 13+ messages in thread
From: Barry Margolin @ 2008-01-09 22:48 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.5934.1199906623.18990.help-gnu-emacs@gnu.org>,
 "Ye ilho" <iy2110@columbia.edu> 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.

I recommend M-- M-r, so you don't have to switch from the Control to the 
Meta key.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-09 19:07   ` Ye ilho
  2008-01-09 19:15     ` Lennart Borgman (gmail)
@ 2008-01-10  4:34     ` Sanjeev Kumar.S
  1 sibling, 0 replies; 13+ messages in thread
From: Sanjeev Kumar.S @ 2008-01-10  4:34 UTC (permalink / raw)
  To: Ye ilho, B. Smith-Mannschott; +Cc: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 1724 bytes --]

This is how i do it:


(define-key global-map [(control prior)] (lambda (&optional arg) (interactive) (move-to-window-line 0)))
you can extend it how-ever you want from here.

Sanjeev.



Ye ilho <iy2110@columbia.edu> wrote: > Will show you a list of key bindings.  In particular:
>
> M-<             beginning-of-buffer
> M->             end-of-buffer
>
> M-< can be typed as:
>
> [ESCape key] [< key]
>
> On the mac you may be able to hold down command or option while typing
> < to get the same effect. Under windows the ALT key will do this.
>
> / ben
>

Thank you, Ben. Perhaps I did not state my question correctly or I did
not understand your answer because I am a novice in emacs. Please bear
with me once again to state what I want to do.

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.

For example, if I see the content of file in my emacs screen as
follows, I want to somehow to go to abc with one key stroke.

======================
 abc
 def
 ghi
 jkl
 mno
======================

If I did not understand your answer correctly, please correct me.
Thank you once again.

Ilho <><

-- 
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).


_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs


       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[-- Attachment #1.2: Type: text/html, Size: 2297 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-09 19:23       ` Ye ilho
@ 2008-01-10  8:15         ` Alan Mackenzie
  2008-01-10  9:32           ` Thierry Volpiatto
       [not found]         ` <mailman.5947.1199954002.18990.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 13+ messages in thread
From: Alan Mackenzie @ 2008-01-10  8:15 UTC (permalink / raw)
  To: Ye ilho; +Cc: help-gnu-emacs

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)


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?

-- 
Alan Mackenzie (Nuremberg, Germany).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-09 17:58 How to move the cursor to the bottom of the screen? Ye ilho
  2008-01-09 18:44 ` B. Smith-Mannschott
@ 2008-01-10  9:05 ` Dmitri Minaev
  1 sibling, 0 replies; 13+ messages in thread
From: Dmitri Minaev @ 2008-01-10  9:05 UTC (permalink / raw)
  To: Ye ilho; +Cc: help-gnu-emacs

On Jan 9, 2008 9:58 PM, Ye ilho <iy2110@columbia.edu> wrote:
> Hi everyone,
>
> I am sorry for my ignorance but I was trying to find out how to move
> the cursor to the bottom/middle/top of the screen?
> In other words, when I edit something, I sometimes want to go to the
> top of the screen I see with one key stroke.
> Is there any key for that? Or should I create a macro for this?

A slightly different way is:

(defalias 'goto-page-top
  (read-kbd-macro "C-u 1 M-r"))
(defalias 'goto-page-bot
  (read-kbd-macro "C-u -1 M-r"))
(global-set-key [(control {)] 'goto-page-top)
(global-set-key [(control })] 'goto-page-bot)


-- 
With best regards,
Dmitri Minaev

Russian history blog: http://minaev.blogspot.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
  2008-01-10  8:15         ` Alan Mackenzie
@ 2008-01-10  9:32           ` Thierry Volpiatto
  0 siblings, 0 replies; 13+ messages in thread
From: Thierry Volpiatto @ 2008-01-10  9:32 UTC (permalink / raw)
  To: Alan Mackenzie; +Cc: help-gnu-emacs, Ye ilho

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How to move the cursor to the bottom of the screen?
       [not found] <mailman.5929.1199901491.18990.help-gnu-emacs@gnu.org>
  2008-01-09 19:01 ` Exal de Jesus Garcia Carrillo
@ 2008-01-10 16:06 ` Stefan Kamphausen
  1 sibling, 0 replies; 13+ messages in thread
From: Stefan Kamphausen @ 2008-01-10 16:06 UTC (permalink / raw)
  To: help-gnu-emacs

"Ye ilho" <iy2110@columbia.edu> writes:

> Hi everyone,
>
> I am sorry for my ignorance but I was trying to find out how to move
> the cursor to the bottom/middle/top of the screen?
> In other words, when I edit something, I sometimes want to go to the
> top of the screen I see with one key stroke.

There are two functions I've been using for years which allow me to
use the home and end keys as follows:

press once   goto beginning/end of line
press twice  goto beginning/end of window
press thrice goto beginning/end of buffer

Those functions are:

(defun chb-home ()
  (interactive)
  (if (not (bolp))
      (beginning-of-line)
    (if (eq this-command last-command)
        (cond
         ((not (= (point) (window-start)))
          (move-to-window-line 0)
          (beginning-of-line))
         (t
          (goto-char (point-min)))))))

(defun chb-end ()
  (interactive)
  (if (not (eolp))
      (end-of-line)
    (if (eq this-command last-command)
        (cond
         ((not (= (point) (save-excursion
                            (move-to-window-line -1)
                            (end-of-line)
                            (point))))
          (move-to-window-line -1)
          (end-of-line))
         (t
          (goto-char (point-max)))))))

I bind them like this:
(global-set-key '[(home)] 'chb-home)
(global-set-key '[(end)]  'chb-end)

Very convenient.

Regards,
Stefan
-- 
Stefan Kamphausen --- http://www.skamphausen.de
a blessed +42 regexp of confusion (weapon in hand)
You hit. The format string crumbles and turns to dust.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* OT: Torturing Ancient Judeans (was: How to move the cursor to the bottom of the screen?)
       [not found]         ` <mailman.5947.1199954002.18990.help-gnu-emacs@gnu.org>
@ 2008-01-10 20:24           ` Joel J. Adamson
  0 siblings, 0 replies; 13+ messages in thread
From: Joel J. Adamson @ 2008-01-10 20:24 UTC (permalink / raw)
  To: help-gnu-emacs

Alan Mackenzie <acm@muc.de> writes:

>> -- 
>> 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,

No, just off-topic.

> but I've never understood the logic connecting the second bit of that
> sentence to the first.

It's probably lost in translation.  It's all Greek to me, which is a
pity because I've never learned Greek.

> Couldn't God have somehow arranged eternal life without being
> complicit in torturing somebody to death first?

You might be thinking of the Romans ;)

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-01-10 20:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-09 17:58 How to move the cursor to the bottom of the screen? Ye ilho
2008-01-09 18:44 ` B. Smith-Mannschott
2008-01-09 19:07   ` Ye ilho
2008-01-09 19:15     ` Lennart Borgman (gmail)
2008-01-09 19:23       ` Ye ilho
2008-01-10  8:15         ` Alan Mackenzie
2008-01-10  9:32           ` Thierry Volpiatto
     [not found]         ` <mailman.5947.1199954002.18990.help-gnu-emacs@gnu.org>
2008-01-10 20:24           ` OT: Torturing Ancient Judeans (was: How to move the cursor to the bottom of the screen?) Joel J. Adamson
     [not found]       ` <mailman.5934.1199906623.18990.help-gnu-emacs@gnu.org>
2008-01-09 22:48         ` How to move the cursor to the bottom of the screen? Barry Margolin
2008-01-10  4:34     ` Sanjeev Kumar.S
2008-01-10  9:05 ` Dmitri Minaev
     [not found] <mailman.5929.1199901491.18990.help-gnu-emacs@gnu.org>
2008-01-09 19:01 ` Exal de Jesus Garcia Carrillo
2008-01-10 16:06 ` Stefan Kamphausen

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.