[Top][All Lists]

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

Re: Scroll lock

From: Ralf Angeli
Subject: Re: Scroll lock
Date: Wed, 29 Jun 2005 13:23:19 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

* Richard M. Stallman (2005-06-27) writes:

> If you only wanted it in read-only buffers, we could perhaps turn it
> on by default in those buffers.  If you want it to be available in any
> buffer, we'd have to make it a minor mode, and you'd get it only when
> you explicitly ask.

I think it would be nice to have a user option or another convenient
way (e.g. a hook) for enabling the mode automatically in read-only
buffers.  But the criterion "read-only" is probably too wide to
trigger the mode in all cases, so it might be better to simply
activate the mode via the mode hooks of modes in which scroll locking
should be enabled, e.g. Info mode or Woman mode.

>     1) Using a special symbol for `scroll-preserve-screen-position'.
>        Setting it e.g. to 'always would preserve screen position of point
>        for any scroll command, even those which would not move point out
>        of the visible portion of the buffer.  The behavior you get when
>        setting the variable to t would stay as is.
> That would be ok with me.

Attached you can find a patch for window.c and an updated
scroll-lock.el file corresponding to the changes in window.c.  Here is
a ChangeLog entry for the window.c changes:

2005-06-29  Ralf Angeli  <address@hidden>

        * window.c (Qalways): New variable.
        (syms_of_window): Initialize it.
        (window_scroll_pixel_based, window_scroll_line_based): Preserve
        screen position of point if `scroll-preserve-screen-position' is
        set to 'always.
        (scroll-preserve-screen-position): Document 'always value.

An open issue is the key binding for toggling the mode.  If the minor
mode should be able to be activated in some major modes but not in
others, it doesn't make much sense to bind this to the Scroll Lock key
which in my understanding means to enable or disable it globally (not
just for Emacs but for other applications aware of it as well).

So my idea was to make Scroll Lock minor mode a local mode and add
e.g. `C-x %' as a key binding for toggling it.  The binding seems not
be used throughout the Emacs code base (according to some grepping I
did in the lisp/ directory).  And the % character looks a little bit
like scrolls in a shelf.  In addition it could be an option to give
the mode a different name in order to avoid confusion about the mode
not being accessible via the Scroll Lock key.


Attachment: window.c.patch
Description: Text Data

Attachment: scroll-lock.el
Description: application/emacs-lisp

reply via email to

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