mirror of
https://github.com/librephoenix/nixos-config
synced 2025-04-20 09:14:34 +05:30
Only add categories automatically to org files
This commit is contained in:
parent
85adc45787
commit
307d5d57cd
|
@ -902,6 +902,14 @@ tasks."
|
|||
(when
|
||||
(string-prefix-p (concat "/home/" user-username "/Org") (expand-file-name (buffer-file-name)))
|
||||
(org-set-property "CATEGORY" (substring (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")) 0 (string-match "/" (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")))))
|
||||
(when (string= (message "%s" major-mode) "org-mode")
|
||||
(when
|
||||
(string-prefix-p (concat "/home/" user-username "/Org") (expand-file-name (buffer-file-name)))
|
||||
(setq categorizer-old-line (line-number-at-pos))
|
||||
(evil-goto-first-line)
|
||||
(org-set-property "CATEGORY" (substring (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")) 0 (string-match "/" (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")))))
|
||||
(evil-goto-line categorizer-old-line)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -1055,6 +1055,14 @@ On Wayland, EAF doesn't work.
|
|||
(when
|
||||
(string-prefix-p (concat "/home/" user-username "/Org") (expand-file-name (buffer-file-name)))
|
||||
(org-set-property "CATEGORY" (substring (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")) 0 (string-match "/" (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")))))
|
||||
(when (string= (message "%s" major-mode) "org-mode")
|
||||
(when
|
||||
(string-prefix-p (concat "/home/" user-username "/Org") (expand-file-name (buffer-file-name)))
|
||||
(setq categorizer-old-line (line-number-at-pos))
|
||||
(evil-goto-first-line)
|
||||
(org-set-property "CATEGORY" (substring (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")) 0 (string-match "/" (string-trim-left (expand-file-name (buffer-file-name)) (concat "/home/" user-username "/Org/")))))
|
||||
(evil-goto-line categorizer-old-line)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue