From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: Buffer Positioning Date: Sat, 11 Jan 2003 08:46:00 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <8klova.r5.ln@acm.acm> References: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1042276836 28482 80.91.224.249 (11 Jan 2003 09:20:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 11 Jan 2003 09:20:36 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18XHod-0007P8-00 for ; Sat, 11 Jan 2003 10:20:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18XHpI-0007Ab-0A for gnu-help-gnu-emacs@m.gmane.org; Sat, 11 Jan 2003 04:21:12 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!wn12feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.bredband.com!bredband!newsfeed1.telenordia.se!algonet!uni-erlangen.de!lmu.de!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 56 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1042276205 98171 193.149.49.134 (11 Jan 2003 09:10:05 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 11 Jan 2003 09:10:05 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:108830 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5359 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5359 CarlC 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").