[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 2532464b00 1/3: Make denote--current-file-is-not
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 2532464b00 1/3: Make denote--current-file-is-note-p check for file |
Date: |
Sun, 4 Sep 2022 11:57:30 -0400 (EDT) |
branch: externals/denote
commit 2532464b001b9aa316103e415df91e73635780c6
Author: Hilde Rhyne <hilde.rhyne@disroot.org>
Commit: Protesilaos Stavrou <info@protesilaos.com>
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(-)
diff --git a/denote.el b/denote.el
index 4e0edaf166..71648f9874 100644
--- a/denote.el
+++ b/denote.el
@@ -493,7 +493,8 @@ FILE must be an absolute path."
(defun denote--current-file-is-note-p ()
"Return non-nil if current file likely is a Denote note."
- (and (or (string-match-p denote--id-regexp (buffer-file-name))
+ (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)))