From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lee Newsgroups: gmane.emacs.help Subject: Re: prevent scroll-lock-mode from scrolling? Date: Sat, 18 Jun 2016 00:47:30 +0200 Organization: my virtual residence Message-ID: <87a8ijl9fh.fsf@heimdali.yagibdah.de> References: <871t3waaa8.fsf@heimdali.yagibdah.de> <86eg7w7gjo.fsf@student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466205128 10281 80.91.229.3 (17 Jun 2016 23:12:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2016 23:12:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 18 01:12:02 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bE2vT-0003Mp-Op for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 01:11:48 +0200 Original-Received: from localhost ([::1]:60622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE2vS-0007eu-L2 for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 19:11:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE2up-0007cS-3a for help-gnu-emacs@gnu.org; Fri, 17 Jun 2016 19:11:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE2uk-0007Ai-PX for help-gnu-emacs@gnu.org; Fri, 17 Jun 2016 19:11:07 -0400 Original-Received: from acheron.yagibdah.de ([185.55.75.245]:57683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE2uk-0007AR-I5 for help-gnu-emacs@gnu.org; Fri, 17 Jun 2016 19:11:02 -0400 Original-Received: from heimdali.yagibdah.de ([192.168.3.20]) by acheron.yagibdah.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.85) (envelope-from ) id 1bE2uh-0001GB-W4 for help-gnu-emacs@gnu.org; Sat, 18 Jun 2016 01:11:00 +0200 Original-Received: from lee by heimdali.yagibdah.de with local (Exim 4.85) (envelope-from ) id 1bE2uh-0003A4-U4 for help-gnu-emacs@gnu.org; Sat, 18 Jun 2016 01:10:59 +0200 In-Reply-To: <86eg7w7gjo.fsf@student.uu.se> (Emanuel Berg's message of "Fri, 17 Jun 2016 03:25:15 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Mail-Followup-To: help-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.55.75.245 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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 Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110484 Archived-At: Emanuel Berg writes: > lee writes: > >> is there a way to prevent the point from >> moving up or down when scroll-lock-mode is >> enabled and the contents of the buffer have >> been scrolled so far as for the first or the >> last line to reach the top or the bottom of >> the frame, respectively? > > I don't know, but try this: > > (require 'cl-macs) > > ;; civilized scrolling - one line at a time > (setq scroll-conservatively 10000) > (setq auto-window-vscroll nil) > > ;; scroll the current window > (defun scroll-up-1 () > (interactive) > (scroll-down 1) ) > (defun scroll-down-1 () > (interactive) > (scroll-up 1) ) > > ;; automatic scrolling > (defun start-automatic-scroll-down () > (interactive) > (let ((win)) > (cl-loop do > (progn (setq win (window-end)) > (scroll-down-1) > (sleep-for 1) ; put speed here in seconds > (redisplay) ) > until (= win (window-end)) ))) > ;; (start-automatic-scroll-down) > ;; ^ test here > > Civilized scrolling: one line at a time! > > http://user.it.uu.se/~embe8573/conf/emacs-init/scroll.el > > I have "scroll-up-1" M-i, ditto down M-k, > and... well, it is all in the file. > Worth checking out! Thanks, I'll try it out! :) -- GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, X toolkit) of 2016-03-18 on heimdali