summaryrefslogtreecommitdiff
path: root/emacs-init.org
diff options
context:
space:
mode:
authorfpi2020-10-30 19:30:25 +0100
committerfpi2022-03-17 14:44:37 +0100
commitf2a1b51d43b2861ff2a0096c6866888a2115f759 (patch)
tree658878ad7a2edd2892a3b3f007f19e9aa207dd3c /emacs-init.org
parentAdd function to clock in on a refile target (diff)
Use timestamp based ids
Diffstat (limited to 'emacs-init.org')
-rw-r--r--emacs-init.org19
1 files changed, 17 insertions, 2 deletions
diff --git a/emacs-init.org b/emacs-init.org
index 1a8fb06..0206230 100644
--- a/emacs-init.org
+++ b/emacs-init.org
@@ -3397,10 +3397,17 @@ I use a org version with some custom patches. Rather than using something like =
:straight t
:hook (org-load . org-pdftools-setup-link))
(use-package org-id
- :custom (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
+ :custom
+ (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
<<org-id-custom>>)
#+end_src
+I prefer to use timestamp based ID's as they are
+#+begin_src emacs-lisp :tangle no :noweb-ref org-id-custom
+(org-id-method 'ts)
+(org-id-ts-format "%FT%T%z")
+#+end_src
+
#+begin_src emacs-lisp
(use-package org-src
:custom
@@ -4464,10 +4471,18 @@ Org Edna
(use-package org-attach
:custom
(org-attach-use-inheritance nil)
+ (org-attach-preferred-new-method 'id)
+ (org-attach-store-link-p t)
:config
(defun fpi/org-attach-id-folder-format (id)
id)
- (add-to-list 'org-attach-id-to-path-function-list 'fpi/org-attach-id-folder-format))
+ (defun fpi/org-attach-id-ts-folder-format (id)
+ "Timestamp id converter to ids generated in the \"%FT%T%z\" format."
+ (format "%s/%s"
+ (substring id 0 7)
+ (substring id 8)))
+ (add-to-list 'org-attach-id-to-path-function-list 'fpi/org-attach-id-folder-format)
+ (add-to-list 'org-attach-id-to-path-function-list 'fpi/org-attach-id-ts-folder-format))
#+end_src
=org-attach-git= auto-commits changes to attachments if the directory
is a git repository. I want every attachments to be saved using