Using automatic "filetags: project" hooks will sometimes trigger wrongly in org-roam-sync - I've tried so much #196
Unanswered
DominikMendel
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
I might have fixed this. Still needs further testing: (defun vulpea-project-update-tag ()
"Update PROJECT tag in the current buffer."
(when (and (not (active-minibuffer-window))
(vulpea-buffer-p))
(let ((kill-buffer-query-functions nil)) ;; Disable buffer prompts - So auto kill modified buffers from accidental tag additions
(save-excursion
(goto-char (point-min))
(let* ((tags (vulpea-buffer-tags-get))
(original-tags tags))
(if (vulpea-project-p)
(setq tags (cons "project" tags))
(setq tags (remove "project" tags)))
;; Cleanup duplicates
(setq tags (seq-uniq tags))
;; Update tags if changed
(when (or (seq-difference tags original-tags)
(seq-difference original-tags tags))
(apply #'vulpea-buffer-tags-set tags)))))))With the addition of : (let ((kill-buffer-query-functions nil)) ;; Disable buffer prompts - So auto kill modified buffers from accidental tag additions |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using this for years now : https://www.d12frosted.io/posts/2021-01-16-task-management-with-roam-vol5
And I absolutely love it. It's really core to my entire org agenda work flow.
However, I've had 1 issues I've been putting up for years. It comes and goes and enough is enough. I'm determined to try and fix it, but I seriously can't figure it out.
Problem:
Every time on Emacs startup when I need to run a
org-roam-syncI get promptedDo you want to save changes to this buffer X before closing it? (Y/N/ ...). And this happens for a TON of files. And I have to manually pressyevery time. On every startup.All of my org files are shared across multiple machines via Dropbox - hence the need to do
org-roam-syncpretty regularly.What's happening:
When
org-roam-syncoccurs, for some reason thevulpea-project-update-tag(in my casemy-update-filestagsbut near identical) get's triggered and REMOVES theprojectfiletag whenorg-roam-syncis happening, then something finishes and tries to close out all the open buffers. But now there are files with changes un them that are not saved, and ideally, I don't want these changes anyway. Theupdate-tagfunction is incorrectly removing theprojecttag. This only happens in this exact instance. I've had no other issues with theupdate-tagadding/remove theprojecttag in normal operation.Here's my configuration : https://github.com/DominikMendel/Doom-Emacs/blob/main/config.org?plain=1#L2312
Any help fixing this, a work around, or anything, would be so greatly appreciated.
I have a feeling whatever mode this function is being called is some stuff is not being set up, and I need to try and run this NOT in that mode. But I don't know what that is.
Beta Was this translation helpful? Give feedback.
All reactions