From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#23088: 25.1.50; progress-reporter with 2 text messages Date: Tue, 22 Mar 2016 19:59:32 +0900 (JST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1468197610-339572395-1458644372=:11383" X-Trace: ger.gmane.org 1458644251 17411 80.91.229.3 (22 Mar 2016 10:57:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2016 10:57:31 +0000 (UTC) To: 23088@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 22 11:57:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aiJzs-0005n5-Gw for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 11:57:12 +0100 Original-Received: from localhost ([::1]:35255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiJzs-00067v-3h for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 06:57:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiJzn-00067j-C3 for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 06:57:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiJzi-0008GJ-6r for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 06:57:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiJzi-0008GD-3h for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 06:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aiJzh-0003nw-VA for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 06:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Mar 2016 10:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23088 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145864419514591 (code B ref -1); Tue, 22 Mar 2016 10:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Mar 2016 10:56:35 +0000 Original-Received: from localhost ([127.0.0.1]:57763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiJzH-0003nG-0m for submit@debbugs.gnu.org; Tue, 22 Mar 2016 06:56:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiJzF-0003n4-3v for submit@debbugs.gnu.org; Tue, 22 Mar 2016 06:56:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiJz8-00083R-Jr for submit@debbugs.gnu.org; Tue, 22 Mar 2016 06:56:27 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiJz8-00083N-HG for submit@debbugs.gnu.org; Tue, 22 Mar 2016 06:56:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiJz4-00060n-8i for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 06:56:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiJyz-0007yg-3T for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 06:56:22 -0400 Original-Received: from calancha-ilc.kek.jp ([130.87.234.234]:34808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiJyy-0007yR-HV for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 06:56:17 -0400 Original-Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id B519ED99C; Tue, 22 Mar 2016 19:59:32 +0900 (JST) Original-Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id 97DCBD981 for ; Tue, 22 Mar 2016 19:59:32 +0900 (JST) X-X-Sender: calancha@calancha-ilc.kek.jp User-Agent: Alpine 2.20 (LRH 67 2015-01-07) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115305 Archived-At: --1468197610-339572395-1458644372=:11383 Content-Type: text/plain; format=flowed; charset=US-ASCII 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 --1468197610-339572395-1458644372=:11383 Content-Type: text/plain; charset=US-ASCII; name=subr.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=subr.patch ZGlmZiAtLWdpdCBhL2xpc3Avc3Vici5lbCBiL2xpc3Avc3Vici5lbA0KaW5k ZXggY2FkNjMxOS4uZTUzMjVmNCAxMDA2NDQNCi0tLSBhL2xpc3Avc3Vici5l bA0KKysrIGIvbGlzcC9zdWJyLmVsDQpAQCAtNDcxMSw3ICs0NzExLDcgQEAg cHJvZ3Jlc3MtcmVwb3J0ZXItdXBkYXRlDQogICAgIChwcm9ncmVzcy1yZXBv cnRlci1kby11cGRhdGUgcmVwb3J0ZXIgdmFsdWUpKSkNCiANCiAoZGVmdW4g bWFrZS1wcm9ncmVzcy1yZXBvcnRlciAobWVzc2FnZSAmb3B0aW9uYWwgbWlu LXZhbHVlIG1heC12YWx1ZQ0KLQkJCQkgICAgICAgY3VycmVudC12YWx1ZSBt aW4tY2hhbmdlIG1pbi10aW1lKQ0KKwkJCQkgICAgICAgY3VycmVudC12YWx1 ZSBtaW4tY2hhbmdlIG1pbi10aW1lIG1lc3NhZ2UyKQ0KICAgIlJldHVybiBw cm9ncmVzcyByZXBvcnRlci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