1

When opening an epub file with Nov-mode I get a binary buffer in fundamental mode and an error message File mode specification error: (error Invalid version syntax: ‘’ (must start with a number)). This issue happens in ALL my epub files and was not present when I installed nov-mode from MELPA for the first time (something must have changed in a recent version). Here's a stack trace of the error when I use a org-link to access an epub file.

Debugger entered--Lisp error: (error "Invalid version syntax: ‘’ (must start with a number)")
  signal(error ("Invalid version syntax: ‘’ (must start with a number)"))
  error("Invalid version syntax: `%s' (must start with a number)" "")
  version-to-list("")
  version<("" "9.0")
  byte-code("\301\010\302\"\203\024\0\303\304\305\"\210\306\307\310\"\210\202\034\0\311\304\312\305\313\310%\210\301\207" [org-version version< "9.0" org-add-link-type "nov" nov-org-link-follow add-hook org-store-link-functions nov-org-link-store org-link-set-parameters :follow :store] 6)
  nov-mode()
  set-auto-mode-0(nov-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer my_ebookfile.epub> "/home/pathfiletothefile/my_ebookfile.epub" nil nil "/home/pathfiletothefile/my_ebookfile.epub" (30673310 66306))
  find-file-noselect("/home/pathfiletothefile/my_ebookfile.epub" nil nil nil)
  find-file-other-window("/home/pathfiletothefile/my_ebookfile.epub")
  org-open-file("/home/pathfiletothefile/my_ebookfile.epub" nil)
  apply(org-open-file "/home/pathfiletothefile/my_ebookfile.epub" nil nil)
  org-link-open-as-file("/home/pathfiletothefile/my_ebookfile.epub" nil)
  org-link-open((link (:type "file" :path "/home/pathfiletothefile/my_ebookfile.epub" :format bracket :raw-link "/home/pathfiletothefile/my_ebookfile.epub" :application nil :search-option nil :begin 2077938 :end 2078198 :contents-begin 2078097 :contents-end 2078196 :post-blank 0 :parent (paragraph (:begin 2077938 :end 2078199 :contents-begin 2077938 :contents-end 2078199 :post-blank 0 :post-affiliated 2077938 :parent (item (:bullet "- " :begin 2077927 :end 2078199 :contents-begin 2077938 :contents-end 2078199 :checkbox on :counter nil :structure (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :pre-blank 0 :post-blank 0 :post-affiliated 2077927 :tag nil :parent (plain-list ...))))))) nil)
  org-open-at-point(nil)
  funcall-interactively(org-open-at-point nil)
  call-interactively(org-open-at-point nil nil)
  command-execute(org-open-at-point)

This is my configuration of the mode

(use-package nov
  :ensure t
  :mode ("\\.epub\\'" . nov-mode) 
  )

and I am using version 20201207.3 on emacs 26.3. There are similar threads here and here but none deals with an invalid version syntax error. I can provide an epub file if necessary, but as I said, this happens in ALL the files in my library. Thank you in advance for any help.

5
  • 1
    The immediate cause of the error is that org-version is the empty string when it is fed to version<. I have no idea why org-version is empty though. Jan 9 at 10:19
  • Interesting...I've tried to open the file from dired instead of org-mode and I get the same version errors which are displayed at the top of the stack. BTW, I use org-mode v9.4.4. Another interesting aspect is that after running the debug, the epub files suddenly display correctly, until I exit and restart emacs again. I think that 9.0 might not be org-version, but rather nov-mode version.
    – Ajned
    Jan 9 at 10:34
  • Your Org installation is broken, it shouldn't have an empty org-version.
    – wasamasa
    Jan 9 at 12:21
  • 1
    @Ajned: "9.0" is definitely being tested against org-version: have a look at nov.el and search through the five or so occurrences of version< there. Jan 9 at 13:19
  • @FranBurstall indeed, you were right. I have commented below why this happened (an error in my init file). Many thanks for your help
    – Ajned
    Jan 9 at 14:20
2

The reason this happens is because there is Org integration in nov.el that tries to use the recommended APIs and uses the value of org-version to figure that out. Granted, it's more robust to instead check for the existence of the APIs instead, I'll look into that instead. However, under no circumstances should org-version be an empty string, this means that your Org installation is broken, something you can verify with M-x org-version. I cannot reproduce your issue with a fresh install from Git:

$ git clone https://code.orgmode.org/bzg/org-mode.git
$ cd org-mode
$ make
$ emacs --batch -L lisp -l org --eval '(princ org-version)'
9.4.4

Even if I omit the make step, I get lots of warnings, but it ultimately prints out the correct version. Therefore something is seriously screwed up with your Org installation and you should look into fixing it.

2
  • Thanks. For some reason I had a (require 'org) line before calling org-babel-load-file in my init.el file, which was probably overlapping the built-in org-mode version with the melpa downloaded one. Anyway, it works now. Cheers.
    – Ajned
    Jan 9 at 13:00
  • I had somehow installed two versions at the same time. I just deleted the org package in the ~/emacs.d/elpa/ directory and everything worked again. Feb 24 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.