From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: upro Newsgroups: gmane.emacs.help Subject: Re: scrolling Date: Fri, 08 Aug 2003 09:34:16 +0200 Organization: Slackers Home Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87isp8iow7.fsf@lux99.home> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1060328742 22627 80.91.224.253 (8 Aug 2003 07:45:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 8 Aug 2003 07:45:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 08 09:46:07 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19l1ws-00010N-00 for ; Fri, 08 Aug 2003 09:46:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19l1wY-0001Fk-Dt for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Aug 2003 03:45:46 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!skynet.be!skynet.be!130.133.1.3.MISMATCH!fu-berlin.de!uni-berlin.de!cross12.lu-visp.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 78 Original-NNTP-Posting-Host: cross12.lu-visp.net (194.235.194.140) Original-X-Trace: news.uni-berlin.de 1060327966 30492348 194.235.194.140 (16 [172438]) Os: Slackware 9.0.0/2.4.21 User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:vBMA8WrR4/fQLOXws5rt39wM8i0= Original-Xref: shelby.stanford.edu gnu.emacs.help:115746 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11665 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11665 schaecsn writes: > Hi, > > 1) Let's assume the cursor is somewhere in the middle of the > screen. How can I scroll the screen by 1 line up or down? > > 2) If I'm at the bottom of the screen and I press cursor-down then the > screen scrolls by several lines. Google told me to set scroll-step to > 1. > > (setq scroll-step 1) > > That works several times but then the cursor is suddenly in the middle > of the screen. I don't like that. > > > Thanks for any help :) Hi! I had the ame problem and didn't like the scroll behavior. I found scroll-in-place.el, which I bound to shift-cursor keys. When I use it the cursor stays in place and the bzuffer content moves. You should be able to find the code here: http://www.on.ics.keio.ac.jp/~yasu/linux/scroll-in-place.el or somewhere else on google. If not I can mail it to you or post it on gnu.emacs.sources I added the following lines to my .emacs: ;; Scrolls one line at the time (setq scroll-step 1) ;; Better scrolling... (require 'scroll-in-place) ;; By default, this package provides for the standard GNU Emacs vertical ;; scrolling commands (`scroll-down', `scroll-up', `scroll-other-window- ;; down', and `scroll-other-window') to use the "in place" features. If you ;; would rather not have this, set the variable `scroll-in-place' to `nil': (setq scroll-in-place nil) ;; When `scroll-in-place' is `nil' you will have to bind keys in order to ;; call the "in place" scrolling commands. For example, you might want to do ;; the following: (setq scroll-command-groups (list '(scroll-down-one-line scroll-up-one-line))) ;;; You could write the `scroll-down-one-line' command like this: (defun scroll-down-one-line (arg) "Scroll down one line, or number of lines specified by prefix arg." (interactive "P") (let ((scroll-default-lines 1)) (scroll-down-in-place arg))) (defun scroll-up-one-line (arg) "Scroll down one line, or number of lines specified by prefix arg." (interactive "P") (let ((scroll-default-lines 1)) (scroll-up-in-place arg))) ;; key bindings (global-set-key [(shift up)] 'scroll-down-one-line) (global-set-key [(shift down)] 'scroll-up-one-line) HTH, best -- Michael r-znvy: zvpunry.wryqra jro.qr (chg gur "@" jurer vg svgf...) ab fcnz cyrnfr