emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote cc0f9398b3 1/2: Improve denote--retrieve-filenam


From: ELPA Syncer
Subject: [elpa] externals/denote cc0f9398b3 1/2: Improve denote--retrieve-filename-identifier check
Date: Tue, 13 Sep 2022 01:57:38 -0400 (EDT)

branch: externals/denote
commit cc0f9398b3c277853f26f601ef07ef892e019f89
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Improve denote--retrieve-filename-identifier check
    
    This makes it work as intended when 'buffer-file-name' returns the value
    of an unsaved buffer.  The denote--retrieve-filename-identifier should
    have no opinion about whether the file is saved or not.  It just needs
    to return the identifier.
---
 denote.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/denote.el b/denote.el
index 6da08d4bdc..e679ea84e3 100644
--- a/denote.el
+++ b/denote.el
@@ -855,11 +855,11 @@ contain the newline."
 
 (defun denote--retrieve-filename-identifier (file)
   "Extract identifier from FILE name."
-  (if (file-exists-p file)
+  (if (denote--file-has-identifier-p file)
       (progn
         (string-match denote--id-regexp file)
         (match-string 0 file))
-    (error "Cannot find `%s' as a file" file)))
+    (error "Cannot find `%s' as a file with a Denote identifier" file)))
 
 (defun denote--retrieve-filename-title (file)
   "Extract title from FILE name, else return `file-name-base'."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]