unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Marco Gidde <marco.gidde@tiscali.de>
Subject: Re: scroll-down and beginning-of-buffer
Date: Fri, 07 Jan 2005 23:01:31 +0100	[thread overview]
Message-ID: <lzekgwkif8.fsf@tristan.br-automation.de> (raw)
In-Reply-To: mailman.11719.1105122181.27204.help-gnu-emacs@gnu.org

"Eli Zaretskii" <eliz@gnu.org> writes:

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

Just a side note from the documentation of `beginning-of-buffer':

     Don't use this command in Lisp programs!
     (goto-char (point-min)) is faster and avoids clobbering the mark.


-- 
Marco Gidde

  parent reply	other threads:[~2005-01-07 22:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07 17:05 scroll-down and beginning-of-buffer Paul Raines
2005-01-07 17:58 ` Eli Zaretskii
     [not found] ` <mailman.11719.1105122181.27204.help-gnu-emacs@gnu.org>
2005-01-07 22:01   ` Marco Gidde [this message]
2005-01-09 19:12 ` Paul Raines
     [not found] <mailman.11706.1105118323.27204.help-gnu-emacs@gnu.org>
2005-02-11 14:45 ` John Russell
2005-02-11 19:20   ` August

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=lzekgwkif8.fsf@tristan.br-automation.de \
    --to=marco.gidde@tiscali.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).