First of all, thanks again for this excellent package :), which really
improves my productivity.
Currently, with this configuration below enabled, I cannot open epub
file in Emacs:
(add-hook 'find-file-hook #'denote-link-buttonize-buffer)
After I did some digging, it turned out that (buffer-file-name) of epub
buffer with nov-mode is nil. And it made denote--current-file-is-note-p
throw an error: Wrong type argument: stringp, nil
It seems to work well with some modifications:
(defun denote--current-file-is-note-p ()
"Return non-nil if current file likely is a Denote note."
(and (buffer-file-name)
(or (string-match-p denote--id-regexp (buffer-file-name))
(string-match-p denote--id-regexp (buffer-name)))
(denote--default-dir-has-denote-prefix)))
--
Best,
Hilde Rhyne
> From: Hilde Rhyne <hilde.rhyne@disroot.org>> Date: Sun, 04 Sep 2022 22:47:50 +0800>> First of all, thanks again for this excellent package :), which really> improves my productivity.
Thank you!
> Currently, with this configuration below enabled, I cannot open epub> file in Emacs:>> (add-hook 'find-file-hook #'denote-link-buttonize-buffer)>> After I did some digging, it turned out that (buffer-file-name) of epub> buffer with nov-mode is nil. And it made denote--current-file-is-note-p> throw an error: Wrong type argument: stringp, nil>>> It seems to work well with some modifications:>> (defun denote--current-file-is-note-p ()> "Return non-nil if current file likely is a Denote note."> (and (buffer-file-name)> (or (string-match-p denote--id-regexp (buffer-file-name))> (string-match-p denote--id-regexp (buffer-name)))> (denote--default-dir-has-denote-prefix)))
Yes, this makes sense. Or do it with 'when-let' to avoid calling
'buffer-file-name' twice.
Do you want to:
1. Prepare a patch?
2. Have me introduce the change with you as the author?
[ "You" here means the screen name and email I see in this thread. ]
3. Something else?
All the best,
Protesilaos (or simply "Prot")
--
Protesilaos Stavrou
https://protesilaos.com
Hello, thanks for the quick response!
> Do you want to:>> 1. Prepare a patch?> 2. Have me introduce the change with you as the author?
I prefer the 2nd way. It is just a small fix. (=^x^=)
--
Best,
Hilde Rhyne
> From: Hilde Rhyne <hilde.rhyne@disroot.org>> Date: Sun, 04 Sep 2022 23:18:06 +0800>>> Hello, thanks for the quick response!
You are welcome!
>> Do you want to:>>>> 1. Prepare a patch?>> 2. Have me introduce the change with you as the author?>> I prefer the 2nd way. It is just a small fix. (=^x^=)
Thank you! This is your change:
commit 2532464b001b9aa316103e415df91e73635780c6
Author: Hilde Rhyne <hilde.rhyne@disroot.org>
Date: Sun Sep 4 18:31:07 2022 +0300
Make denote--current-file-is-note-p check for file
This avoids errors when buffer-file-name returns a nil value.
denote.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
And the follow-up:
commit 9758fa4393cb6fd760e6ab1d3696fc3933a44b71
Author: Protesilaos Stavrou <info@protesilaos.com>
Date: Sun Sep 4 18:33:06 2022 +0300
Acknowledge Hilde Rhyne for commit 2532464
The patch is below the ~15 line threshold and thus does not require
copyright assignment to the Free Software Foundation.
The issue was discussed on the mailing list:
<https://lists.sr.ht/~protesilaos/denote/%3Cm035d7nq22.fsf%40disroot.org%3E>.
README.org | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
I will now update to version 0.6.1 just to trigger a package update. A
formal record of your contribution will be included in the change log of
the next stable release (tentatively 1.0.0). Unless you prefer not to.
Thanks again!
--
Protesilaos Stavrou
https://protesilaos.com