unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: B. T. Raven <btraven@nihil.net>
To: help-gnu-emacs@gnu.org
Subject: Re: continuous fractional scrolling
Date: 12 Jun 2015 09:11:45 -0700	[thread overview]
Message-ID: <mlf0c102om3@drn.newsguy.com> (raw)
In-Reply-To: 877fr9ygun.fsf@debian.uxu

<877fr9ygun.fsf@debian.uxu>Emanuel BergFri, 12 Jun 2015 01:18:08 +0200
>
>B. T. Raven <btraven@nihil.net> writes:
>
>> Is there a way in Emacs to make a text buffer
>> continually scroll without user interaction?
>
>I think the best scrolling is one line at a time and
>that at a short, close and natural shortcut, e.g. M-i
>to scroll up, and M-k to scroll down.
>
>I have C-M-j and C-M-l to scroll sideways (left and
>right, respectively) - the reason I don't have that
>M-j and M-l is I have those to iterate the Linux VTs,
>which I do much more often than scroll horizontally in
>Emacs...
>
>That said, what you ask for should be possible indeed.
>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
>
>If you prefer the original file, which also contains
>my other scroll stuff (the stuff mentioned first
>paragraph), check out this URL:
>
>    http://user.it.uu.se/~embe8573/conf/emacs-init/scroll.el
>

Thanks for all this, Emanuel. Maybe line-at-a-time will work out okay but I
think in will necessarily more jerky (cause saccades and maybe more tiring to
read). Anyway, I'll study your code and give it a try.

Ed



  reply	other threads:[~2015-06-12 16:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 21:24 continuous fractional scrolling B. T. Raven
2015-06-11 23:18 ` Emanuel Berg
2015-06-12 16:11   ` B. T. Raven [this message]
2015-06-13  1:06     ` Emanuel Berg

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=mlf0c102om3@drn.newsguy.com \
    --to=btraven@nihil.net \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).