Open AtomicNess123 opened 3 years ago
I'm not sure I understand your question. Do you mean configure Emacs so that Zetteldeft loads at the start?
Or is the issue that you manually need to launch Deft before you can create a new Zetteldeft note?
The issue is, everytime I do M-x zetteldeft-new-file
, I enter the name of the note and then I must wait while "initializing deft".
This seems like a timing issue with package initialization. Why not just load and run deft
automatically when loading zetteldeft
. If you use use-package
, run (deft)
in :config
, perhaps?
Why not just load and run deft automatically when loading zetteldeft. If you use use-package, run (deft) in :config, perhaps?
Yeah, or instead of using (deft)
, use (deft-cache-initialize)
. That should load the cache at startup, rather than when you launch Deft for the first time.
The issue is, everytime I do M-x zetteldeft-new-file, I enter the name of the note and then I must wait while "initializing deft".
Do you really mean every time? Deft should only initialize the first time. Then it's ready to go.
Yeah, or instead of using
(deft)
, use(deft-cache-initialize)
. That should load the cache at startup, rather than when you launch Deft for the first time.
I put this line after (require 'deft) in my init and restarted Emacs. However, when I create a new Zetteldeft note... I see again the "deft initializing" message, taking some time.
Do you really mean every time? Deft should only initialize the first time. Then it's ready to go.
No, I stand myself corrected: just the first time when I start Emacs.
Can you share more of your init file? My guess would be that Deft loading is still somehow delayed
This is all my deft and zetteldeft config:
(require 'zetteldeft)
(require 'deft)
(deft-cache-initialize)
(setq deft-default-extension "org")
(setq deft-extensions '("org" "md" "txt"))
(setq deft-directory "~/Documents/Zettel/")
(setq deft-recursive t)
(setq deft-use-filename-as-title t)
(global-set-key [f8] 'zetteldeft-new-file)
(setq deft-new-file-format zetteldeft-id-format)
Not sure if it will make a huge difference, but you could try this order:
(require 'deft)
(setq deft-default-extension "org")
(setq deft-extensions '("org" "md" "txt"))
(setq deft-directory "~/Documents/Zettel/")
(setq deft-recursive t)
(setq deft-use-filename-as-title t)
(deft-cache-initialize)
(deft-cache-update-all)
(require 'zetteldeft)
(global-set-key [f8] 'zetteldeft-new-file)
(setq deft-new-file-format zetteldeft-id-format)
I also added deft-cache-update-all
The reordering did not work, unfortunately! Not sure what it is anymore at this stage!
Can you check which version of Zetteldeft you are using? Assuming you installed via MELPA, what's the package's date?
Thanks, it is: 20210602.841
Is there a way to start emacs with initialized zetteldeft (to avoid waiting in the first note creation)? Thanks!