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

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

[elpa] externals/calibre afe5581b7d 43/76: Only prompt to select library


From: ELPA Syncer
Subject: [elpa] externals/calibre afe5581b7d 43/76: Only prompt to select library if more than one is defined
Date: Thu, 18 May 2023 09:57:44 -0400 (EDT)

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

    Only prompt to select library if more than one is defined
    
    * calibre-db.el (calibre-select-library): Add a check if there is more
    than one library defined before prompting.
---
 calibre-db.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/calibre-db.el b/calibre-db.el
index 9bbb623f7a..976714f4b6 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -229,8 +229,11 @@ If FORCE is non-nil the list is refreshed from the 
database."
 If LIBRARY is non-nil, select that instead."
   (interactive)
   (setf calibre--library (if library
-                            library
-                           (completing-read "Library: " 
(calibre--library-names) nil t))
+                             library
+                           (let ((names (calibre--library-names)))
+                             (if (not (length> names 1))
+                               (car names)
+                             (completing-read "Library: " names nil t))))
         calibre--db nil
         calibre--books nil)
   (calibre-library--refresh t))



reply via email to

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