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

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

bug#53776: Modeline indicator when using define-minor-mode


From: Stephen Berman
Subject: bug#53776: Modeline indicator when using define-minor-mode
Date: Mon, 07 Feb 2022 00:13:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

On Sun, 06 Feb 2022 22:52:13 +0100 Michael Heerdegen <michael_heerdegen@web.de> 
wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> Nevertheless, I would be interested in trying it and seeing the code.
>> Can you post it?
>
> I don't have it any more.  The basic idea was like
>
> #+begin_src emacs-lisp
> (defvar ml-scroll-amnt 0)
>
> (setq-default
>  mode-line-format
>  `(:eval (substring (format-mode-line ',mode-line-format)
>                     ml-scroll-amnt)))
> #+end_src
>
> and let mouse-4 and mouse-5 over the mode-line de- and increase
> `ml-scroll-amnt'.  That's all.

Thanks, but doesn't this just truncate the mode-line-string
continuously?  For scrolling back, it seems necessary to store the
original mode-line-string and concatenate the previously truncated part
of it with the current value.

> Be careful when the variable binding of `mode-line-format' changes - the
> above hack won't survive that, so when a certain mode redefines
> `mode-line-format' (with other words: doesn't use the default value,
> like Gnus), you need to do the above after the variable has been set.

What I had in mind was something like using auto-hscroll-mode on the
mode line, or making it into something like a horizontal scroll bar.
Either of these, if possible at all, requires changes in the C code.

Steve Berman





reply via email to

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