I am not entirely sure why buffer-file-name would be nil, but I have found it consistently breaking the find-file-hook for files using nov-mode. There might be other cases where this happen.
This is due to the buffer-file-name being nil and find-file-name-handler not supporting nil as an argument. I am not sure why it would be nil since there is a file, but it must somehow run the hook before the buffer-file-name is set up?
I am not entirely sure why
buffer-file-name
would be nil, but I have found it consistently breaking thefind-file-hook
for files usingnov-mode
. There might be other cases where this happen.Here is a minimal reproducible setup:
After that open an epub-file and the following error will be yielded:
This is due to the
buffer-file-name
beingnil
andfind-file-name-handler
not supportingnil
as an argument. I am not sure why it would benil
since there is a file, but it must somehow run the hook before thebuffer-file-name
is set up?