emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/calibre 04c484a2ef 55/76: Preserve marks when refreshin


From: ELPA Syncer
Subject: [elpa] externals/calibre 04c484a2ef 55/76: Preserve marks when refreshing library
Date: Thu, 18 May 2023 09:57:45 -0400 (EDT)

branch: externals/calibre
commit 04c484a2ef3b4f3a8afb1956c8867636e93821eb
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>

    Preserve marks when refreshing library
    
    * calibre-db.el: Require calibre-util
    (calibre-library--refresh): Preserve marks.
---
 calibre-db.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/calibre-db.el b/calibre-db.el
index 4d1864bf63..051ad55927 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -26,6 +26,7 @@
 ;;; Code:
 (require 'calibre)
 (require 'calibre-book)
+(require 'calibre-util)
 
 (defun calibre-make-book (entry)
   "Create a `calibre-book' from ENTRY.
@@ -271,11 +272,16 @@ If FORCE is non-nil fetch book data from the database."
   (let ((buffer (get-buffer calibre-library-buffer)))
     (when buffer
       (with-current-buffer buffer
-        (setf tabulated-list-entries
-              (mapcar #'calibre-book--print-info
-                      (calibre-library--filter calibre-library--filters
-                                               (calibre--books force))))
-        (tabulated-list-print)))))
+        (let ((book (tabulated-list-get-id)))
+          (calibre-with-preserved-marks (not force)
+            (setf tabulated-list-entries
+                  (mapcar #'calibre-book--print-info
+                          (calibre-library--filter calibre-library--filters
+                                                   (calibre--books force))))
+            (tabulated-list-print)
+            (if book
+                (calibre-library--find-book book)
+              (goto-char (point-max)))))))))
 
 (defun calibre-library--set-header ()
   "Set the header of the Library buffer."



reply via email to

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