help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prevent scroll-lock-mode from scrolling?


From: lee
Subject: Re: prevent scroll-lock-mode from scrolling?
Date: Sat, 18 Jun 2016 00:47:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Emanuel Berg <embe8573@student.uu.se> writes:

> 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!

Thanks, I'll try it out! :)

-- 
GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, X toolkit)
 of 2016-03-18 on heimdali



reply via email to

[Prev in Thread] Current Thread [Next in Thread]