Subject: [PATCH] Prefer progress-reporter in bookmark.el

From: Stefan Kangas <[email-masked]>
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,
Stefan Kangas
From e9b5b5b7c1ccbfadee14e6d51675453e073662a1 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
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