branch: externals/calibre
commit bc26df0b48ca918d4cfecc74b65b5d36a91be5e4
Author: Kjartan Óli Ágústsson <[email protected]>
Commit: Kjartan Óli Ágústsson <[email protected]>

    Set tabulated-list-format in the correct buffer
    
    * calibre-db.el (calibre-library--set-header): Get the Library buffer,
    and only set tabulated-list-format if it exists, and then in that
    buffer.
---
 calibre-db.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/calibre-db.el b/calibre-db.el
index 9d43190d5c..5de3e6a3ee 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -186,7 +186,10 @@ column should have."
 
 (defun calibre-library--set-header ()
   "Set the header of the Library buffer."
-  (setf tabulated-list-format (calibre-library--header-format)))
+  (let ((buffer (get-buffer calibre-library-buffer)))
+    (when buffer
+      (with-current-buffer buffer
+        (setf tabulated-list-format (calibre-library--header-format))))))
 
 (defun calibre-library--header-format ()
   "Create the header for the Library buffer.

Reply via email to