Gnus development mailing list
 help / color / mirror / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Re: make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters
Date: Sun, 20 Feb 2011 12:33:09 +0100	[thread overview]
Message-ID: <87bp276ive.fsf@gmx.de> (raw)
In-Reply-To: <87fwrj6j18.fsf@gmx.de> (Michael Albinus's message of "Sun, 20 Feb 2011 12:29:39 +0100")

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

Michael Albinus <michael.albinus@gmx.de> writes:

> The small appended patch allows alsy symbols as first argument of
> `make-progress-reporter. If this argument is a string, the progress
> reporter still uses the minibuffer. If the argument is a symbol (used in
> `mode-line-format'), the respective part of the modeline is updated.
>
> See the examples:
>
> ;; Use harvey balls for progress.
> (setq pr1 (make-progress-reporter 'mode-line-remote))
> (let ((progress-reporter--pulse-characters
>        '["\u25F7" "\u25F6" "\u25F5" "\u25F4"]))
>   (while t (progress-reporter-update pr1)))
>
> ;; Let the buffer name blink.
> (setq pr2 (make-progress-reporter 'mode-line-buffer-identification))
> (let ((progress-reporter--pulse-characters
>        (vector '(:propertize "%12b" face mode-line-buffer-id)
> 	       '(:propertize "%12b" face font-lock-warning-face))))
>     (while t (progress-reporter-update pr2)))

Oops, patch forgotten. Appended.

>> Ted

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1318 bytes --]

*** /tmp/ediff2346l1x	2011-02-20 12:32:15.324458002 +0100
--- /home/albinus/src/emacs/lisp/subr.el	2011-02-20 12:16:16.294458002 +0100
***************
*** 3588,3600 ****
  		 (message "%s" text)))))
  	  ;; Pulsing indicator
  	  (enough-time-passed
! 	   (let ((index (mod (1+ (car reporter)) 4))
  		 (message-log-max nil))
  	     (setcar reporter index)
! 	     (message "%s %s"
! 		      text
! 		      (aref progress-reporter--pulse-characters
! 			    index)))))))
  
  (defun progress-reporter-done (reporter)
    "Print reporter's message followed by word \"done\" in echo area."
--- 3588,3608 ----
  		 (message "%s" text)))))
  	  ;; Pulsing indicator
  	  (enough-time-passed
! 	   (let ((index (mod (1+ (car reporter))
! 			     (length progress-reporter--pulse-characters)))
  		 (message-log-max nil))
  	     (setcar reporter index)
! 	     (if (stringp text)
! 		 ;; Write into the minibuffer
! 		 (message "%s %s"
! 			  text
! 			  (aref progress-reporter--pulse-characters index))
! 	       ;; Update modeline
! 	       (eval
! 		`(let (((make-local-variable ,text)
! 			(aref progress-reporter--pulse-characters index)))
! 		   (force-mode-line-update)
! 		   (sit-for 0)))))))))
  
  (defun progress-reporter-done (reporter)
    "Print reporter's message followed by word \"done\" in echo area."

  reply	other threads:[~2011-02-20 11:33 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <buo7hczz61i.fsf@dhlpc061.dev.necel.com>
2011-02-17 12:14 ` auth-source-search: annoying messages Ted Zlatanov
2011-02-17 12:30   ` Michael Albinus
2011-02-17 13:41     ` Ted Zlatanov
2011-02-17 16:06       ` Michael Albinus
2011-02-17 16:50         ` make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters (was: auth-source-search: annoying messages) Ted Zlatanov
2011-02-17 21:43           ` make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters Michael Albinus
2011-02-18 14:47           ` Tom Tromey
2011-02-18 20:08             ` Ted Zlatanov
2011-02-20 11:29               ` Michael Albinus
2011-02-20 11:33                 ` Michael Albinus [this message]
2011-02-20 18:37                 ` Tom Tromey
2011-02-21 18:54                   ` Michael Albinus
2011-02-22 17:28                     ` Ted Zlatanov
2011-02-23  8:23                       ` Lars Ingebrigtsen
2011-02-23  8:46                         ` Michael Albinus
2011-02-23 15:08                           ` Ted Zlatanov
2011-02-23 15:59                             ` Michael Albinus
2011-02-23 16:43                               ` Ted Zlatanov
2011-02-23 20:56                           ` Chong Yidong
2011-02-23 21:28                             ` make-progress-reporter suggestions: 'modeline and customizableprogress-reporter--pulse-characters Drew Adams
2011-02-23 21:35                             ` make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters Ted Zlatanov
2011-02-23 21:48                             ` Global indicators (was: make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters) Julien Danjou
2011-02-24  0:05                               ` Global indicators Chong Yidong
2011-02-24  0:13                                 ` Drew Adams
2011-02-24 11:02                                 ` Julien Danjou
2011-02-24 11:12                                   ` Miles Bader
2011-02-24 11:42                                     ` Julien Danjou
2011-02-24 12:56                                       ` joakim
2011-02-25  2:41                                         ` Miles Bader
2011-02-24 12:37                                   ` David Kastrup
2011-02-24 13:56                                     ` Julien Danjou
2011-02-24 16:50                                 ` Ted Zlatanov
2011-02-23 21:53                             ` make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters Eli Zaretskii
2011-02-24 16:37                               ` Ted Zlatanov
2011-02-23 22:04                             ` David Kastrup
2011-02-24  0:38                               ` Ted Zlatanov
2011-02-24  1:27                                 ` make-progress-reporter suggestions: 'modeline and customizableprogress-reporter--pulse-characters Drew Adams
2011-02-24  2:01                                 ` make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters Chong Yidong
2011-02-24  3:15                                   ` Ted Zlatanov
2011-02-24 16:55                                     ` Stefan Monnier
2011-02-24 17:45                                       ` Drew Adams
2011-02-24 18:05                                       ` Global indicators (was: make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters) Ted Zlatanov
2011-02-24 19:56                                         ` Global indicators Michael Albinus
2011-03-01 18:25                                           ` Ted Zlatanov
2011-03-28 18:44                                           ` Ted Zlatanov
2011-09-28 13:56                                             ` Ted Zlatanov
2011-02-25 13:56                             ` make-progress-reporter suggestions: 'modeline and customizable progress-reporter--pulse-characters Michael Albinus
2011-02-17 20:17   ` auth-source-search: annoying messages Stefan Monnier
2011-02-18 20:06     ` Ted Zlatanov
2011-02-18 22:04       ` Lars Ingebrigtsen
2011-02-18 22:33       ` Stefan Monnier

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=87bp276ive.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.com \
    /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 NNTP newsgroup(s).