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

[suggestion for denote manual] A way to automatically create denote silos and make them able to be managed via project.el #367

Open
alexispurslane opened this issue May 22, 2024 · 0 comments

Comments

@alexispurslane
Copy link

This is pretty cursed, in that it uses project.el-internal APIs to do this, but I'm still sharing it because a) it might be useful to someone else, and b) maybe someone will know how to make it better. Here it is:

(setq project-vc-extra-root-markers '(".dir-locals.el"))
(defun denote-silo (dir)
    "Create a new directory DIR to function as a `denote' silo and add it to the project list."
    (interactive (list (read-directory-name "Silo directory: ")))
    (if (not (make-directory dir t))
	    (progn
		(with-temp-file (file-name-concat dir ".dir-locals.el")
		    (insert (format "
;;; Directory Local Variables            -*- no-byte-compile: t -*-
;;; For more information see (info \"(emacs) Directory Variables\")
((nil . ((denote-directory . \"%s\"))))" (expand-file-name dir))))
		(add-to-list 'project--list `(,(expand-file-name dir)))
		(project--write-project-list))))
@alexispurslane alexispurslane changed the title Extremely cursed but possibly useful: a way to automatically create denote silos and make them able to be managed via project.el [suggestion for denote manual] A way to automatically create denote silos and make them able to be managed via project.el May 22, 2024
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

1 participant