Skip to content

(fix) org-roam-file-p handle opening a buffer with no path#2169

Merged
jethrokuan merged 2 commits intoorg-roam:mainfrom
c1-g:fix-epub
Apr 23, 2022
Merged

(fix) org-roam-file-p handle opening a buffer with no path#2169
jethrokuan merged 2 commits intoorg-roam:mainfrom
c1-g:fix-epub

Conversation

@c1-g
Copy link
Copy Markdown
Contributor

@c1-g c1-g commented Apr 23, 2022

Motivation for this change

Errors when opening a .epub file with nov.el (a package
that renders EPUB file) because nov.el doesn't store the filename
in buffer-file-name, opening it caused errors with org-roam-file-p.

The error is documented in #2163

Found this issue when opening a .epub file with nov.el (a package
that renders EPUB file) because nov.el doesn't store the filename
in buffer-file-name, opening it caused errors with org-roam-file-p.
@jethrokuan
Copy link
Copy Markdown
Member

Good catch, but I think it's better to just return nil when path is nil. Like

if not path:
  nil
else:
  rest of logic assuming path is not nil

@c1-g
Copy link
Copy Markdown
Contributor Author

c1-g commented Apr 23, 2022

With the new commit, I've done exactly as you said. Now, it will just return nil if the buffer-file-name is nil.

@jethrokuan
Copy link
Copy Markdown
Member

Thanks!

@jethrokuan jethrokuan merged commit a073bcf into org-roam:main Apr 23, 2022
@Gleek
Copy link
Copy Markdown

Gleek commented May 7, 2022

@jethrokuan This seems to be reverted in #2171. Was it intended? I'm facing the same issue in the latest version of org-roam

@jethrokuan
Copy link
Copy Markdown
Member

urgh my bad

jethrokuan added a commit that referenced this pull request May 8, 2022
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants