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

initialized zetteldeft at start #116

Open
AtomicNess123 opened this issue Jul 13, 2021 · 11 comments
Open

initialized zetteldeft at start #116

AtomicNess123 opened this issue Jul 13, 2021 · 11 comments

Comments

@AtomicNess123
Copy link

Is there a way to start emacs with initialized zetteldeft (to avoid waiting in the first note creation)? Thanks!

@EFLS
Copy link
Owner

EFLS commented Jul 13, 2021

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?

@AtomicNess123
Copy link
Author

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".

@gklimowicz
Copy link

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?

@EFLS
Copy link
Owner

EFLS commented Jul 13, 2021

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.

@AtomicNess123
Copy link
Author

AtomicNess123 commented Jul 14, 2021

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.

@EFLS
Copy link
Owner

EFLS commented Jul 14, 2021

Can you share more of your init file? My guess would be that Deft loading is still somehow delayed

@AtomicNess123
Copy link
Author

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)

@EFLS
Copy link
Owner

EFLS commented Jul 14, 2021

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

@AtomicNess123
Copy link
Author

The reordering did not work, unfortunately! Not sure what it is anymore at this stage!

@EFLS
Copy link
Owner

EFLS commented Jul 15, 2021

Can you check which version of Zetteldeft you are using? Assuming you installed via MELPA, what's the package's date?

@AtomicNess123
Copy link
Author

Thanks, it is: 20210602.841

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

3 participants