[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: prevent scroll-lock-mode from scrolling?
From: |
Emanuel Berg |
Subject: |
Re: prevent scroll-lock-mode from scrolling? |
Date: |
Fri, 17 Jun 2016 03:25:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
lee <lee@yagibdah.de> 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 -
Re: prevent scroll-lock-mode from scrolling?, Eli Zaretskii, 2016/06/17