From: Andreas Gerler Date: Wed, 7 Sep 2022 16:47:35 +0000 (+0200) Subject: changes around org-agenda and org-capture X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=6655dabcb8e0531e7c537bbeefd8a5a736a3e811;p=emacsconfig.git changes around org-agenda and org-capture Signed-off-by: Andreas Gerler --- diff --git a/bba.org b/bba.org index 072c2c99..4ab5e49d 100644 --- a/bba.org +++ b/bba.org @@ -1001,26 +1001,48 @@ this is how your firefox bookmark must look like: (setq org-startup-indented 1) (if (equal "work" (getenv "SYSENV")) - (setq org-agenda-files (list "~/workorg/work.org" - "~/org/notes.org" - "~/org/emacs.org" - "~/org/private.org" - "~/org/it.org" - "~/org/refile.org" - "~/org/workhours.org" - )) - (setq org-agenda-files (list "~/org/work.org" - "~/org/notes.org" - "~/org/emacs.org" - "~/org/private.org" - "~/org/it.org" - "~/org/refile.org" - "~/org/workhours.org" - )) - ) + (setq org-agenda-files (list "~/workorg/work.org" + "~/org/todo.org" + "~/org/notes.org" + "~/org/emacs.org" + "~/org/it.org" + "~/org/refile.org")) + (setq org-agenda-files (list "~/org/work.org" + "~/org/todo.org" + "~/org/notes.org" + "~/org/emacs.org" + "~/org/it.org" + "~/org/refile.org"))) #+END_SRC +** org sync to icloud +[2022-09-07 Wed 11:11] + +With [[https://beorgapp.com][beorg]] we can have our tasks with us. +As it supports icloud drive we can use a git hook to sync files after commit: + +#+begin_src sh :eval never + #!/bin/bash + + for file in notes todo motorcycles; do + rsync -tuvq ~/org/${file}.org ~/Library/Mobile\ Documents/iCloud~com~appsonthemove~beorg/Documents/org/${file}.org + rsync -tuvq ~/Library/Mobile\ Documents/iCloud~com~appsonthemove~beorg/Documents/org/${file}.org ~/org/${file}.org + done +#+end_src + +However sometimes it's nice to sync manually as well. +Why leave Emacs for that? + +#+begin_src emacs-lisp + (defun isync () + "sync org files to and from icloud drive." + (interactive) + (save-some-buffers) + (shell-command "git --work-tree ~/org/ --git-dir ~/org/.git commit -a -m 'autocommit'")) + (define-key global-map (kbd "S-") 'isync) +#+end_src + ** org-man [2018-08-28 Tue 16:57] @@ -2072,6 +2094,8 @@ and call this function. #+END_SRC +** org-capture + #+BEGIN_SRC emacs-lisp ;; (setq org-clock-persist 'history) @@ -2081,14 +2105,13 @@ and call this function. (define-key global-map "\C-cc" 'org-capture) (setq org-capture-templates - - '(("t" "todo" entry (file+headline "~/org/refile.org" "Tasks") + '(("t" "todo" entry (file+headline "~/org/todo.org" "Tasks") "* TODO %^{Task}\n%U\n %i\n %a\n %? - ") + " :prepend t) ("m" "Meeting" entry (file "~/org/refile.org") "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t) @@ -2100,14 +2123,12 @@ and call this function. %a") ("w" "work todo" entry (file+headline "~/workorg/work.org" "Tasks") - "* TODO %^{Task}\n%U\n + "* TODO %? %^{Task}\n%U\n %i\n - %a\n - %? - ") + %a\n\n" :prepend t) - ("j" "Journal" entry (file+datetree "~/git/org/diary.org") + ("j" "Journal" entry (file+datetree "~/org/diary.org") "* %?\n%U\n" :clock-in t :clock-resume t) ("l" "Links (it)" entry (file+headline "~/org/refile.org" "Links") @@ -2116,7 +2137,6 @@ and call this function. ("C" "Cookbook" entry (file+headline "~/org/kitchen.org" "[[http://allrecipes.com][AllRecipes.com]]") "%(org-chef-get-recipe-from-url)" :empty-lines 1))) - #+END_SRC ** Define some handy link abbreviations @@ -5539,19 +5559,20 @@ Split and show workhours: #+BEGIN_SRC emacs-lisp (if (equal "work" (getenv "SYSENV")) - (progn (split-window-below) + (progn (org-agenda-list) + (split-window-right) (other-window 1) (find-file "~/org/workhours.org") (goto-char (point-min)) (org-shifttab 3) - (if (re-search-forward (concat "^\*\* "(format-time-string "%Y-%m")) nil t) - (org-beginning-of-line) - (progn - (goto-char (point-min)) - (org-next-visible-heading '1) - (org-meta-return) - (insert (format-time-string "%Y-%m")) - )) + (if (re-search-forward (concat "^\*\* "(format-time-string "%Y-%m")) nil t) + (org-beginning-of-line) + (progn + (goto-char (point-min)) + (org-next-visible-heading '1) + (org-meta-return) + (insert (format-time-string "%Y-%m")) + )) )) #+END_SRC diff --git a/custom.el b/custom.el index e6100088..5410c282 100644 --- a/custom.el +++ b/custom.el @@ -28,12 +28,8 @@ '(magit-log-margin '(t "%Y-%m-%d %H:%M " magit-log-margin-width t 18)) '(magit-pull-arguments nil) '(magit-repo-dirs '("~/git")) - '(org-agenda-files - (quote - ("~/workorg/work.org" "~/org/notes.org" "~/org/emacs.org" "~/org/it.org" "~/org/refile.org" "~/org/workhours.org"))) '(package-selected-packages - (quote - (yasnippet with-editor treepy transient simple-httpd request markdown-mode magit-popup hydra htmlize hl-todo helm git-commit f elfeed dash-functional dash clomacs clojure-mode async magit org lsp-mode git-link eglot helm-org biblio parsebib parseedn lv yaml-mode xah-lookup x-path-walker visual-regexp visual-ascii-mode vertica-snippets undo-tree twittering-mode tt-mode tldr terraform-mode tabulated-list sx string-inflection string-edit sqlup-mode sokoban smartparens sicp s3ed rhtml-mode restclient-helm rainbow-mode rainbow-delimiters puppet-mode paradox pacmacs package-lint ox-reveal ox-jira ox-clip org-tree-slide org-sticky-header org-ref org-plus-contrib org-mime org-jira org-chef org-ac ob-tmux ob-restclient ob-cfengine3 ob-async neotree mwe-log-commands mustache multiple-cursors mew magit-todos magit-gitflow langtool keyfreq json-mode impatient-mode highlight-symbol helm-swoop helm-safari helm-projectile helm-gtags helm-git helm-descbinds helm-c-yasnippet helm-aws guide-key graphql go-snippets go-mode gnuplot git-timemachine ghub ggtags fullscreen-mode fullframe flymake-yaml flymake-puppet flymake-perlcritic flymake-json flycheck fast-scroll expand-region ess epoch-view engine-mode elfeed-org ejc-sql editorconfig edit-indirect dired-narrow dired+ demo-it debian-changelog-mode csv-nav csv-mode command-log-mode color-identifiers-mode centered-cursor-mode bug-hunter aws-snippets avy ascii artbollocks-mode apples-mode ac-helm))) + '(german-holidays jenkinsfile-mode cider company seq flymake log4e annotate a magit-section bicycle beacon alert graphviz-dot-mode helm-core apache-mode groovy-mode kubel solarized-theme lsp-ui docker-tramp dockerfile-mode yasnippet with-editor treepy transient simple-httpd request markdown-mode magit-popup hydra htmlize hl-todo helm git-commit f elfeed dash-functional dash clomacs clojure-mode async magit org lsp-mode git-link eglot helm-org biblio parsebib parseedn lv yaml-mode xah-lookup x-path-walker visual-regexp visual-ascii-mode vertica-snippets undo-tree twittering-mode tt-mode tldr terraform-mode tabulated-list sx string-inflection string-edit sqlup-mode sokoban smartparens sicp s3ed rhtml-mode restclient-helm rainbow-mode rainbow-delimiters puppet-mode paradox pacmacs package-lint ox-reveal ox-jira ox-clip org-tree-slide org-sticky-header org-ref org-plus-contrib org-mime org-jira org-chef org-ac ob-tmux ob-restclient ob-cfengine3 ob-async neotree mwe-log-commands mustache multiple-cursors mew magit-todos magit-gitflow langtool keyfreq json-mode impatient-mode highlight-symbol helm-swoop helm-safari helm-projectile helm-gtags helm-git helm-descbinds helm-c-yasnippet helm-aws guide-key graphql go-snippets go-mode gnuplot git-timemachine ghub ggtags fullscreen-mode fullframe flymake-yaml flymake-puppet flymake-perlcritic flymake-json flycheck fast-scroll expand-region ess epoch-view engine-mode elfeed-org ejc-sql editorconfig edit-indirect dired-narrow dired+ demo-it debian-changelog-mode csv-nav csv-mode command-log-mode color-identifiers-mode centered-cursor-mode bug-hunter aws-snippets avy ascii artbollocks-mode apples-mode ac-helm)) '(package-user-dir "~/.emacs.d/elpa") '(paradox-github-token t) '(safe-local-variable-values (quote ((bba-keep-whitespaces . 1))))