branch: externals/calibre
commit 187685e08ee93f406e5b0c020edfd430d375cd83
Author: Kjartan Óli Ágústsson <[email protected]>
Commit: Kjartan Óli Ágústsson <[email protected]>
Use cond instead of cl-case
* calibre-library.el (calibre-library-execute): Use cond instead of
cl-case when matching marks.
cl-case does not evaluate its keys, and as such is unsuited to
matching non-literal constants such as calibre-mod-marker and
calibre-del-marker.
---
calibre-library.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/calibre-library.el b/calibre-library.el
index ade73112f8..64e4f01622 100644
--- a/calibre-library.el
+++ b/calibre-library.el
@@ -73,15 +73,15 @@
(defun calibre-library-execute ()
"Performed marked Library actions."
(interactive nil calibre-library-mode)
- (let (remove-list modified-list mark)
+ (let (remove-list modified-list)
(save-excursion
(goto-char (point-min))
(while (not (eobp))
- (setf mark (char-after))
- (let ((book (tabulated-list-get-id)))
- (cl-case mark
- (calibre-del-marker (push book remove-list))
- (calibre-mod-marker (push book modified-list))))
+ (let ((book (tabulated-list-get-id))
+ (mark (char-after)))
+ (cond
+ ((eql mark calibre-del-marker) (push book remove-list))
+ ((eql mark calibre-mod-marker) (push book modified-list))))
(forward-line)))
(when remove-list (calibre-library-remove-books remove-list))
(when modified-list (calibre-edit-commit-edits modified-list)))