unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Buffer Positioning
@ 2003-01-10 15:26 CarlC
  2003-01-11  2:45 ` Jesper Harder
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: CarlC @ 2003-01-10 15:26 UTC (permalink / raw)


Hi, All.

I have a couple of minor issues that I am having trouble finding help on.

1) How can I get PgUp and PgDn to finally stop at the first/last line of the
buffer? They work just fine while in the middle of the buffer. I would just
like to have them do one more position if already displaying the
beginning/end.

2) How can I get arrow up/down to scroll the buffer by one line? If my
cursor is on the last line of the window, I want a down arrow to remain at
the bottom of the window (on the next line of the buffer).

Any comments on these functions would be welcome. Thanks.

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

* Re: Buffer Positioning
  2003-01-10 15:26 Buffer Positioning CarlC
@ 2003-01-11  2:45 ` Jesper Harder
  2003-01-11 10:32   ` Klaus Berndl
  2003-01-13 16:08   ` CarlC
  2003-01-11  8:46 ` Alan Mackenzie
  2003-01-11 23:49 ` Eric Eide
  2 siblings, 2 replies; 8+ messages in thread
From: Jesper Harder @ 2003-01-11  2:45 UTC (permalink / raw)


"CarlC" <carlc@snowbd.com> writes:

> I have a couple of minor issues that I am having trouble finding help
> on.

See the section "Scrolling" in the manual for more details about
changing scrolling behaviour.

> 1) How can I get PgUp and PgDn to finally stop at the first/last line
> of the buffer? They work just fine while in the middle of the
> buffer. I would just like to have them do one more position if already
> displaying the beginning/end.

I don't know, but you can use `C-home' or `M-<' to go to the beginning
of the buffer, and `C-end' or `M->' to go to the end.

> 2) How can I get arrow up/down to scroll the buffer by one line? If my
> cursor is on the last line of the window, I want a down arrow to
> remain at the bottom of the window (on the next line of the buffer).

  (setq scroll-conservatively 1)

should do that.

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

* Re: Buffer Positioning
  2003-01-10 15:26 Buffer Positioning CarlC
  2003-01-11  2:45 ` Jesper Harder
@ 2003-01-11  8:46 ` Alan Mackenzie
  2003-01-11 21:14   ` Kai Großjohann
  2003-01-11 23:49 ` Eric Eide
  2 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2003-01-11  8:46 UTC (permalink / raw)


CarlC <carlc@snowbd.com> wrote on Fri, 10 Jan 2003 15:26:27 GMT:
> Hi, All.

[ .... ]

> 2) How can I get arrow up/down to scroll the buffer by one line? If my
> cursor is on the last line of the window, I want a down arrow to remain
> at the bottom of the window (on the next line of the buffer).

Firstly, are you SURE you want arrow up/down to scroll the buffer?  If
so, you won't be able to use these keys for moving the cursor, and will
need C-n and C-p for these purposes.

My solution is to have these function definitions in my .emacs:

*************************************************************************
(defun scrollup-n (&optional n)
  "Scroll the text up n (default 1) lines."
  (interactive "p")
  (scroll-up (or n 1))
)
(global-set-key [S-down] 'scrollup-n)

(defun scrolldown-n (&optional n)
  "Scroll the text down n (default 1) lines."
  (interactive "p")
  (scroll-down (or n 1))
)
(global-set-key [S-up] 'scrolldown-n)

(defun scrollup-6n (&optional n)
  "Scroll the text up 6n (default 6) lines."
  (interactive "p")
  (scroll-up (* 6 (or n 1)))
)
(global-set-key [C-S-down] 'scrollup-6n)

(defun scrolldown-6n (&optional n)
  "Scroll the text down 6n (default 6) lines."
  (interactive "p")
  (scroll-down (* 6 (or n 1)))
)
(global-set-key [C-S-up] 'scrolldown-6n)
*************************************************************************

As can be seen, I use SHIFT-up/down for scrolling by a single line, and
Control-shift-up/down for scrolling six lines at a time.  You can modify
the global-set-key calls easily enough to take the SHIFT away.

> Any comments on these functions would be welcome. Thanks.

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: Buffer Positioning
  2003-01-11  2:45 ` Jesper Harder
@ 2003-01-11 10:32   ` Klaus Berndl
  2003-01-13 16:08   ` CarlC
  1 sibling, 0 replies; 8+ messages in thread
From: Klaus Berndl @ 2003-01-11 10:32 UTC (permalink / raw)


On Sat, 11 Jan 2003, Jesper Harder wrote:



>  "CarlC" <carlc@snowbd.com> writes:
>  
> > I have a couple of minor issues that I am having trouble finding help
> > on.
>  
>  See the section "Scrolling" in the manual for more details about
>  changing scrolling behaviour.
>  
> > 1) How can I get PgUp and PgDn to finally stop at the first/last line
> > of the buffer? They work just fine while in the middle of the
> > buffer. I would just like to have them do one more position if already
> > displaying the beginning/end.
>  
>  I don't know, but you can use `C-home' or `M-<' to go to the beginning
>  of the buffer, and `C-end' or `M->' to go to the end.
>  
> > 2) How can I get arrow up/down to scroll the buffer by one line? If my
> > cursor is on the last line of the window, I want a down arrow to
> > remain at the bottom of the window (on the next line of the buffer).
>  
>    (setq scroll-conservatively 1)

IMHO this has to be (setq scroll-conservatively 1000). IMHO setting the
scroll-settings right for a users wishes in one of the most difficult tasks -
docu is somehow unclear.....

In one posting i get the hint setting scroll-conservatively to a large value
to get scroll-steps of exactly one line - i tried it and it works!

With a value of 1 there are sometimes (can not say exactly under which
circumstances) jumps where point is centered if you press down-arrow for
example continuously to scroll smoothly downwards.

OK, set it to a value about 1000 and scrolling is really smoothly be one
line!!

Klaus

>  
>  should do that.

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

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

* Re: Buffer Positioning
  2003-01-11  8:46 ` Alan Mackenzie
@ 2003-01-11 21:14   ` Kai Großjohann
  2003-01-13 16:10     ` CarlC
  0 siblings, 1 reply; 8+ messages in thread
From: Kai Großjohann @ 2003-01-11 21:14 UTC (permalink / raw)


Alan Mackenzie<none@example.invalid> writes:

> Firstly, are you SURE you want arrow up/down to scroll the buffer?  If
> so, you won't be able to use these keys for moving the cursor, and will
> need C-n and C-p for these purposes.

Try Eric Eide's scroll-in-place.  It's way cool.  (I don't use it,
but it's cool nonetheless.)  I have a friend who has mapped it to
<up> and <down> and it seems to work great.
-- 
Ambibibentists unite!

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

* Re: Buffer Positioning
  2003-01-10 15:26 Buffer Positioning CarlC
  2003-01-11  2:45 ` Jesper Harder
  2003-01-11  8:46 ` Alan Mackenzie
@ 2003-01-11 23:49 ` Eric Eide
  2 siblings, 0 replies; 8+ messages in thread
From: Eric Eide @ 2003-01-11 23:49 UTC (permalink / raw)


"carlc" == carlc  <carlc@snowbd.com> writes:

	carlc> 1) How can I get PgUp and PgDn to finally stop at the first/last
	carlc>    line of the buffer?  [...]

Try <http://www.cs.utah.edu/~eeide/emacs/scroll-in-place.el.gz>.

	carlc> 2) How can I get arrow up/down to scroll the buffer by one line?

See the comments in the `scroll-in-place' package for examples of this.

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide@cs.utah.edu>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX

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

* Re: Buffer Positioning
  2003-01-11  2:45 ` Jesper Harder
  2003-01-11 10:32   ` Klaus Berndl
@ 2003-01-13 16:08   ` CarlC
  1 sibling, 0 replies; 8+ messages in thread
From: CarlC @ 2003-01-13 16:08 UTC (permalink / raw)



>   (setq scroll-conservatively 1)

Thanks. That is what I wanted.

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

* Re: Buffer Positioning
  2003-01-11 21:14   ` Kai Großjohann
@ 2003-01-13 16:10     ` CarlC
  0 siblings, 0 replies; 8+ messages in thread
From: CarlC @ 2003-01-13 16:10 UTC (permalink / raw)



> Try Eric Eide's scroll-in-place.  It's way cool.  (I don't use it,
> but it's cool nonetheless.)  I have a friend who has mapped it to
> <up> and <down> and it seems to work great.

Thanks. This lets me scroll to the ends of the buffer.

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

end of thread, other threads:[~2003-01-13 16:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-10 15:26 Buffer Positioning CarlC
2003-01-11  2:45 ` Jesper Harder
2003-01-11 10:32   ` Klaus Berndl
2003-01-13 16:08   ` CarlC
2003-01-11  8:46 ` Alan Mackenzie
2003-01-11 21:14   ` Kai Großjohann
2003-01-13 16:10     ` CarlC
2003-01-11 23:49 ` Eric Eide

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