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

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

[elpa] externals/denote aaa691aa15 020/355: Refine front-matter


From: ELPA Syncer
Subject: [elpa] externals/denote aaa691aa15 020/355: Refine front-matter
Date: Sun, 26 Jun 2022 23:57:56 -0400 (EDT)

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

    Refine front-matter
---
 denote.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/denote.el b/denote.el
index bcd1c0f738..0795c14efa 100644
--- a/denote.el
+++ b/denote.el
@@ -253,8 +253,11 @@ TITLE, DATE, KEYWORDS, FILENAME, ID are all strings which 
are
     (concat "#+title:      " title     "\n"
             "#+date:       " date      "\n"
             "#+keywords:   " kw        "\n"
-            "#+filename:   " filename  "\n"
-            "#+identifier: " id        "\n\n")))
+            "#+identifier: " id        "\n"
+            "#+filename:   " (string-remove-prefix denote-directory filename)  
"\n"
+            "#+path:       " filename  "\n"
+            "#+link:       " "denote /home/prot/Documents/notes/%s"
+            "\n\n")))
 
 (defun denote--path (title keywords)
   "Return path to new file with TITLE and KEYWORDS.
@@ -269,11 +272,11 @@ Format current time, else use optional ID."
 (defun denote--prepare-note (title keywords &optional path)
   "Use TITLE and KEYWORDS to prepare new note file.
 Use optional PATH, else create it with `denote--path'."
-  (let* ((filename (or path (denote--path title keywords)))
+  (let* ((path (or path (denote--path title keywords)))
          (default-directory denote-directory)
-         (buffer (unless path (find-file filename)))
+         (buffer (unless path (find-file path)))
          (header (denote--file-meta-header
-                  title (format-time-string "%F") keywords filename
+                  title (format-time-string "%F") keywords path
                   (format-time-string denote-id))))
     (unless path
       (with-current-buffer buffer (insert header))



reply via email to

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