chenyanming / calibredb.el

Emacs calibre client - An Ebook Management Solution in Emacs.
GNU General Public License v3.0
323 stars 17 forks source link

Lisp Error when `calibre-show-metadata` #64

Closed drcxd closed 1 year ago

drcxd commented 1 year ago

calibredb works fine for me, it opens the *calibre-search* buffer. However, when I try to invoke calibre-show-metadata, I get a lisp error:

Debugger entered--Lisp error: (wrong-type-argument listp #("284 Communicating Sequential Processes            ..." 0 4 (face calibredb-id-face id "284") 4 54 (face calibredb-title-face) 55 60 (face calibredb-format-face mouse-face calibredb-mouse-face help-echo "Filter with this format" keymap (keymap (mouse-1 . calibredb-format-mouse-1))) 61 72 (face calibredb-date-face mouse-face calibredb-mouse-face help-echo "Filter with this date" keymap (keymap (mouse-1 . calibredb-date-mouse-1))) 73 78 (author "Hoare" face calibredb-author-face mouse-face calibredb-mouse-face help-echo "Filter with this author: Hoare" keymap (keymap (mouse-1 . calibredb-author-mouse-1))) 79 88 (author " C. A. R." face calibredb-author-face mouse-face calibredb-mouse-face help-echo "Filter with this author:  C. A. R." keymap (keymap (mouse-1 . calibredb-author-mouse-1))) 90 92 (tag "''" face calibredb-tag-face mouse-face calibredb-mouse-face help-echo "Filter with this tag: ''" keymap (keymap (mouse-1 . calibredb-tag-mouse-1))) 95 97 (face calibredb-comment-face)))
  calibredb-getattr((#("284 Communicating Sequential Processes            ..." 0 4 (face calibredb-id-face id "284") 4 54 (face calibredb-title-face) 55 60 (face calibredb-format-face mouse-face calibredb-mouse-face help-echo "Filter with this format" keymap (keymap (mouse-1 . calibredb-format-mouse-1))) 61 72 (face calibredb-date-face mouse-face calibredb-mouse-face help-echo "Filter with this date" keymap (keymap (mouse-1 . calibredb-date-mouse-1))) 73 78 (author "Hoare" face calibredb-author-face mouse-face calibredb-mouse-face help-echo "Filter with this author: Hoare" keymap (keymap (mouse-1 . calibredb-author-mouse-1))) 79 88 (author " C. A. R." face calibredb-author-face mouse-face calibredb-mouse-face help-echo "Filter with this author:  C. A. R." keymap (keymap (mouse-1 . calibredb-author-mouse-1))) 90 92 (tag "''" face calibredb-tag-face mouse-face calibredb-mouse-face help-echo "Filter with this tag: ''" keymap (keymap (mouse-1 . calibredb-tag-mouse-1))) 95 97 (face calibredb-comment-face)) ((:id "284") (:author-sort "Hoare, C. A. R.") (:book-dir "C. A. R. Hoare/Communicating Sequential Processes ...") (:book-name "Communicating Sequential Proces - C. A. R. Hoare") (:book-format "pdf") (:book-pubdate "0101-01-01 00:00:00+00:00") (:book-title "Communicating Sequential Processes") (:file-path "d:/program/calibre/Calibre Portable/Calibre Librar...") (:tag "''") (:size "0.77") (:comment "''") (:ids "''") (:publisher "''") (:series "''") (:lang_code "''") (:last_modified "2022-09-05 04:37:55.947628+00:00"))) :id)
  calibredb-show-metadata()
  funcall-interactively(calibredb-show-metadata)
  call-interactively(calibredb-show-metadata record nil)
  command-execute(calibredb-show-metadata record)
  execute-extended-command(nil "calibredb-show-metadata" nil)
  funcall-interactively(execute-extended-command nil "calibredb-show-metadata" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

I am using Emacs 30.0.50 on Windows, with built-in sqlite module. My calibredb package version is 20220612. I do have an external sqlite3 installed, and its version is 3.40.1. Any idea what leads to this problem?

chenyanming commented 1 year ago

Check if sql-sqlite-program is using the external sqlite3, for me, the value is /usr/bin/sqlite3. Built-in sqlite module is not supported yet.

drcxd commented 1 year ago

My sql-sqlite-program is c:/msys64/mingw64/bin/sqlite3.exe, which is also external. Do you think that building Emacs without sqlite module will fix this issue?

drcxd commented 1 year ago

I have compiled my Emacs again with no built-in sqlite module, but still get the same result. Also tested with Emacs release 28.2, still get the same error.

drcxd commented 1 year ago

Though I do not know emacs-lisp too much, I dig into the code a little bit. It seems that the problem has nothing to do with sqlite.

image

The echo area contains evaluating canditate in the debugger.

chenyanming commented 1 year ago

Oh, I see, just checked calibredb-show-metadata is buggy. It is not a useful feature by the way, it only prints out the metadata to Message buffer.

chenyanming commented 1 year ago

You can use calibredb-view insead.