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

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

[elpa] externals/denote 99d1cbb23d 2/2: Remove else part in denote--file


From: ELPA Syncer
Subject: [elpa] externals/denote 99d1cbb23d 2/2: Remove else part in denote--file-name-relative-to-denote-directory
Date: Sun, 10 Jul 2022 15:57:31 -0400 (EDT)

branch: externals/denote
commit 99d1cbb23dd5f42874c9e5e0ff25b45f387275dc
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Remove else part in denote--file-name-relative-to-denote-directory
---
 denote.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/denote.el b/denote.el
index 22e11e09b8..f98dd7edbc 100644
--- a/denote.el
+++ b/denote.el
@@ -326,11 +326,11 @@ FILE is relative to the variable `denote-directory'."
 (defun denote--file-name-relative-to-denote-directory (file)
   "Return file name of FILE relative to the variable `denote-directory'.
 FILE must be an absolute path."
-  (if-let* ((dir (denote-directory))
-            ((file-name-absolute-p file))
-            ((string-prefix-p dir file)))
-      (substring-no-properties file (length dir))
-    file))
+  (when-let* ((dir (denote-directory))
+              ((file-name-absolute-p file))
+              (file-name (expand-file-name file))
+              ((string-prefix-p dir file-name)))
+    (substring-no-properties file-name (length dir))))
 
 (defun denote--current-file-is-note-p ()
   "Return non-nil if current file likely is a Denote note."



reply via email to

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