mirror of
https://github.com/org-roam/org-roam
synced 2025-09-16 15:56:48 -05:00
(feature): make org-roam-insert work in org-capture buffers (#134)
In org-capture buffers, (buffer-file-name) will always return nil. But we can get the name of the buffer that we are capturing into via (buffer-base-buffer), then getting the path to the current file works as expected.
This commit is contained in:
@@ -287,7 +287,8 @@ If PREFIX, downcase the title before insertion."
|
||||
(title (completing-read "File: " completions))
|
||||
(absolute-file-path (or (cadr (assoc title completions))
|
||||
(org-roam--make-new-file-path (org-roam--get-new-id title) t)))
|
||||
(current-file-path (-> (current-buffer)
|
||||
(current-file-path (-> (or (buffer-base-buffer)
|
||||
(current-buffer))
|
||||
(buffer-file-name)
|
||||
(file-truename)
|
||||
(file-name-directory))))
|
||||
|
Reference in New Issue
Block a user