unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36462: [PATCH] Prefer progress-reporter in bookmark.el
@ 2019-07-01 17:14 Stefan Kangas
  2019-07-06  8:48 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Kangas @ 2019-07-01 17:14 UTC (permalink / raw)
  To: 36462

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

The attached patch changes remaining uses of `message' to
`make-progress-reporter' where it makes sense in bookmark.el.

Thanks,
Stefan Kangas

[-- Attachment #2: 0001-Prefer-progress-reporter-in-bookmark.el.patch --]
[-- Type: text/x-patch, Size: 2408 bytes --]

From e9b5b5b7c1ccbfadee14e6d51675453e073662a1 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Mon, 1 Jul 2019 19:10:36 +0200
Subject: [PATCH] Prefer progress-reporter in bookmark.el

* lisp/bookmark.el (bookmark-upgrade-file-format-from-0)
(bookmark-bmenu-execute-deletions): Use progress-reporter.
---
 lisp/bookmark.el | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index bbef0a927d..f2fa688666 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -693,18 +693,17 @@ bookmark-upgrade-version-0-alist
 (defun bookmark-upgrade-file-format-from-0 ()
   "Upgrade a bookmark file of format 0 (the original format) to format 1.
 This expects to be called from `point-min' in a bookmark file."
-  (message "Upgrading bookmark format from 0 to %d..."
-           bookmark-file-format-version)
-  (let* ((old-list (bookmark-alist-from-buffer))
+  (let* ((reporter (make-progress-reporter
+                    (format "Upgrading bookmark format from 0 to %d..."
+                     bookmark-file-format-version)))
+         (old-list (bookmark-alist-from-buffer))
          (new-list (bookmark-upgrade-version-0-alist old-list)))
     (delete-region (point-min) (point-max))
     (bookmark-insert-file-format-version-stamp buffer-file-coding-system)
     (pp new-list (current-buffer))
-    (save-buffer))
-  (goto-char (point-min))
-  (message "Upgrading bookmark format from 0 to %d...done"
-           bookmark-file-format-version)
-  )
+    (save-buffer)
+    (goto-char (point-min))
+    (progress-reporter-done reporter)))
 
 
 (defun bookmark-grok-file-format-version ()
@@ -2125,8 +2124,8 @@ bookmark-bmenu-delete-backwards
 (defun bookmark-bmenu-execute-deletions ()
   "Delete bookmarks flagged `D'."
   (interactive)
-  (message "Deleting bookmarks...")
-  (let ((o-point  (point))
+  (let ((reporter (make-progress-reporter "Deleting bookmarks..."))
+        (o-point  (point))
         (o-str    (save-excursion
                     (beginning-of-line)
                     (unless (= (following-char) ?D)
@@ -2148,8 +2147,7 @@ bookmark-bmenu-execute-deletions
           (forward-char o-col))
       (goto-char o-point))
     (beginning-of-line)
-    (message "Deleting bookmarks...done")
-    ))
+    (progress-reporter-done reporter)))
 
 
 (defun bookmark-bmenu-rename ()
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#36462: [PATCH] Prefer progress-reporter in bookmark.el
  2019-07-01 17:14 bug#36462: [PATCH] Prefer progress-reporter in bookmark.el Stefan Kangas
@ 2019-07-06  8:48 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2019-07-06  8:48 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 36462-done

> From: Stefan Kangas <stefan@marxist.se>
> Date: Mon, 1 Jul 2019 19:14:33 +0200
> 
> The attached patch changes remaining uses of `message' to
> `make-progress-reporter' where it makes sense in bookmark.el.

Thanks, pushed to the master branch.

Would it be possible for you to send a patch when the bug number is
already known, and then include the reference to the bug number in the
log message?  E.g., send just the description first, and the actual
patch after you receive the acknowledgement with the bug number.  That
would allow to apply the patch with "git am", without the necessary
followup with "git commit --amend".

TIA





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-06  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-01 17:14 bug#36462: [PATCH] Prefer progress-reporter in bookmark.el Stefan Kangas
2019-07-06  8:48 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).