unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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.5934.1199906623.18990.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 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
  0 siblings, 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 ` How to move the cursor to the bottom of the screen? Exal de Jesus Garcia Carrillo
@ 2008-01-10 16:06 ` Stefan Kamphausen
  2008-01-12 19:32   ` emacs crash again and again......I'm requesting help here as last resort Sanjeev Kumar.S
  1 sibling, 1 reply; 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

* emacs crash again and again......I'm requesting help here as last resort.
  2008-01-10 16:06 ` Stefan Kamphausen
@ 2008-01-12 19:32   ` Sanjeev Kumar.S
  0 siblings, 0 replies; 13+ messages in thread
From: Sanjeev Kumar.S @ 2008-01-12 19:32 UTC (permalink / raw)
  To: Stefan Kamphausen, help-gnu-emacs


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

tried filing a bug through the emacs submit , but that was the last I ever heard of it. Here is the output:

I get crashes on the same line again and again:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1220520272 (LWP 8874)]
0xb7a3e92d in XRenderFindDisplay () from /usr/lib/libXrender.so.1
(gdb) bt
#0  0xb7a3e92d in XRenderFindDisplay () from /usr/lib/libXrender.so.1
#1  0xb7a3ca55 in XRenderFreePicture () from /usr/lib/libXrender.so.1
#2  0xb7664b80 in XftDrawDestroy () from /usr/lib/libXft.so.2
#3  0x080c0bd0 in clear_face_cache (clear_fonts_p=0) at xfaces.c:5444
#4  0x0808799f in redisplay_internal (preserve_echo_area=<value optimized out>) at xdisp.c:11144
#5  0x08087e6c in redisplay_preserve_echo_area (from_where=2) at xdisp.c:11194
#6  0x080557c0 in sit_for (sec=0, usec=500000, reading=0, display=1, initial_display=1) at dispnew.c:6407
#7  0x080558c5 in Fsit_for (seconds=137500870, milliseconds=137509881, nodisp=<value optimized out>) at dispnew.c:6470
#8  0x08158646 in Ffuncall (nargs=2, args=0xbff88860) at eval.c:2885
#9  0x08183aa7 in Fbyte_code (bytestr=136845459, vector=136845764, maxdepth=6) at bytecode.c:694
#10 0x08157b69 in Feval (form=136845445) at eval.c:2225
#11 0x0815a11f in internal_lisp_condition_case (var=137509881, bodyform=136845445, handlers=136846141) at eval.c:1412
#12 0x08182d58 in Fbyte_code (bytestr=136845339, vector=136845388, maxdepth=4) at bytecode.c:884
#13 0x08158138 in funcall_lambda (fun=136845308, nargs=0, arg_vector=0xbff88c48) at eval.c:3066
#14 0x0815856e in Ffuncall (nargs=1, args=0xbff88c44) at eval.c:2934
#15 0x08159d5c in Fapply (nargs=2, args=0xbff88c44) at eval.c:2315
#16 0x081587b0 in Ffuncall (nargs=3, args=0xbff88c40) at eval.c:2860
#17 0x08183aa7 in Fbyte_code (bytestr=136891059, vector=136891100, maxdepth=4) at bytecode.c:694
#18 0x08157b69 in Feval (form=136891045) at eval.c:2225
#19 0x0815a11f in internal_lisp_condition_case (var=137509881, bodyform=136891045, handlers=136891133) at eval.c:1412
#20 0x08182d58 in Fbyte_code (bytestr=136890779, vector=136890932, maxdepth=5) at bytecode.c:884
#21 0x08158138 in funcall_lambda (fun=136890740, nargs=1, arg_vector=0xbff88f74) at eval.c:3066
#22 0x0815856e in Ffuncall (nargs=2, args=0xbff88f70) at eval.c:2934
#23 0x08159909 in call1 (fn=137544473, arg1=143319756) at eval.c:2668
#24 0x080f9396 in timer_check (do_it_now=1) at keyboard.c:4473
#25 0x080f95a9 in readable_events (flags=1) at keyboard.c:3512
#26 0x080f9617 in get_input_pending (addr=0x8311194, flags=1) at keyboard.c:6593
#27 0x080f96f0 in detect_input_pending_run_timers (do_display=1) at keyboard.c:9945
#28 0x0818a349 in wait_reading_process_output (time_limit=30, microsecs=0, read_kbd=-1, do_display=1,
    wait_for_cell=137509881, wait_proc=0x0, just_wait_proc=0) at process.c:4593
#29 0x08055808 in sit_for (sec=30, usec=0, reading=1, display=1, initial_display=0) at dispnew.c:6416
#30 0x080fd0de in read_char (commandflag=1, nmaps=5, maps=0xbff89620, prev_event=137509881, used_mouse_menu=0xbff896d4)
    at keyboard.c:2770
#31 0x080fefed in read_key_sequence (keybuf=0xbff89784, bufsize=30, prompt=137509881, dont_downcase_last=0,
    can_return_switch_frame=1, fix_current_buffer=1) at keyboard.c:8855
#32 0x08100b17 in command_loop_1 () at keyboard.c:1529
---Type <return> to continue, or q <return> to quit---
#33 0x0815711b in internal_condition_case (bfun=0x8100990 <command_loop_1>, handlers=137553665, hfun=0x80fb720 <cmd_error>)
    at eval.c:1465
#34 0x080fa9c3 in command_loop_2 () at keyboard.c:1321
#35 0x081571da in internal_catch (tag=137549921, func=0x80fa9a0 <command_loop_2>, arg=137509881) at eval.c:1211
#36 0x080fb3dc in command_loop () at keyboard.c:1300
#37 0x080fb48a in recursive_edit_1 () at keyboard.c:993
#38 0x080fb587 in Frecursive_edit () at keyboard.c:1054
#39 0x080f1955 in main (argc=6, argv=0xbff89e84) at emacs.c:1789
(gdb) l *0x080c0bd0
0x80c0bd0 is in clear_face_cache (xfaces.c:5445).
5440    #ifdef HAVE_XFT
5441              if (face && face->xft_draw)
5442                {
5443                  BLOCK_INPUT;
5444                  XftDrawDestroy (face->xft_draw);
5445                  UNBLOCK_INPUT;
5446                  face->xft_draw = 0;
5447                }
5448    #endif
5449              if (face && face->gc)
(gdb)


Stefan Kamphausen <skampi@gmx.net> wrote: "Ye ilho"  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.
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs


       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

[-- Attachment #1.2: Type: text/html, Size: 7634 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

end of thread, other threads:[~2008-01-12 19:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5929.1199901491.18990.help-gnu-emacs@gnu.org>
2008-01-09 19:01 ` How to move the cursor to the bottom of the screen? Exal de Jesus Garcia Carrillo
2008-01-10 16:06 ` Stefan Kamphausen
2008-01-12 19:32   ` emacs crash again and again......I'm requesting help here as last resort Sanjeev Kumar.S
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.5934.1199906623.18990.help-gnu-emacs@gnu.org>
2008-01-09 22:48         ` Barry Margolin
2008-01-10  4:34     ` Sanjeev Kumar.S
2008-01-10  9:05 ` Dmitri Minaev

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