diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-03-15 19:41:35 +0000 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2020-03-15 19:41:35 +0000 |
commit | 1da1b465d6c169df57cb2e5f5c26b08c620a469b (patch) | |
tree | 231df0369c961e8a41047316624f7a0ebab57063 | |
parent | ecb3e20c0d013cf48ac26e54963ac5a3d85c9637 (diff) | |
download | org-zettelkasten-1da1b465d6c169df57cb2e5f5c26b08c620a469b.tar.gz org-zettelkasten-1da1b465d6c169df57cb2e5f5c26b08c620a469b.zip |
Make parent optional
-rw-r--r-- | zettelkasten.el | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/zettelkasten.el b/zettelkasten.el index 0bcaac1..6e96c30 100644 --- a/zettelkasten.el +++ b/zettelkasten.el @@ -127,7 +127,6 @@ For supported options, please consult `format-time-string'." "Create the new note name." (zettelkasten-find-new-note-name (format-time-string zettelkasten-file-format))) -(zettelkasten-generate-note-name) (defun zettelkasten-get-id (note) "Return the id for a NOTE." @@ -142,16 +141,16 @@ For supported options, please consult `format-time-string'." zettelkasten-extension)) (defun zettelkasten-add-link-to-parent (note parent) - "Add a link to NOTE from PARENT." + "Add a link to NOTE from a PARENT." (with-temp-file (zettelkasten-make-filename parent) (insert-file-contents-literally (zettelkasten-make-filename parent)) (goto-char (point-max)) (insert (concat "\n" (zettelkasten-format-link note))))) -(defun zettelkasten-create-new-note-ni (title parent) - "Create a new note based on the TITLE and it's PARENT note. +(defun zettelkasten-create-new-note-ni (title &optional parent) + "Create a new note based on the TITLE and it's optional PARENT note. -If PARENT is nil, it will not add a link from a parent." +If PARENT is nil, it will not add a link from a PARENT." (let ((note (zettelkasten-generate-note-name))) (when parent (zettelkasten-add-link-to-parent note (zettelkasten-get-id parent))) |