Fix org-roam--make-file to create files with extensions (#67)

This commit is contained in:
Jethro Kuan
2020-02-13 12:36:19 +08:00
committed by GitHub
parent 7817116403
commit ede33d7411

View File

@ -231,6 +231,8 @@ If not provided, derive the title from the file name."
(defun org-roam--make-file (file-path &optional title)
"Create an org-roam file at FILE-PATH, optionally setting the TITLE attribute."
(unless (string= "org" (file-name-extension file-path))
(setq file-path (concat file-path ".org")))
(if (file-exists-p file-path)
(error (format "Aborting, file already exists at " file-path))
(if org-roam-autopopulate-title