I'm running app-editors/emacs-27.2-r5, app-emacs/ebuild-mode-1.56 and app-emacs/nov-0.4.0 (the latter from my personal Gentoo overlay). Link to my personal Gentoo overlay: https://git.sr.ht/~fturco/gentoo. When I try opening an EPUB book with nov.el, emacs complains with the following error message: > Wrong type argument: stringp, nil You can find the emacs backtrace as an attachment to this bug report. As far as I can understand, the problem is in the ebuild-repo-mode-maybe-enable function in ebuild-mode.el. The buffer for the EPUB book does not have a corresponding file, because EPUB books are basically ZIP archives that are extracted on the fly by nov.el in order to access book chapters. For this reason, the buffer-file-name function will return nil. But then the locate-dominating-file function will get nil as its first argument instead of a string, and will fail. I discussed the problem in the #emacs channel on Libera, and they told me that we should probably replace the following line: > (and (locate-dominating-file buffer-file-name "profiles/repo_name") with: > (and buffer-file-name (locate-dominating-file buffer-file-name "profiles/repo_name") After copying the function ebuild-repo-mode-maybe-enable function to the scratch buffer, fixing it and loading it with eval-defun, I can successfully open EPUB books with nov.el. I'm no emacs expert, so I'm not sure if this fix is the best possible one, but at least it does the job.
Created attachment 779612 [details] emerge-info.txt emerge --info
Created attachment 779615 [details] backtrace.txt emacs backtrace
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/ebuild-mode.git/commit/?id=46dd6ccf03f5dab9d86a6eca160ca94f2b67024c commit 46dd6ccf03f5dab9d86a6eca160ca94f2b67024c Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2022-05-20 16:31:00 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2022-05-20 16:31:00 +0000 Protect against buffer-file-name being nil * ebuild-mode.el (ebuild-mode, ebuild-repo-mode-maybe-enable): Protect against buffer-file-name being nil. Bug 846569. Bug: https://bugs.gentoo.org/846569 Signed-off-by: Ulrich Müller <ulm@gentoo.org> ChangeLog | 5 +++++ ebuild-mode.el | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-)
I'll make a new release today or tomorrow.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30a94b889a925b22540dc8e7282c0c248d07421e commit 30a94b889a925b22540dc8e7282c0c248d07421e Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2022-05-20 18:15:43 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2022-05-20 18:25:27 +0000 app-emacs/ebuild-mode: Version bump to 1.59 Closes: https://bugs.gentoo.org/846569 Signed-off-by: Ulrich Müller <ulm@gentoo.org> app-emacs/ebuild-mode/Manifest | 1 + app-emacs/ebuild-mode/ebuild-mode-1.59.ebuild | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+)
Thanks for reporting! Please test ebuild-mode-1.59.
I confirm that ebuild-mode-1.59 works fine now. Thank you!