Cumulative updates

This commit is contained in:
Max Schlueter 2023-12-21 15:33:18 +01:00
parent a6c9081861
commit 2cab09f8fe
6 changed files with 58 additions and 15 deletions

View File

@ -38,10 +38,6 @@
;; (remove-hook 'doom-switch-buffer-hook #'+org--restart-mode-h ;; (remove-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
;; 'local))) ;; 'local)))
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/Nextcloud/org/")
;; (defun max/org-gtd--incubate () ;; (defun max/org-gtd--incubate ()
;; "Process GTD inbox item by incubating it. ;; "Process GTD inbox item by incubating it.
;; Allow the user apply user-defined tags from ;; Allow the user apply user-defined tags from
@ -438,10 +434,6 @@
(after! persp-mode (after! persp-mode
(setq persp-emacsclient-init-frame-behaviour-override "main")) (setq persp-emacsclient-init-frame-behaviour-override "main"))
(map! :after org
:map org-mode-map
:localleader
"Y" #'ox-clip-image-to-clipboard)
(after! evil-snipe (after! evil-snipe
(setq evil-snipe-spillover-scope 'visible)) (setq evil-snipe-spillover-scope 'visible))
@ -477,6 +469,6 @@
(save-buffer)) (save-buffer))
;; load personal modules ;; load personal modules
(load! "email")
(load! "gtd")
(load! "org") (load! "org")
(load! "gtd")
(load! "email")

15
gtd.el
View File

@ -17,6 +17,9 @@
,(concat "* %?\n" ,(concat "* %?\n"
":PROPERTIES:\n:CREATED: %U\n:END:") :prepend t) ":PROPERTIES:\n:CREATED: %U\n:END:") :prepend t)
;; ("j" "Journal" entry (file+datetree ,(funcall #'gtd-get-current-journal)) ;; ("j" "Journal" entry (file+datetree ,(funcall #'gtd-get-current-journal))
("l" "Link" entry (file "gtd/inbox.org")
,(concat "* Process %:annotation\n"
":PROPERTIES:\n:CREATED: %U\n:END:") :prepend t)
("j" "Journal" entry (file+datetree "gtd/journal.org") ("j" "Journal" entry (file+datetree "gtd/journal.org")
,(concat "* %?\n" ,(concat "* %?\n"
":PROPERTIES:\n:CREATED: %U\n:END:")) ":PROPERTIES:\n:CREATED: %U\n:END:"))
@ -132,7 +135,19 @@ See also `org-save-all-org-buffers'"
t))) t)))
(message "Saving org-agenda-files buffers... done")) (message "Saving org-agenda-files buffers... done"))
;; TODO: use org-after-refile-insert-hook ??
(defun gtd-update-statistics-cookies ()
"Save `org-agenda-files' buffers without user confirmation.
See also `org-save-all-org-buffers'"
(interactive)
(message "Updating cookies in org-agenda-files buffers...")
(save-some-buffers t (lambda ()
(when (member (buffer-file-name) org-agenda-files)
t)))
(message "Updating cookies in org-agenda-files buffers... done"))
(after! org (after! org
;; (advice-add 'org-refile :after (lambda (&rest _) (org-update-statistics-cookies t)))
(advice-add 'org-refile :after (lambda (&rest _) (gtd-save-org-buffers))) (advice-add 'org-refile :after (lambda (&rest _) (gtd-save-org-buffers)))
(advice-add 'org-todo :after (lambda (&rest _) (gtd-save-org-buffers))) (advice-add 'org-todo :after (lambda (&rest _) (gtd-save-org-buffers)))
(advice-add 'org-add-note :after (lambda (&rest _) (gtd-save-org-buffers))) (advice-add 'org-add-note :after (lambda (&rest _) (gtd-save-org-buffers)))

View File

@ -151,7 +151,7 @@
nix ; I hereby declare "nix geht mehr!" nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel ;;ocaml ; an objective camel
(org +noter +journal +roam2 +dragndrop +pomodoro) ; organize your plain life in plain text (org +noter +journal +roam2 +dragndrop +pomodoro) ; organize your plain life in plain text
;;php ; perl's insecure younger brother php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more ;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional ;;purescript ; javascript, but functional
(python +lsp +pyright +poetry) ; beautiful is better than ugly (python +lsp +pyright +poetry) ; beautiful is better than ugly
@ -160,7 +160,7 @@
;;raku ; the artist formerly known as perl6 ;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client ;;rest ; Emacs as a REST client
;;rst ; ReST in peace ;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} (ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;; (scala +lsp) ; java, but good ;; (scala +lsp) ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps ;;(scheme +guile) ; a fully conniving family of lisps

15
org.el
View File

@ -1,5 +1,11 @@
;;; org.el -*- lexical-binding: t; -*- ;;; org.el -*- lexical-binding: t; -*-
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/Nextcloud/org/")
(require 'org)
(defun max/org-clock-get-clock-string () (defun max/org-clock-get-clock-string ()
"Form a clock string that will be shown in polybar. "Form a clock string that will be shown in polybar.
Adapted from `org-clock-get-clock-string'." Adapted from `org-clock-get-clock-string'."
@ -21,10 +27,19 @@ Adapted from `org-clock-get-clock-string'."
current-work-done-str current-work-done-str
org-clock-heading))))) org-clock-heading)))))
;; Fix org-babel shell block not inheriting envrc
;; https://github.com/purcell/envrc/issues/28
(advice-add 'org-babel-eval :around #'envrc-propagate-environment)
(after! org (after! org
;; Store org links to info pages ;; Store org links to info pages
(add-to-list 'org-modules 'ol-info)) (add-to-list 'org-modules 'ol-info))
;; C-k is mapped to ~org-element-up~ by defualt
(map! :after evil-org
:map evil-org-mode-map
:i "C-k" #'org-kill-line)
(map! :after org (map! :after org
:map org-mode-map :map org-mode-map
:localleader :localleader

View File

@ -87,7 +87,7 @@
(package! nov) (package! nov)
;; (package! org-gtd) ;; (package! org-gtd)
;; (package! weblorg) ;; (package! weblorg)
(package! evil-escape :disable t)
(package! emacs-codeql (package! emacs-codeql
:recipe (:host github :recipe (:host github
:repo "anticomputer/emacs-codeql" :repo "anticomputer/emacs-codeql"

25
roam.el
View File

@ -2,11 +2,32 @@
(after! org-roam (after! org-roam
(setq org-roam-capture-templates (setq org-roam-capture-templates
'(("d" "default" plain '(("m" "main" plain
"%?" "%?"
:target :target
(file+head (file+head
"${slug}.org" "main/${slug}.org"
"#+title: ${title}\n")
:unnarrowed t)
("c" "cheatsheet" plain
"%?"
:target
(file+head
"cheatsheet/${slug}.org"
"#+title: ${title}\n")
:unnarrowed t)
("w" "worksheet" plain
"%?"
:target
(file+head
"worksheet/${slug}.org"
"#+title: ${title}\n")
:unnarrowed t)
("p" "person" plain
"%?"
:target
(file+head
"person/${slug}.org"
"#+title: ${title}\n") "#+title: ${title}\n")
:unnarrowed t) :unnarrowed t)
("n" "literature note" plain ("n" "literature note" plain