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

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

Re: scroll-down and beginning-of-buffer


From: Eli Zaretskii
Subject: Re: scroll-down and beginning-of-buffer
Date: Fri, 07 Jan 2005 19:58:56 +0200

> Date: Fri, 7 Jan 2005 12:05:31 -0500 (EST)
> From: Paul Raines <raines@nmr.mgh.harvard.edu>
> 
> (defun my-scroll-down (arg)
>    "Same as scroll-down except really goes to beginning of file"
>    (interactive "P")
>    (if (not (call-interactively 'scroll-down))
>        (call-interactively 'beginning-of-buffer)))
> 
> Which works but has the horrible side effect of reseting the mark
> each time it is used to the region scrolled.  How do I stop it
> from doing that?

If you call pop-mark after beginning-of-buffer, it will restore the
mark to what it was before that.

Alternatively, replace the call to beginning-of-buffer with a loop
that moves one line backwards until it hits the first line.

> Or is the better way to get what I want?

A better way would be to get used to what Emacs does when you press
PageDown repeatedly ;-)

Anyway, why did you invoke scroll-down and beginning-of-buffer via
call-interactively?  Why not simply call (scroll-down) and
(beginning-of-buffer)?



reply via email to

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