Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default directory for new files #91

Open
wd opened this issue Dec 12, 2020 · 1 comment
Open

Default directory for new files #91

wd opened this issue Dec 12, 2020 · 1 comment

Comments

@wd
Copy link

wd commented Dec 12, 2020

The new file will put under deft-directory by default, is there any settings that can put the file to deft-directory/notes ? I want to use deft to search from all files in deft-directory, but want new file to put under deft-directory/notes.

@glucas
Copy link
Contributor

glucas commented Aug 2, 2024

There is no built-in support for this, but I wanted the same thing. I've got a workaround with advice that seems to work.

(defun my/use-deft-notes-dir (orig &rest args)
  (let ((deft-directory my/notes-dir))
    (apply orig args)))

(advice-add #'deft-absolute-filename :around #'my/use-deft-notes-dir)

This replaces the value for deft-directory in the function the builds the absolute path for a new file. You can set your own notes directory, e.g. (defvar my/notes-dir (expand-file-name "notes" deft-directory)).

So far it seems to work fine. Having deft provide a deft-new-file-directory would be great though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants