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

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

[elpa] externals/denote 4934870625 3/9: Tweak how links are formatted (d


From: ELPA Syncer
Subject: [elpa] externals/denote 4934870625 3/9: Tweak how links are formatted (due to 8a8be90)
Date: Sat, 13 Aug 2022 03:57:29 -0400 (EDT)

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

    Tweak how links are formatted (due to 8a8be90)
---
 denote.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/denote.el b/denote.el
index ba5078e3f9..b6ddbb0f90 100644
--- a/denote.el
+++ b/denote.el
@@ -1776,13 +1776,17 @@ title."
     ("md" denote-link--regexp-markdown)
     (_ denote-link--regexp-org)))
 
+;; FIXME 2022-08-13: Write this cleanly
 (defun denote-link--format-link (file pattern)
   "Prepare link to FILE using PATTERN."
-  (let* ((file-id (denote--retrieve-filename-identifier file))
-         (file-type (denote--filetype-heuristics file))
-         (file-title (unless (string= pattern denote-link--format-id-only)
-                       (denote--retrieve-value-title file file-type))))
-    (format pattern file-id file-title)))
+  (if (denote--writable-and-supported-p file)
+      (let* ((file-id (denote--retrieve-filename-identifier file))
+             (file-type (denote--filetype-heuristics file))
+             (file-title (unless (string= pattern denote-link--format-id-only)
+                           (denote--retrieve-value-title file file-type))))
+        (format pattern file-id file-title))
+    (format denote-link--format-id-only
+            (denote--retrieve-filename-identifier file))))
 
 ;;;###autoload
 (defun denote-link (target &optional id-only)



reply via email to

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