all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Eli Zaretskii" <eliz@gnu.org>
Subject: Re: scroll-down and beginning-of-buffer
Date: Fri, 07 Jan 2005 19:58:56 +0200	[thread overview]
Message-ID: <01c4f4e2$Blat.v2.2.2$b768c720@zahav.net.il> (raw)
In-Reply-To: <Pine.LNX.4.60.0501071201400.22571@gate.nmr.mgh.harvard.edu> (message from Paul Raines on Fri, 7 Jan 2005 12:05:31 -0500 (EST))

> 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	other threads:[~2005-01-07 17:58 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 [this message]
     [not found] ` <mailman.11719.1105122181.27204.help-gnu-emacs@gnu.org>
2005-01-07 22:01   ` Marco Gidde
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

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

  git send-email \
    --in-reply-to='01c4f4e2$Blat.v2.2.2$b768c720@zahav.net.il' \
    --to=eliz@gnu.org \
    /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.
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.