all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lee <lee@yagibdah.de>
To: help-gnu-emacs@gnu.org
Subject: Re: prevent scroll-lock-mode from scrolling?
Date: Sat, 18 Jun 2016 00:47:30 +0200	[thread overview]
Message-ID: <87a8ijl9fh.fsf@heimdali.yagibdah.de> (raw)
In-Reply-To: <86eg7w7gjo.fsf@student.uu.se> (Emanuel Berg's message of "Fri, 17 Jun 2016 03:25:15 +0200")

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



  parent reply	other threads:[~2016-06-17 22:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  1:12 prevent scroll-lock-mode from scrolling? lee
2016-06-17  1:25 ` Emanuel Berg
2016-06-17  4:14   ` Stefan Monnier
2016-06-17  6:00     ` Emanuel Berg
2016-06-17 22:40       ` Stefan Monnier
2016-06-18  1:19         ` what to require (was: Re: prevent scroll-lock-mode from scrolling?) Emanuel Berg
2016-06-17 22:47   ` lee [this message]
2016-06-17  6:47 ` prevent scroll-lock-mode from scrolling? Eli Zaretskii
2016-06-17 23:10   ` lee
2016-06-18  8:38     ` Eli Zaretskii
2016-06-19 23:54       ` lee
2016-06-20  8:33         ` tomas
2016-06-20 14:32           ` lee
2016-06-20 10:05         ` Dmitry Alexandrov
2016-06-20 15:24           ` lee
2016-06-20 16:12             ` Dmitry Alexandrov
2016-06-20 19:50               ` lee
2016-06-20 14:34         ` Eli Zaretskii
2016-06-20 21:21           ` lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8ijl9fh.fsf@heimdali.yagibdah.de \
    --to=lee@yagibdah.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.