From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: prevent scroll-lock-mode from scrolling? Date: Fri, 17 Jun 2016 03:25:15 +0200 Message-ID: <86eg7w7gjo.fsf@student.uu.se> References: <871t3waaa8.fsf@heimdali.yagibdah.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466127049 24763 80.91.229.3 (17 Jun 2016 01:30:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2016 01:30:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 17 03:30:40 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 1bDicJ-00064v-QD for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 03:30:39 +0200 Original-Received: from localhost ([::1]:53141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDicJ-0001Ih-5C for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Jun 2016 21:30:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDibs-0001IQ-TH for help-gnu-emacs@gnu.org; Thu, 16 Jun 2016 21:30:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDibm-0002Ic-K6 for help-gnu-emacs@gnu.org; Thu, 16 Jun 2016 21:30:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDibm-0002HL-DB for help-gnu-emacs@gnu.org; Thu, 16 Jun 2016 21:30:06 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bDibl-0005eN-7W for help-gnu-emacs@gnu.org; Fri, 17 Jun 2016 03:30:05 +0200 Original-Received: from c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se ([85.230.225.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jun 2016 03:30:05 +0200 Original-Received: from embe8573 by c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Jun 2016 03:30:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 50 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:mZJwHrQ2oic0/degXZiwN0WbVmM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:110472 Archived-At: 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! -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 48 Blogomatic articles -