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

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

bug#23088: 25.1.50; progress-reporter with 2 text messages


From: Tino Calancha
Subject: bug#23088: 25.1.50; progress-reporter with 2 text messages
Date: Tue, 22 Mar 2016 19:59:32 +0900 (JST)
User-agent: Alpine 2.20 (LRH 67 2015-01-07)


Adding a second optional message in progress-reporter
provides more control in the output format.
When both, NEW-MESSAGE and NEW-MESAGE2
are provided to `progress-reporter-force-update', the
structure of the output string would be as follows:

1) MESSAGE: it may be the operation under course.
2) As before, the status index (i.e., 30%).
3) MESSAGE2: it may be, i.e., the current file being processed.

In following example, the status index changes the position with
every message, which is distracting.

emacs -Q:
(let* ((games '("Mega Man"
                           "Street Fighter II: The World Warrior"
                           "Double Dragon"
                           "Very long game with lot of stages: requires many months 
to complete"
                           "The Legend Of Zelda"
                           "Pac-Man"))
           (num-games (length games))
           (text "Checking game...")
           (prep (make-progress-reporter text 0 num-games)))
  (dotimes (i num-games)
        (progress-reporter-force-update prep i
                                        (format "Checking game... (%s) " (nth i 
games)))

        (sit-for (or (and (= i 3) 5) 1)))
  (message "Games check completed!"))

; A second optional string allows to present the information as described in 
1-2-3 above:
(progress-reporter-force-update prep i text
                                (format "(%s)" (nth i games)))

; This would display the index string in the same position for each update.



In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.29)
 of 2016-03-10 built on calancha-pc
Repository revision: 780a605e1d2de4b975e6f1f29b491c9af419dcff

Attachment: subr.patch
Description: Text document


reply via email to

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