fix: both tags in filestags, gitignore markers, safe vars

This commit is contained in:
2026-07-17 15:13:48 -04:00
parent 3c59427c15
commit 5be49106d3
2 changed files with 24 additions and 12 deletions

View File

@@ -3321,16 +3321,17 @@ with a project-tagged custom agenda entry and optional CONTEXT-TAG (mu4e/agenda)
;; 2. Enforce text-only gitignore rules if absent ;; 2. Enforce text-only gitignore rules if absent
(unless (file-exists-p gitignore-file) (unless (file-exists-p gitignore-file)
(with-temp-file gitignore-file (with-temp-file gitignore-file
(insert "# Local Node Rule: Track text layers only\n*\n!.gitignore\n!1-Plan/\n!1-Plan/**\n!3-Notes/\n!3-Notes/**\n"))) (insert "# Local Node Rule: Track text layers only\n*\n!.gitignore\n!.projectile\n!.dir-locals.el\n!.bookmarks\n!1-Plan/\n!1-Plan/**\n!3-Notes/\n!3-Notes/**\n")))
;; 3. Build index Org block if absent ;; 3. Build index Org block if absent
(unless (file-exists-p org-file) (unless (file-exists-p org-file)
(with-temp-file org-file (with-temp-file org-file
(insert (format "#+TITLE: %s\n#+DATE: %s\n#+CATEGORY: %s\n#+FILETAGS: :%s:\n\n* Setup\nTODO %s\n\n* Bookmarks\n** Example link\n[[file:./%s.org][Example link for %s]]\n\n* Contacts\n** Contact Name\n:PROPERTIES:\n:EMAIL: contact@example.com\n:ROLE: Client / Partner\n:END:\n\n[[mu4e:from:contact@example.com][Correspondence with Contact Name]]\n\n* Tasks\n** TODO First task for %s\n" (insert (format "#+TITLE: %s\n#+DATE: %s\n#+CATEGORY: %s\n#+FILETAGS: :%s:%s:\n\n* Setup\nTODO %s\n\n* Bookmarks\n** Example link\n[[file:./%s.org][Example link for %s]]\n\n* Contacts\n** Contact Name\n:PROPERTIES:\n:EMAIL: contact@example.com\n:ROLE: Client / Partner\n:END:\n\n[[mu4e:from:contact@example.com][Correspondence with Contact Name]]\n\n* Tasks\n** TODO First task for %s\n"
node-name node-name
(format-time-string "[%Y-%m-%d %a]") (format-time-string "[%Y-%m-%d %a]")
node-name node-name
(or project-tag "project") (or project-tag "project")
(or context-tag "")
(or default-todo "Initialize project context") (or default-todo "Initialize project context")
node-name node-name
node-name node-name
@@ -3365,6 +3366,11 @@ with a project-tagged custom agenda entry and optional CONTEXT-TAG (mu4e/agenda)
(prin1 vars (current-buffer)) (prin1 vars (current-buffer))
(princ ")" (current-buffer))))))) (princ ")" (current-buffer)))))))
;; Mark these directory-local variables as safe
(put 'gortium/project-tag 'safe-local-variable #'stringp)
(put 'gortium/context-tag 'safe-local-variable #'stringp)
(put 'gortium/project-agenda-entry 'safe-local-variable #'listp)
;; 5. Unified Git Integration Loop ;; 5. Unified Git Integration Loop
(let ((default-directory node-dir)) (let ((default-directory node-dir))
(if (not git-existed-p) (if (not git-existed-p)
@@ -3391,13 +3397,13 @@ with a project-tagged custom agenda entry and optional CONTEXT-TAG (mu4e/agenda)
(defun gortium/create-node (category node-name tag context-tag) (defun gortium/create-node (category node-name tag context-tag)
"Create a brand new standardized PARA Node inside your ExoKortex vault. "Create a brand new standardized PARA Node inside your ExoKortex vault.
TAG is a short slug for agenda/email filtering (e.g. "airbus_vision"). TAG is a short slug for agenda/email filtering (e.g. 'airbus_vision').
CONTEXT-TAG is the mu4e/agenda context (e.g. "TDNDE", "Perso")." CONTEXT-TAG is the mu4e/agenda context (e.g. 'TDNDE', 'Perso')."
(interactive (interactive
(list (completing-read "Category: " '("1-Projects" "2-Areas" "3-Resources")) (list (completing-read "Category: " '("1-Projects" "2-Areas" "3-Resources"))
(read-string "Node Name: ") (read-string "Node Name: ")
(read-string "Project tag (slug for agenda/email filtering): ") (read-string "Project tag (slug for agenda/email per project filtering): ")
(completing-read "Context tag (TDNDE / Perso): " '("TDNDE" "Perso") nil t))) (read-string "Context tag (slug for agenda/email per context filtering): ")))
(let* ((category-dir (expand-file-name category gortium/exokortex-root)) (let* ((category-dir (expand-file-name category gortium/exokortex-root))
(node-dir (expand-file-name node-name category-dir)) (node-dir (expand-file-name node-name category-dir))
(org-file (gortium/ensure-node-structure node-dir (org-file (gortium/ensure-node-structure node-dir

View File

@@ -2399,16 +2399,17 @@ with a project-tagged custom agenda entry and optional CONTEXT-TAG (mu4e/agenda)
;; 2. Enforce text-only gitignore rules if absent ;; 2. Enforce text-only gitignore rules if absent
(unless (file-exists-p gitignore-file) (unless (file-exists-p gitignore-file)
(with-temp-file gitignore-file (with-temp-file gitignore-file
(insert "# Local Node Rule: Track text layers only\n*\n!.gitignore\n!1-Plan/\n!1-Plan/**\n!3-Notes/\n!3-Notes/**\n"))) (insert "# Local Node Rule: Track text layers only\n*\n!.gitignore\n!.projectile\n!.dir-locals.el\n!.bookmarks\n!1-Plan/\n!1-Plan/**\n!3-Notes/\n!3-Notes/**\n")))
;; 3. Build index Org block if absent ;; 3. Build index Org block if absent
(unless (file-exists-p org-file) (unless (file-exists-p org-file)
(with-temp-file org-file (with-temp-file org-file
(insert (format "#+TITLE: %s\n#+DATE: %s\n#+CATEGORY: %s\n#+FILETAGS: :%s:\n\n* Setup\nTODO %s\n\n* Bookmarks\n** Example link\n[[file:./%s.org][Example link for %s]]\n\n* Contacts\n** Contact Name\n:PROPERTIES:\n:EMAIL: contact@example.com\n:ROLE: Client / Partner\n:END:\n\n[[mu4e:from:contact@example.com][Correspondence with Contact Name]]\n\n* Tasks\n** TODO First task for %s\n" (insert (format "#+TITLE: %s\n#+DATE: %s\n#+CATEGORY: %s\n#+FILETAGS: :%s:%s:\n\n* Setup\nTODO %s\n\n* Bookmarks\n** Example link\n[[file:./%s.org][Example link for %s]]\n\n* Contacts\n** Contact Name\n:PROPERTIES:\n:EMAIL: contact@example.com\n:ROLE: Client / Partner\n:END:\n\n[[mu4e:from:contact@example.com][Correspondence with Contact Name]]\n\n* Tasks\n** TODO First task for %s\n"
node-name node-name
(format-time-string "[%Y-%m-%d %a]") (format-time-string "[%Y-%m-%d %a]")
node-name node-name
(or project-tag "project") (or project-tag "project")
(or context-tag "")
(or default-todo "Initialize project context") (or default-todo "Initialize project context")
node-name node-name
node-name node-name
@@ -2443,6 +2444,11 @@ with a project-tagged custom agenda entry and optional CONTEXT-TAG (mu4e/agenda)
(prin1 vars (current-buffer)) (prin1 vars (current-buffer))
(princ ")" (current-buffer))))))) (princ ")" (current-buffer)))))))
;; Mark these directory-local variables as safe
(put 'gortium/project-tag 'safe-local-variable #'stringp)
(put 'gortium/context-tag 'safe-local-variable #'stringp)
(put 'gortium/project-agenda-entry 'safe-local-variable #'listp)
;; 5. Unified Git Integration Loop ;; 5. Unified Git Integration Loop
(let ((default-directory node-dir)) (let ((default-directory node-dir))
(if (not git-existed-p) (if (not git-existed-p)
@@ -2469,13 +2475,13 @@ with a project-tagged custom agenda entry and optional CONTEXT-TAG (mu4e/agenda)
(defun gortium/create-node (category node-name tag context-tag) (defun gortium/create-node (category node-name tag context-tag)
"Create a brand new standardized PARA Node inside your ExoKortex vault. "Create a brand new standardized PARA Node inside your ExoKortex vault.
TAG is a short slug for agenda/email filtering (e.g. "airbus_vision"). TAG is a short slug for agenda/email filtering (e.g. 'airbus_vision').
CONTEXT-TAG is the mu4e/agenda context (e.g. "TDNDE", "Perso")." CONTEXT-TAG is the mu4e/agenda context (e.g. 'TDNDE', 'Perso')."
(interactive (interactive
(list (completing-read "Category: " '("1-Projects" "2-Areas" "3-Resources")) (list (completing-read "Category: " '("1-Projects" "2-Areas" "3-Resources"))
(read-string "Node Name: ") (read-string "Node Name: ")
(read-string "Project tag (slug for agenda/email filtering): ") (read-string "Project tag (slug for agenda/email per project filtering): ")
(completing-read "Context tag (TDNDE / Perso): " '("TDNDE" "Perso") nil t))) (read-string "Context tag (slug for agenda/email per context filtering): ")))
(let* ((category-dir (expand-file-name category gortium/exokortex-root)) (let* ((category-dir (expand-file-name category gortium/exokortex-root))
(node-dir (expand-file-name node-name category-dir)) (node-dir (expand-file-name node-name category-dir))
(org-file (gortium/ensure-node-structure node-dir (org-file (gortium/ensure-node-structure node-dir