From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marco Gidde Newsgroups: gmane.emacs.help Subject: Re: scroll-down and beginning-of-buffer Date: Fri, 07 Jan 2005 23:01:31 +0100 Organization: Linux Private Site Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1105135417 21281 80.91.229.6 (7 Jan 2005 22:03:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Jan 2005 22:03:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 07 23:03:30 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cn2Cf-00009C-00 for ; Fri, 07 Jan 2005 23:03:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cn2O2-0004uR-Mp for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Jan 2005 17:15:14 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!feed.news.tiscali.de!news.tiscali.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: p83.129.48.16.tisdip.tiscali.de Original-X-Trace: ulysses.news.tiscali.de 1105135267 37237 83.129.48.16 (7 Jan 2005 22:01:07 GMT) Original-X-Complaints-To: abuse@tiscali.de Original-NNTP-Posting-Date: Fri, 7 Jan 2005 22:01:07 +0000 (UTC) User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:EQvCUZnKfz59x0fz47JLIKrOB7Y= Original-Xref: shelby.stanford.edu gnu.emacs.help:127730 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23201 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23201 "Eli Zaretskii" writes: >> Date: Fri, 7 Jan 2005 12:05:31 -0500 (EST) >> From: Paul Raines >> >> (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