[Top][All Lists]

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

Re: make-progress-reporter suggestions: 'modeline and customizable progr

From: Michael Albinus
Subject: Re: make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters
Date: Mon, 21 Feb 2011 19:54:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Tom Tromey <address@hidden> writes:

> Tom> How about propertizing the the mode-line so that the background color
> Tom> changes from left to right as the task progresses?
> Michael> That would be an invasive patch: the modeline string is known only in
> Michael> xdisp.c, and we would need to change it there.
> I think you could save the old mode line and replace it with an :eval
> form that calls format-mode-line and then propertizes it.

Ah, yes. I was not aware of `format-mode-line'. It also works with my
proposed patch, and the following snippet:

--8<---------------cut here---------------start------------->8---
(defun blink-mode-line ()
  (let* ((pos (mod count (length mlf))))
    (setq count (1+ count))
    (concat (substring mlf 0 pos)
            (propertize (substring mlf pos (1+ pos)) 'face '(:inverse-video t))
            (substring mlf (1+ pos) (length mlf)))))

(setq count 0
      pr (make-progress-reporter 'mode-line-format))

(let ((mlf (format-mode-line mode-line-format t))
      (progress-reporter--pulse-characters (vector '(:eval (blink-mode-line)))))
  (while t (progress-reporter-update pr)))
--8<---------------cut here---------------end--------------->8---

> I agree with Ted that it might not always be great.  But I was only
> proposing it as a option, not as the only way.

Yes, it doesn't look so good.

> Tom

Best regards, Michael.

reply via email to

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