Browse Source

Initial commit

master
Daniel 4 years ago
commit
2ecb388724
Signed by: dbo GPG Key ID: 4F63DB96D45AA9C6
  1. 30
      .gitignore
  2. 3
      .gitmodules
  3. 577
      abbrev_defs
  4. 1
      bbdb
  5. 1
      bookmarks
  6. 1
      custom.el
  7. 5
      eshell/alias
  8. 38
      exot-main-theme.el
  9. 657
      gnus
  10. 1657
      init.el
  11. 1
      network-security.data
  12. 1
      private
  13. 61
      site-lisp/db-emacsclient.el
  14. 837
      site-lisp/db-org.el
  15. 1
      site-lisp/db-private.el
  16. 341
      site-lisp/db-utils.el
  17. 262
      site-lisp/ical2org.el
  18. 7
      site-lisp/term/screen-256color.el
  19. 53
      snippets/latex-mode/vorlage-gutachten
  20. 1
      snippets/text-mode/.yas-parents
  21. 5
      snippets/text-mode/horg
  22. 5
      snippets/text-mode/sc
  23. 5
      snippets/text-mode/worg

30
.gitignore

@ -0,0 +1,30 @@
/.cider-history
/.mc-lists.el
/.org-id-locations
/TAGS
/auto-save-list
/eautosave/
/ebackup/
/el-get/
/elpa/
/emms/
/eshell/history
/eshell/lastdir
/image-dired/
/org-clock-save.el
/projectile-bookmarks.eld
/recentf
/savehist
/semanticdb/
/srecode-map.el
/tramp
/url/cookies
/org-clock-save.el~
/gnus.registry.eioioi
/helm-adaptive-history
/url/
/mastodon.plstore
/smex-items
/games/bubbles-default-2-10-10-scores
/games/tetris-scores
/mthesaur.txt.cache

3
.gitmodules

@ -0,0 +1,3 @@
[submodule "private"]
path = private
url = documenter:Private/repositories/emacs-private.git

577
abbrev_defs

@ -0,0 +1,577 @@
;;-*-coding: utf-8;-*-
(define-abbrev-table 'Buffer-menu-mode-abbrev-table '())
(define-abbrev-table 'Custom-mode-abbrev-table '())
(define-abbrev-table 'Info-edit-mode-abbrev-table '())
(define-abbrev-table 'Man-mode-abbrev-table '())
(define-abbrev-table 'Rd-mode-abbrev-table
'(
("`ag" "\\arguments" nil 0)
("`al" "\\alias" nil 0)
("`au" "\\author" nil 0)
("`bf" "\\bold" nil 0)
("`co" "\\code" nil 0)
("`de" "\\describe" nil 0)
("`dn" "\\description" nil 0)
("`dt" "\\details" nil 0)
("`em" "\\emph" nil 0)
("`en" "\\enumerate" nil 0)
("`ex" "\\examples" nil 0)
("`fi" "\\file" nil 0)
("`fo" "\\format" nil 0)
("`it" "\\item" nil 0)
("`iz" "\\itemize" nil 0)
("`kw" "\\keyword" nil 0)
("`li" "\\link" nil 0)
("`me" "\\method" nil 0)
("`na" "\\name" nil 0)
("`no" "\\note" nil 0)
("`re" "\\references" nil 0)
("`sa" "\\seealso" nil 0)
("`se" "\\section" nil 0)
("`so" "\\source" nil 0)
("`ss" "\\subsection" nil 0)
("`sy" "\\synopsis" nil 0)
("`ta" "\\tabular" nil 0)
("`ti" "\\title" nil 0)
("`us" "\\usage" nil 0)
("`va" "\\value" nil 0)
))
(define-abbrev-table 'TeX-error-overview-mode-abbrev-table '())
(define-abbrev-table 'TeX-output-mode-abbrev-table '())
(define-abbrev-table 'apropos-mode-abbrev-table '())
(define-abbrev-table 'awk-mode-abbrev-table '())
(define-abbrev-table 'bbdb-mode-abbrev-table '())
(define-abbrev-table 'biblio-selection-mode-abbrev-table '())
(define-abbrev-table 'bibtex-mode-abbrev-table '())
(define-abbrev-table 'bookmark-bmenu-mode-abbrev-table '())
(define-abbrev-table 'bookmark-edit-annotation-mode-abbrev-table '())
(define-abbrev-table 'bsh-script-mode-abbrev-table '())
(define-abbrev-table 'c++-mode-abbrev-table '())
(define-abbrev-table 'c-mode-abbrev-table '())
(define-abbrev-table 'calc-trail-mode-abbrev-table '())
(define-abbrev-table 'calendar-mode-abbrev-table '())
(define-abbrev-table 'change-log-mode-abbrev-table '())
(define-abbrev-table 'cider-browse-ns-mode-abbrev-table '())
(define-abbrev-table 'cider-connections-buffer-mode-abbrev-table '())
(define-abbrev-table 'cider-docview-mode-abbrev-table '())
(define-abbrev-table 'cider-inspector-mode-abbrev-table '())
(define-abbrev-table 'cider-repl-history-mode-abbrev-table '())
(define-abbrev-table 'cider-repl-mode-abbrev-table '())
(define-abbrev-table 'cider-stacktrace-mode-abbrev-table '())
(define-abbrev-table 'cider-test-report-mode-abbrev-table '())
(define-abbrev-table 'cljr--change-signature-mode-abbrev-table '())
(define-abbrev-table 'clojure-mode-abbrev-table '())
(define-abbrev-table 'clojurec-mode-abbrev-table '())
(define-abbrev-table 'clojurescript-mode-abbrev-table '())
(define-abbrev-table 'clojurex-mode-abbrev-table '())
(define-abbrev-table 'comint-mode-abbrev-table '())
(define-abbrev-table 'completion-list-mode-abbrev-table '())
(define-abbrev-table 'conf-colon-mode-abbrev-table '())
(define-abbrev-table 'conf-javaprop-mode-abbrev-table '())
(define-abbrev-table 'conf-ppd-mode-abbrev-table '())
(define-abbrev-table 'conf-space-mode-abbrev-table '())
(define-abbrev-table 'conf-unix-mode-abbrev-table '())
(define-abbrev-table 'conf-windows-mode-abbrev-table '())
(define-abbrev-table 'conf-xdefaults-mode-abbrev-table '())
(define-abbrev-table 'cperl-mode-abbrev-table
'(
("=head1" "=head1" cperl-electric-pod 0)
("=head2" "=head2" cperl-electric-pod 0)
("=over" "=over" cperl-electric-pod 0)
("=pod" "=pod" cperl-electric-pod 0)
("continue" "continue" cperl-electric-else 0)
("do" "do" cperl-electric-keyword 0)
("else" "else" cperl-electric-else 4)
("elsif" "elsif" cperl-electric-keyword 1)
("for" "for" cperl-electric-keyword 2)
("foreach" "foreach" cperl-electric-keyword 0)
("foreachmy" "foreachmy" cperl-electric-keyword 0)
("formy" "formy" cperl-electric-keyword 0)
("head1" "head1" cperl-electric-pod 0)
("head2" "head2" cperl-electric-pod 0)
("if" "if" cperl-electric-keyword 4)
("over" "over" cperl-electric-pod 0)
("pod" "pod" cperl-electric-pod 0)
("unless" "unless" cperl-electric-keyword 0)
("until" "until" cperl-electric-keyword 0)
("usedump" "use Data::Dumper qw(Dumper);" pde-abbv-no-blank 0)
("useenc" "use Encode qw(encode decode from_to);" pde-abbv-no-blank 0)
("usegtk" "use Gtk2 '-init';
use Glib qw(TRUE FALSE);
my $window = Gtk2::Window->new('toplevel');
$window->signal_connect('delete_event' => sub { Gtk2->main_quit; });" pde-abbv-no-blank 0)
("useopt" "use Getopt::Long;
GetOptions();" pde-abbv-no-blank 0)
("while" "while" cperl-electric-keyword 4)
))
(define-abbrev-table 'css-mode-abbrev-table '())
(define-abbrev-table 'data-debug-mode-abbrev-table '())
(define-abbrev-table 'debugger-mode-abbrev-table '())
(define-abbrev-table 'diary-fancy-display-mode-abbrev-table '())
(define-abbrev-table 'diary-mode-abbrev-table '())
(define-abbrev-table 'diff-mode-abbrev-table '())
(define-abbrev-table 'dig-mode-abbrev-table '())
(define-abbrev-table 'direx:direx-mode-abbrev-table '())
(define-abbrev-table 'display-time-world-mode-abbrev-table '())
(define-abbrev-table 'doctex-mode-abbrev-table '())
(define-abbrev-table 'dsssl-mode-abbrev-table '())
(define-abbrev-table 'edebug-eval-mode-abbrev-table '())
(define-abbrev-table 'edit-abbrevs-mode-abbrev-table '())
(define-abbrev-table 'edit-list-mode-abbrev-table '())
(define-abbrev-table 'elisp-byte-code-mode-abbrev-table '())
(define-abbrev-table 'elpy-refactor-mode-abbrev-table '())
(define-abbrev-table 'emacs-lisp-byte-code-mode-abbrev-table '())
(define-abbrev-table 'emacs-lisp-mode-abbrev-table '())
(define-abbrev-table 'emms-lyrics-mode-abbrev-table '())
(define-abbrev-table 'emms-show-all-mode-abbrev-table '())
(define-abbrev-table 'emms-tag-editor-mode-abbrev-table '())
(define-abbrev-table 'epa-info-mode-abbrev-table '())
(define-abbrev-table 'epa-key-list-mode-abbrev-table '())
(define-abbrev-table 'epa-key-mode-abbrev-table '())
(define-abbrev-table 'ert-results-mode-abbrev-table '())
(define-abbrev-table 'ert-simple-view-mode-abbrev-table '())
(define-abbrev-table 'eshell-mode-abbrev-table '())
(define-abbrev-table 'ess-julia-mode-abbrev-table '())
(define-abbrev-table 'finder-mode-abbrev-table '())
(define-abbrev-table 'flycheck-error-list-mode-abbrev-table '())
(define-abbrev-table 'ftp-mode-abbrev-table '())
(define-abbrev-table 'fundamental-mode-abbrev-table '())
(define-abbrev-table 'gap-mode-abbrev-table '())
(define-abbrev-table 'gap-process-mode-abbrev-table '())
(define-abbrev-table 'gdb-script-mode-abbrev-table '())
(define-abbrev-table 'geiser-messages-mode-abbrev-table '())
(define-abbrev-table 'geiser-repl-mode-abbrev-table '())
(define-abbrev-table 'gfm-mode-abbrev-table '())
(define-abbrev-table 'git-commit-mode-abbrev-table '())
(define-abbrev-table 'git-rebase-mode-abbrev-table '())
(define-abbrev-table 'global-abbrev-table
'(
("brd" "Best regards,
Daniel" nil 6)
("brdb" "Best regards,
Daniel Borchmann" nil 0)
("btw" "by the way" nil 4)
("wrt" "with respect to" nil 1)
))
(define-abbrev-table 'gnus-article-edit-mode-abbrev-table '())
(define-abbrev-table 'gnus-article-mode-abbrev-table '())
(define-abbrev-table 'gnus-browse-mode-abbrev-table '())
(define-abbrev-table 'gnus-category-mode-abbrev-table '())
(define-abbrev-table 'gnus-custom-mode-abbrev-table '())
(define-abbrev-table 'gnus-edit-form-mode-abbrev-table '())
(define-abbrev-table 'gnus-group-mode-abbrev-table '())
(define-abbrev-table 'gnus-score-mode-abbrev-table '())
(define-abbrev-table 'gnus-sticky-article-mode-abbrev-table '())
(define-abbrev-table 'google-maps-static-mode-abbrev-table '())
(define-abbrev-table 'grep-mode-abbrev-table '())
(define-abbrev-table 'gud-mode-abbrev-table '())
(define-abbrev-table 'haskell-cabal-mode-abbrev-table '())
(define-abbrev-table 'haskell-compilation-mode-abbrev-table '())
(define-abbrev-table 'haskell-debug-mode-abbrev-table '())
(define-abbrev-table 'haskell-error-mode-abbrev-table '())
(define-abbrev-table 'haskell-interactive-mode-abbrev-table '())
(define-abbrev-table 'haskell-mode-abbrev-table '())
(define-abbrev-table 'haskell-presentation-mode-abbrev-table '())
(define-abbrev-table 'helm-grep-mode-abbrev-table '())
(define-abbrev-table 'helm-major-mode-abbrev-table '())
(define-abbrev-table 'helm-moccur-mode-abbrev-table '())
(define-abbrev-table 'help-mode-abbrev-table '())
(define-abbrev-table 'html-mode-abbrev-table '())
(define-abbrev-table 'hy-mode-abbrev-table '())
(define-abbrev-table 'ibuffer-mode-abbrev-table '())
(define-abbrev-table 'idl-mode-abbrev-table '())
(define-abbrev-table 'image-dired-display-image-mode-abbrev-table '())
(define-abbrev-table 'image-dired-thumbnail-mode-abbrev-table '())
(define-abbrev-table 'imenu-tree-mode-abbrev-table '())
(define-abbrev-table 'inf-perl-mode-abbrev-table '())
(define-abbrev-table 'inferior-emacs-lisp-mode-abbrev-table '())
(define-abbrev-table 'inferior-haskell-mode-abbrev-table '())
(define-abbrev-table 'inferior-julia-mode-abbrev-table '())
(define-abbrev-table 'inferior-lisp-mode-abbrev-table '())
(define-abbrev-table 'inferior-python-mode-abbrev-table '())
(define-abbrev-table 'inferior-scheme-mode-abbrev-table '())
(define-abbrev-table 'ivy-occur-grep-mode-abbrev-table '())
(define-abbrev-table 'ivy-occur-mode-abbrev-table '())
(define-abbrev-table 'java-mode-abbrev-table '())
(define-abbrev-table 'jde-mode-abbrev-table
'(
("catch" "catch" c-electric-continued-statement 0)
("else" "else" c-electric-continued-statement 0)
("finally" "finally" c-electric-continued-statement 0)
("while" "while" c-electric-continued-statement 0)
))
(define-abbrev-table 'jde-run-mode-abbrev-table '())
(define-abbrev-table 'julia-mode-abbrev-table '())
(define-abbrev-table 'latex-mode-abbrev-table
'(
("sqc" "sqcap" nil 2)
("sqse" "sqsubseteq" nil 1)
("sqsn" "sqsubsetneq" nil 0)
))
(define-abbrev-table 'lisp-mode-abbrev-table '())
(define-abbrev-table 'literate-haskell-mode-abbrev-table '())
(define-abbrev-table 'locate-mode-abbrev-table '())
(define-abbrev-table 'log-edit-mode-abbrev-table '())
(define-abbrev-table 'magit-annex-list-mode-abbrev-table '())
(define-abbrev-table 'magit-annex-unused-mode-abbrev-table '())
(define-abbrev-table 'magit-branch-manager-mode-abbrev-table '())
(define-abbrev-table 'magit-cherry-mode-abbrev-table '())
(define-abbrev-table 'magit-commit-mode-abbrev-table '())
(define-abbrev-table 'magit-diff-mode-abbrev-table '())
(define-abbrev-table 'magit-log-mode-abbrev-table '())
(define-abbrev-table 'magit-log-select-mode-abbrev-table '())
(define-abbrev-table 'magit-merge-preview-mode-abbrev-table '())
(define-abbrev-table 'magit-mode-abbrev-table '())
(define-abbrev-table 'magit-popup-mode-abbrev-table '())
(define-abbrev-table 'magit-process-mode-abbrev-table '())
(define-abbrev-table 'magit-reflog-mode-abbrev-table '())
(define-abbrev-table 'magit-refs-mode-abbrev-table '())
(define-abbrev-table 'magit-repolist-mode-abbrev-table '())
(define-abbrev-table 'magit-revision-mode-abbrev-table '())
(define-abbrev-table 'magit-stash-mode-abbrev-table '())
(define-abbrev-table 'magit-stashes-mode-abbrev-table '())
(define-abbrev-table 'magit-status-mode-abbrev-table '())
(define-abbrev-table 'magit-submodule-list-mode-abbrev-table '())
(define-abbrev-table 'magit-wazzup-mode-abbrev-table '())
(define-abbrev-table 'mail-abbrevs
'(
))
(define-abbrev-table 'markdown-mode-abbrev-table '())
(define-abbrev-table 'message-mode-abbrev-table
'(
("bd" "Best,
Daniel" nil 54)
("bdb" "Best,
Daniel Borchmann" nil 0)
("bgd" "Beste Grüße,
Daniel" nil 0)
("bgdb" "Beste Grüße,
Daniel Borchmann" nil 9)
("lg" "Liebe Grüße,
Daniel" nil 18)
("mbg" "Mit besten Grüßen,
Daniel Borchmann" nil 0)
("vgd" "Viele Grüße,
Daniel" nil 6)
("vgdb" "Viele Grüße,
Daniel Borchmann" nil 2)
))
(define-abbrev-table 'messages-buffer-mode-abbrev-table '())
(define-abbrev-table 'net-utils-mode-abbrev-table '())
(define-abbrev-table 'network-connection-mode-abbrev-table '())
(define-abbrev-table 'notmuch-hello-mode-abbrev-table '())
(define-abbrev-table 'notmuch-message-mode-abbrev-table '())
(define-abbrev-table 'notmuch-search-mode-abbrev-table '())
(define-abbrev-table 'notmuch-show-mode-abbrev-table '())
(define-abbrev-table 'notmuch-tree-mode-abbrev-table '())
(define-abbrev-table 'nrepl-connections-buffer-mode-abbrev-table '())
(define-abbrev-table 'nrepl-messages-mode-abbrev-table '())
(define-abbrev-table 'nrepl-mode-abbrev-table '())
(define-abbrev-table 'nslookup-mode-abbrev-table '())
(define-abbrev-table 'nxml-mode-abbrev-table '())
(define-abbrev-table 'objc-mode-abbrev-table '())
(define-abbrev-table 'occur-edit-mode-abbrev-table '())
(define-abbrev-table 'occur-mode-abbrev-table '())
(define-abbrev-table 'org-export-stack-mode-abbrev-table '())
(define-abbrev-table 'org-mode-abbrev-table '())
(define-abbrev-table 'outline-mode-abbrev-table '())
(define-abbrev-table 'package-menu-mode-abbrev-table '())
(define-abbrev-table 'pdf-annot-list-mode-abbrev-table '())
(define-abbrev-table 'pdf-occur-buffer-mode-abbrev-table '())
(define-abbrev-table 'pdf-outline-buffer-mode-abbrev-table '())
(define-abbrev-table 'perl-mode-abbrev-table '())
(define-abbrev-table 'perldoc-mode-abbrev-table '())
(define-abbrev-table 'pike-mode-abbrev-table '())
(define-abbrev-table 'plain-tex-mode-abbrev-table '())
(define-abbrev-table 'process-menu-mode-abbrev-table '())
(define-abbrev-table 'prog-mode-abbrev-table '())
(define-abbrev-table 'python-mode-abbrev-table '())
(define-abbrev-table 'python-mode-skeleton-abbrev-table
'(
))
(define-abbrev-table 'reb-lisp-mode-abbrev-table '())
(define-abbrev-table 'reb-mode-abbrev-table '())
(define-abbrev-table 'reftex-select-bib-mode-abbrev-table '())
(define-abbrev-table 'reftex-select-label-mode-abbrev-table '())
(define-abbrev-table 'ruby-mode-abbrev-table '())
(define-abbrev-table 'scheme-mode-abbrev-table '())
(define-abbrev-table 'select-tags-table-mode-abbrev-table '())
(define-abbrev-table 'sepia-cpan-mode-abbrev-table '())
(define-abbrev-table 'sepia-mode-abbrev-table '())
(define-abbrev-table 'sepia-repl-mode-abbrev-table '())
(define-abbrev-table 'sepia-scratchpad-mode-abbrev-table '())
(define-abbrev-table 'sgml-mode-abbrev-table '())
(define-abbrev-table 'sh-mode-abbrev-table '())
(define-abbrev-table 'shell-mode-abbrev-table '())
(define-abbrev-table 'sldb-mode-abbrev-table '())
(define-abbrev-table 'slime-compiler-notes-mode-abbrev-table '())
(define-abbrev-table 'slime-connection-list-mode-abbrev-table '())
(define-abbrev-table 'slime-fuzzy-completions-mode-abbrev-table '())
(define-abbrev-table 'slime-inspector-mode-abbrev-table '())
(define-abbrev-table 'slime-thread-control-mode-abbrev-table '())
(define-abbrev-table 'slime-trace-dialog--detail-mode-abbrev-table '())
(define-abbrev-table 'slime-trace-dialog-mode-abbrev-table '())
(define-abbrev-table 'slime-xref-mode-abbrev-table '())
(define-abbrev-table 'slitex-mode-abbrev-table '())
(define-abbrev-table 'smbclient-mode-abbrev-table '())
(define-abbrev-table 'smime-mode-abbrev-table '())
(define-abbrev-table 'snippet-mode-abbrev-table '())
(define-abbrev-table 'special-mode-abbrev-table '())
(define-abbrev-table 'speedbar-mode-abbrev-table '())
(define-abbrev-table 'synonyms-mode-abbrev-table '())
(define-abbrev-table 'tablist-mode-abbrev-table '())
(define-abbrev-table 'tabulated-list-mode-abbrev-table '())
(define-abbrev-table 'tar-mode-abbrev-table '())
(define-abbrev-table 'telnet-mode-abbrev-table '())
(define-abbrev-table 'term-mode-abbrev-table '())
(define-abbrev-table 'tex-mode-abbrev-table '())
(define-abbrev-table 'tex-shell-abbrev-table '())
(define-abbrev-table 'text-mode-abbrev-table '())
(define-abbrev-table 'tree-mode-abbrev-table '())
(define-abbrev-table 'url-cookie-mode-abbrev-table '())
(define-abbrev-table 'vc-git-log-edit-mode-abbrev-table '())
(define-abbrev-table 'vc-git-log-view-mode-abbrev-table '())
(define-abbrev-table 'vc-git-region-history-mode-abbrev-table '())
(define-abbrev-table 'xref--xref-buffer-mode-abbrev-table '())

1
bbdb

@ -0,0 +1 @@
private/bbdb

1
bookmarks

@ -0,0 +1 @@
private/bookmarks

1
custom.el

@ -0,0 +1 @@
private/custom.el

5
eshell/alias

@ -0,0 +1,5 @@
alias ff find-file-other-window $1
alias d dired-other-window $1
alias la ls -al $*
alias ll ls -l $*
alias l ls -1

38
exot-main-theme.el

@ -0,0 +1,38 @@
(deftheme exot-main
"Created 2017-03-17.")
(custom-theme-set-faces
'exot-main
'(aw-leading-char-face ((t (:foreground "red" :height 1.0))))
'(cursor ((t (:background "red" :foreground "#002b36" :inverse-video t :weight ultra-bold))))
'(emms-browser-artist-face ((t (:foreground "RoyalBlue1"))))
'(emms-browser-composer-face ((t (:foreground "RoyalBlue1"))))
'(emms-browser-performer-face ((t (:foreground "#aaaaff"))))
'(emms-browser-track-face ((t (:foreground "DodgerBlue3" :height 1.0))))
'(emms-playlist-selected-face ((t (:foreground "medium sea green"))))
'(org-agenda-date ((t (:background "#002b36" :foreground "#586e75" :inverse-video nil :box (:line-width 2 :color "#002b36") :overline nil :slant normal :weight bold :height 1.2))))
'(org-agenda-dimmed-todo-face ((t nil)))
'(org-agenda-structure ((t (:foreground "#93a1a1" :inverse-video nil :box (:line-width 2 :color "#002b36") :underline nil :slant normal :weight bold :height 1.1))))
'(org-clock-overlay ((t (:background "black"))))
'(org-column ((t (:strike-through nil :underline nil :slant normal :weight normal :height 110 :family "DejaVu Sans Mono"))))
'(org-headline-done ((t (:foreground "#859900"))))
'(org-level-1 ((t (:inherit default :foreground "#cb4b16" :height 1.0))))
'(org-level-2 ((t (:inherit default :foreground "#859900" :height 1.0))))
'(org-level-3 ((t (:inherit default :foreground "#268bd2" :height 1.0))))
'(org-level-4 ((t (:inherit default :foreground "#b58900" :height 1.0))))
'(org-level-5 ((t (:inherit default :foreground "#2aa198" :height 1.0))))
'(org-warning ((t (:foreground "#dc322f" :weight normal))))
'(outline-4 ((t (:inherit org-level-4))))
'(flyspell-duplicate ((t (:underline (:color "orange red" :style wave)))))
'(flyspell-incorrect ((t (:underline (:color "orange red" :style wave)))))
'(gnus-group-mail-2 ((t (:inherit outline-4 :weight normal))))
'(gnus-group-mail-3 ((t (:inherit gnus-group-mail-3-empty :weight normal))))
'(gnus-group-news-3 ((t (:inherit outline-5 :weight normal))))
'(gnus-summary-high-ancient ((t (:foreground "#268bd2" :weight normal))))
'(gnus-summary-high-read ((t (:foreground "#859900" :weight normal))))
'(gnus-summary-high-unread ((t (:foreground "#839496" :weight normal))))
'(gnus-summary-low-ancient ((t (:foreground "dim gray"))))
'(gnus-summary-low-unread ((t (:foreground "dim gray"))))
'(default ((t (:height 108)))))
(provide-theme 'exot-main)

657
gnus

@ -0,0 +1,657 @@
;;; gnus --- Daniel's Gnus Configuration
;;; Commentary:
;; Sources:
;; - http://page.math.tu-berlin.de/~freundt/.gnus
;; - Formatting from http://www.emacswiki.org/emacs/GnusFormatting, Version 3
;; - http://www.emacswiki.org/emacs/GnusDemon
;; - http://people.irisa.fr/Nicolas.Berthier/file:.gnus.el
;;; Code:
;;; General
;; Requires
(require 'gnus)
(require 'message)
(require 'gnus-util)
(require 'gnus-start)
(require 'gnus-group)
(require 'gnus-sum)
(require 'gnus-art)
(require 'gnus-score)
(require 'nntp)
(require 'gnus-agent)
(require 'nnml)
(require 'gnus-async)
;; Debugging
(setq gnus-verbose 10)
;; Accounts
(setq-default message-dont-reply-to-names
(regexp-opt (list db/personal-mail-address db/work-mail-address)
'words))
(setq gnus-select-method '(nnnil "")
gnus-secondary-select-methods
`((nntp "dfn"
(nntp-open-connection-function nntp-open-tls-stream)
(nntp-port-number 563)
(nntp-address "news.cis.dfn.de"))
(nntp "gmane"
(nntp-open-connection-function nntp-open-tls-stream)
(nntp-port-number 563)
(nntp-address "news.gmane.org"))
(nnimap "tu"
(nnimap-stream shell)
(nnimap-shell-program "/usr/lib/dovecot/imap -o mail_location=maildir:$HOME/Mail/zih")
(nnimap-inbox "INBOX")
(nnimap-split-methods nnimap-split-fancy)
(nnimap-split-fancy ,db/work-gnus-filter-rules))
(nnimap "algebra20"
(nnimap-stream shell)
(nnimap-shell-program "/usr/lib/dovecot/imap -o mail_location=maildir:$HOME/Mail/algebra20")
(nnimap-split-methods nnimap-split-fancy)
(nnimap-inbox "INBOX")
(nnimap-split-fancy ,db/personal-gnus-filter-rules))
(nnml ""
(nnmail-split-methods nnmail-split-fancy)
(nnmail-split-fancy
(| ("subject" ".*Tiger Auditing Report for.*" "mail.tiger")
"mail.misc")))
(nnmaildir "archive"
(directory "~/Mail/archive/")
(directory-files nnheader-directory-files-safe)
(nnir-search-engine notmuch)
(nnir-notmuch-remove-prefix ,(expand-file-name "~/Mail/archive/")))))
;; General Configuration
(setq gnus-ignored-from-addresses message-dont-reply-to-names
message-directory (expand-file-name "mail/" gnus-directory)
nnmail-message-id-cache-file (expand-file-name ".nnmail-cache" gnus-directory)
nnml-directory message-directory
mail-sources '((file))
mail-source-delete-incoming t
nntp-nov-is-evil t
gnus-asynchronous t
gnus-save-killed-list nil
gnus-save-newsrc-file nil
gnus-read-newsrc-file nil
gnus-check-new-newsgroups nil
gnus-use-cache 'passive
gnus-read-active-file 'some
gnus-build-sparse-threads 'some
gnus-subscribe-newsgroup-method 'gnus-subscribe-killed
gnus-group-list-inactive-groups nil
gnus-suppress-duplicates nil
gnus-large-newsgroup 200
nnmail-expiry-wait 7
nnmail-cache-accepted-message-ids t
gnus-summary-next-group-on-exit nil
gnus-use-full-window nil
gnus-always-force-window-configuration t
gnus-fetch-old-headers nil)
(setq gnus-visible-headers (regexp-opt '("From:"
"Newsgroups:"
"Subject:"
"Date:"
"Followup-To:"
"Reply-To:"
"Organization:"
"Summary:"
"Keywords:"
"Mail-Copies-To:"
"To:"
"Cc:"
"BCC:"
"X-Newsreader:"
"X-Mailer:"
"X-Sent:"
"Posted-To:"
"Mail-Copies-To:"
"Apparently-To:"
"Gnus-Warning:"
"Resent-From:"
"gpg-key-ID:"
"fingerprint:"
"X-Jabber-ID:"
"User-Agent:")))
(defadvice gnus-group-mail (before inhibit-no-argument activate)
(unless (ad-get-arg 0)
(ad-set-arg 0 1)))
(remove-hook 'gnus-mark-article-hook
'gnus-summary-mark-read-and-unread-as-read)
(add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read)
(add-hook 'kill-emacs-hook
#'(lambda ()
(interactive)
(when (get-buffer "*Group*")
(gnus-group-exit))))
(bind-key "q" #'gnus-summary-expand-window gnus-article-mode-map)
;;; Appearence
(setq gnus-group-line-format "%S%p%P%5y(%2i):%B%(%-70g%)
"
gnus-auto-select-first nil
gnus-auto-select-next nil)
(setq gnus-summary-line-format "%U%O%R%6k %(%&user-date; %-13,13f %B%s%)\n"
gnus-thread-sort-functions '(gnus-thread-sort-by-most-recent-date)
gnus-subthread-sort-functions '(gnus-thread-sort-by-date)
gnus-thread-hide-subtree t
gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
gnus-sum-thread-tree-indent " "
gnus-sum-thread-tree-root "● "
gnus-sum-thread-tree-false-root "◎ "
gnus-sum-thread-tree-single-indent "◯ "
gnus-sum-thread-tree-single-leaf "╰► "
gnus-sum-thread-tree-leaf-with-other "├► "
gnus-sum-thread-tree-vertical "│"
gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references
;; Yay (seen here: `https://github.com/cofi/dotfiles/blob/master/gnus.el')
gnus-ancient-mark ?✓
;; gnus-cached-mark ?☍
gnus-canceled-mark ?↗
gnus-del-mark ?✗
;; gnus-dormant-mark ?⚐
gnus-expirable-mark ?♻
gnus-forwarded-mark ?↪
;; gnus-killed-mark ?☠
;; gnus-process-mark ?⚙
gnus-read-mark ?✓
gnus-recent-mark ?✩
gnus-replied-mark ?↺
gnus-unread-mark ?✉
;; gnus-unseen-mark ?★
;; gnus-ticked-mark ?⚑
)
;; we need to do some magic as otherwise the agent does not delete articles from
;; its .overview when we move them around
(defadvice gnus-summary-move-article (around
no-cancel-mark
(&optional n to-newsgroup
select-method action)
activate)
(let ((articles (gnus-summary-work-articles n))
(return ad-do-it))
(when (or (null action)
(eq action 'move))
(dolist (article articles)
(gnus-summary-mark-article article gnus-expirable-mark)))
return))
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(setq gnus-treat-hide-boring-headers 'head
gnus-treat-strip-multiple-blank-lines nil
gnus-treat-display-smileys t
gnus-treat-emphasize 'head
gnus-treat-unsplit-urls t)
;;; Adaptive Scoring
(setq gnus-use-scoring nil
gnus-use-adaptive-scoring nil
gnus-adaptive-word-length-limit 5
gnus-adaptive-word-no-group-words t
gnus-default-adaptive-score-alist
'((gnus-unread-mark)
(gnus-ticked-mark (from 4))
(gnus-dormant-mark (from 5))
(gnus-del-mark (from -4) (subject -1))
(gnus-read-mark (from 4) (subject 2))
(gnus-expirable-mark (from -1) (subject -1))
(gnus-killed-mark (from -1) (subject -3))
(gnus-kill-file-mark)
(gnus-ancient-mark)
(gnus-low-score-mark)
(gnus-catchup-mark (from -1) (subject -1))))
(setq-default gnus-summary-mark-below nil)
(setq gnus-parameters
'(("^nnimap.*"
(gnus-use-scoring nil))
("^nnimap.*:lists.*"
(gnus-use-scoring t)
(gnus-use-adaptive-scoring '(word line)))
("^nntp.*"
(gnus-use-scoring nil)
(gnus-summary-mark-below -1000)
(gnus-use-adaptive-scoring '(word line)))))
(add-hook 'gnus-summary-exit-hook
'gnus-summary-bubble-group)
;;; Gnus Registry
(require 'gnus-registry)
(setq gnus-registry-split-strategy 'majority
gnus-registry-ignored-groups '(("^nntp" t)
("^nnfolder" t)
("^nnir" t)
("^nnmaildir" t)
("INBOX$" t))
gnus-registry-max-entries nil
gnus-registry-track-extra '(sender subject recipient)
gnus-registry-cache-file (expand-file-name "gnus.registry.eioioi"
emacs-d))
(setq gnus-refer-article-method
'(current (nnregistry)))
(gnus-registry-initialize)
;;; MIME
(use-package dash
:demand t
:ensure t)
(add-to-list 'gnus-boring-article-headers 'long-to)
(setq gnus-ignored-mime-types '("text/x-vcard")
mm-discouraged-alternatives '("text/richtext" "text/html")
mm-automatic-display (-difference mm-automatic-display
'("text/html"
"text/enriched"
"text/richtext"))
message-forward-as-mime t
gnus-inhibit-mime-unbuttonizing nil
gnus-buttonized-mime-types '("multipart/signed" "multipart/encrypted")
gnus-inhibit-images t)
(setq message-citation-line-function
(lambda ()
(when message-reply-headers
(insert "ghItlhpu' "(mail-header-from message-reply-headers) ":")
(newline))))
(use-package mm-decode
:config (progn
;; Tells Gnus to inline the part
(add-to-list 'mm-inlined-types "application/pgp$")
;; Tells Gnus how to display the part when it is requested
(add-to-list 'mm-inline-media-tests
'("application/pgp$" mm-inline-text identity))
;; Tell Gnus not to wait for a request, just display the thing
;; straight away.
(add-to-list 'mm-automatic-display "application/pgp$")
(setq mm-text-html-renderer 'shr)))
;;; Signing and Encryption
(setq mm-encrypt-option nil
mm-sign-option nil
mm-decrypt-option 'known
mm-verify-option 'known
mml-smime-use 'epg
;;mml2015-encrypt-to-self t
mml2015-display-key-image nil
gnus-message-replysign t
gnus-message-replyencrypt t
gnus-message-replysignencrypted t
mml-secure-cache-passphrase nil
mml-smime-cache-passphrase nil)
;; Automatic encryption if all necessary keys are present
(require 'mail-extr)
(defun db/public-key (address &optional method)
"Return valid public keys for ADDRESS and given METHOD.
METHOD can be \"smime\" or \"pgpmime\"; defaults to \"pgpmime\".
ADDRESS is a string containing exactly one email address."
(check-type address string)
(unless method (setq method "pgpmime"))
(epg-list-keys (epg-make-context
(cond
((string= method "smime")
'CMS)
((string= method "pgpmime")
'OpenPGP)
(t (error "Unknown method %s" method))))
address))
(defun db/encryption-possible-p (recipients method)
"Check whether sending encrypted emails to all RECIPIENTS is possible.
METHOD specifies the encrypt method used. Can be either
\"smime\" or \"pgpmime\"."
(every (lambda (recipient)
(not (null (db/public-key recipient method))))
recipients))
(defun db/message-recipients ()
"Return all recipients of the email in the current buffer."
(cl-mapcan (lambda (field)
(let ((field-value (message-field-value field)))
(when field-value
(mapcar #'cadr
(mail-extract-address-components field-value t)))))
(list "to" "cc" "bcc")))
(defun db/signencrypt-message-when-possible ()
"Add mml markers for signing and encryption of an email if possible."
(interactive)
(when (eq major-mode 'message-mode)
(let ((from (message-field-value "from")))
(when from
(let ((methods (if (string-match "@tu-dresden\.de>" from)
(list "smime" "pgpmime")
(list "pgpmime" "smime")))
(recipients (db/message-recipients)))
;; if there is no recipient, encrypt with default method
(if (null recipients)
(mml-secure-message (first methods) 'signencrypt)
;; go through available keys
(let ((available-method
(cl-find-if (lambda (method)
(db/encryption-possible-p recipients method))
methods)))
(if available-method
(mml-secure-message available-method 'signencrypt)
;; if nothing works, sign with default method
(mml-secure-message (first methods) 'sign)))))))))
(add-hook 'gnus-message-setup-hook
#'db/signencrypt-message-when-possible)
;; inspired by https://www.emacswiki.org/emacs/ExtendSMIME
(use-package ldap
:config (progn
(setq ldap-default-host "")
(setq ldap-default-base "O=DFN-Verein,C=DE"
ldap-ldapsearch-args '("-x" "-tt" "-H ldaps://ldap.pca.dfn.de"))))
(defun db/lookup-smime-key (mail)
"Look up `MAIL' on ldap-server of the DFN.
If found, imports the certificate via gpgsm."
(interactive "sMail: ")
(when (get-buffer " *ldap-value*")
(kill-buffer " *ldap-value*"))
(ldap-search (format "(mail=%s)" mail))
(let ((bufval (get-buffer " *ldap-value*")))
(when bufval
(with-current-buffer bufval
(save-restriction
(widen) ; just to be sure
(let ((result (call-process-region (point-min) (point-max)
"gpgsm"
nil nil nil
"--import")))
(if (zerop result)
(message "Successfully imported certificate for <%s>" mail)
(error "Could not import certificate for <%s>" mail))))))))
;; Fix
(defun mm-view-pkcs7-verify (handle)
(let ((verified nil))
(with-temp-buffer
(if (eq mml-smime-use 'epg)
;; Use gpgsm
(progn
(insert-buffer-substring (mm-handle-buffer handle))
(setq verified (epg-verify-string (epg-make-context 'CMS)
(base64-decode-string (buffer-string)))))
;; FIXME: insert valid signature
;; use openssl
(progn
(insert "MIME-Version: 1.0\n")
(mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
(insert-buffer-substring (mm-handle-buffer handle))
(setq verified (smime-verify-region (point-min) (point-max))))))
(goto-char (point-min))
(mm-insert-part handle)
(if (search-forward "Content-Type: " nil t)
(delete-region (point-min) (match-beginning 0)))
(goto-char (point-max))
(if (re-search-backward "--\r?\n?" nil t)
(delete-region (match-end 0) (point-max)))
(unless verified
(insert-buffer-substring smime-details-buffer)))
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(replace-match "\n"))
t)
;;; Custom commands
(bind-key "v u"
'(lambda ()
(interactive)
(save-mark-and-excursion
(when (gnus-topic-select-group)
(gnus-summary-exit))))
gnus-group-mode-map)
(bind-key "v j"
'(lambda ()
(interactive)
(gnus-agent-toggle-plugged nil)
(gnus-agent-toggle-plugged t)
(gnus-group-get-new-news 3))
gnus-group-mode-map)
(add-hook 'gnus-get-new-news-hook
(lambda ()
(when gnus-plugged
(gnus-agent-toggle-plugged nil)
(gnus-agent-toggle-plugged t))))
;; (bind-key "v g" #'db/get-mail gnus-group-mode-map)
(bind-key "v c"
(lambda ()
(interactive)
(save-mark-and-excursion
(gnus-topic-jump-to-topic "News")
(gnus-topic-read-group)))
gnus-group-mode-map)
(defun db/gnus-summary-open-Link ()
"Open link named \"Link\" in current article."
(interactive)
(save-window-excursion
(save-mark-and-excursion
(save-restriction
(widen)
(let ((url nil))
(unless (eq major-mode 'gnus-article-mode)
(gnus-summary-select-article-buffer))
(goto-char (point-min))
(while (and (not url)
(search-forward "Link"))
(backward-char)
(setq url (get-text-property (point) 'shr-url)))
(when url
(browse-url url)))))))
(bind-key "C-<return>" #'db/gnus-summary-open-Link gnus-summary-mode-map)
(bind-key "C-<return>" #'db/gnus-summary-open-Link gnus-article-mode-map)
;;; Timeout for fetching news
(setq nntp-connection-timeout nil)
;;; Agents
(setq gnus-agent-mark-unread-after-downloaded nil
gnus-agent-synchronize-flags t
gnus-agent-go-online t)
;;; Do some pretty printing before saving the newsrc file
(defun db/gnus-save-newsrc-with-whitespace-1 ()
"Save ~/.newsrc.eld with extra whitespace."
;; http://ding.gnus.narkive.com/pq3Z8ZjQ/pretty-printing-newsrc-eld#post3
(gnus-message 5 "Adding whitespace to .newsrc.eld")
(save-excursion
(goto-char (point-min))
(while (re-search-forward "(\\\"\\| ((\\| (nn" nil t)
(replace-match "\n \\&" t))
(delete-trailing-whitespace)))
(add-hook 'gnus-save-quick-newsrc-hook #'db/gnus-save-newsrc-with-whitespace-1)
;;; Mail Formatting
(setq gnus-posting-styles
`((".*"
(name ,user-full-name)
(address ,db/work-mail-address)
(signature-file "~/.signature-minimal")
("X-Jabber-ID" ,db/jabber-id))
(message-mail-p
(signature-file "~/.signature"))
("algebra20:.*"
(address ,db/personal-mail-address)
(signature-file "~/.signature"))
("tu:.*"
(name ,user-full-name)
(address ,db/work-mail-address)
(signature-file "~/.signature-official"))))
;; http://mbork.pl/2015-11-28_Fixing_mml-attach-file_using_advice
(defun db/mml-attach-file--go-to-eob (orig-fun &rest args)
"Go to the end of buffer before attaching files."
(save-excursion
(save-restriction
(widen)
(goto-char (point-max))
(apply orig-fun args))))
(advice-add 'mml-attach-file :around #'db/mml-attach-file--go-to-eob)
;;; Archiving
;; FIXME: this is obsolete
(setq gnus-message-archive-method
`(nnfolder "archive"
(nnfolder-inhibit-expiry t)
(nnfolder-active-file ,(expand-file-name "archive/active" gnus-directory))
(nnfolder-directory ,(expand-file-name "archive/" gnus-directory)))
gnus-update-message-archive-method t
gnus-message-archive-group "archive"
gnus-gcc-mark-as-read t)
;;; SMTP configuration
(require 'smtpmail)
(require 'starttls)
(defadvice smtpmail-send-it (around display-trace-buffer disable)
"If an error is signalled, display the process buffer."
(condition-case signals-data
ad-do-it
(error (shrink-window-if-larger-than-buffer
(display-buffer (get-buffer (format "*trace of SMTP session to %s*"
smtpmail-smtp-server))))
(signal (car signals-data) (cdr signals-data)))))
(setq send-mail-function 'smtpmail-send-it
smtpmail-stream-type 'starttls
smtpmail-smtp-service 587
starttls-use-gnutls t
starttls-extra-arguments '("--strict-tofu")
smtpmail-smtp-server (nth 1 (car db/smtp-accounts))
smtpmail-smtp-user (nth 4 (car db/smtp-accounts)))
(defun db/set-smtp-server-from-header (orig-fun &rest args)
"Choose smtp-settings dynamically, based on the From: header
entry of the current mail."
(require 'mail-extr)
(let* ((from (or (save-restriction
(message-narrow-to-headers)
(mail-fetch-field "From"))
user-mail-address))
(address (cadr (mail-extract-address-components from)))
;; db/smtp-accounts set in db-private
(account (assoc address db/smtp-accounts)))
(message "Using address: %s" address)
(if account
(progn
(message "Sending with account for %s" address)
(cl-destructuring-bind (smtpmail-smtp-server
smtpmail-stream-type
smtpmail-smtp-service
smtpmail-smtp-user)
(cdr account)
(apply orig-fun args)))
(progn
(message "Sending with default account settings")
(apply orig-fun args)))))
(advice-add 'smtpmail-via-smtp
:around #'db/set-smtp-server-from-header)
(setq smtpmail-debug-info t)
;;; Notmuch
(require 'nnir)
(setq nnir-method-default-engines '((nnimap . imap)
(nnmaildir . notmuch)
(nntp . gmane)))
(use-package notmuch
:config (progn
;; (bind-key "GG" 'notmuch-search gnus-group-mode-map)
(defun db/notmuch-search-update-index (orig-fun &rest args)
"Update notmuch index before searching"
(message "Indexing new Mail...")
(shell-command "notmuch new --quiet 2>&1 | grep -v \"Note: Ignoring\"")
(message "Indexing new Mail... done.")
(apply orig-fun args))
(advice-add 'notmuch-search
:around #'db/notmuch-search-update-index)
(advice-add 'nnir-run-notmuch
:around #'db/notmuch-search-update-index)
(setq notmuch-fcc-dirs nil)))
;;;
t

1657
init.el

File diff suppressed because it is too large

1
network-security.data

@ -0,0 +1 @@
private/network-security.data

1
private

@ -0,0 +1 @@
Subproject commit 99f86481e53f4a48e8b71ab60ec828b46953685b

61
site-lisp/db-emacsclient.el

@ -0,0 +1,61 @@
;;; db-emacsclient.el --- Execute functions called from emacsclient
;;; Commentary:
;;
;;
;;; Code:
(defvar db/emacsclient-map (make-sparse-keymap)
"Keymap used for keys called from emacsclient.")
(defun db/emacsclient-key (key)
"Run command associated with `KEY' in `db/emacsclient-map'."
(let ((function (lookup-key db/emacsclient-map key)))
(when function (apply function nil))))
(define-key db/emacsclient-map "w"
(lambda ()
(interactive)
(clock-in-task-by-id org-working-task-id)
;;; FIXME: duplicate code
(call-process "xrandr" nil nil nil
"--output" "HDMI-3" "--primary" "--right-of" "LVDS-1" "--auto")
(call-process "xkbcomp" nil nil nil
"-I" "$HOME/.local/share/xkb/"
"~/.local/share/xkb/keymap/xkbtest $DISPLAY")))
(define-key db/emacsclient-map "2"
(lambda ()
(call-process "xrandr" nil nil nil
"--output" "HDMI-3" "--primary" "--right-of" "LVDS-1" "--auto")
(call-process "xkbcomp" nil nil nil
"-I" "$HOME/.local/share/xkb/"
"~/.local/share/xkb/keymap/xkbtest $DISPLAY")))
(define-key db/emacsclient-map "o"
#'org-clock-out)
(define-key db/emacsclient-map "b"
(lambda ()
(interactive)
(clock-in-task-by-id org-break-task-id)))
(define-key db/emacsclient-map "h"
(lambda ()
(interactive)
(clock-in-task-by-id org-home-task-id)
;;; FIXME: duplicate code
(call-process "xrandr" nil nil nil
"--output" "HDMI-3" "--off")))
(define-key db/emacsclient-map "1"
(lambda ()
(call-process "xrandr" nil nil nil
"--output" "HDMI-3" "--off")))
;;;
(provide 'db-emacsclient)
;;; db-emacsclient.el ends here

837
site-lisp/db-org.el

@ -0,0 +1,837 @@
;;; org.el -- Daniel's org mode configuration
;;; Commentary:
;;; Code:
;;; Basic Setup
(setq org-deadline-warning-days 14
org-read-date-popup-calendar t
org-insert-heading-respect-content t
org-list-description-max-indent 5
org-adapt-indentation nil
org-edit-timestamp-down-means-later t
org-archive-location "%s_archive.gpg::"
org-image-actual-width nil
org-footnote-section nil)
(setq org-todo-keywords
'((sequence "TODO(t)" "CONT(n!)" "|" "DONE(d@)")
(sequence "GOTO(g)" "ATTN(a)" "|" "DONE(d@)")
(sequence "READ(r)" "CONT(n!)" "|" "DONE(d@)")
(sequence "DELG(e@/!)" "WAIT(w@/!)" "HOLD(h@/!)" "|" "CANC(c@/!)" "PHONE" "MEETING")))
(setq org-todo-state-tags-triggers
'(("WAIT" ("WAIT" . t))
("HOLD" ("HOLD" . t))
(done ("HOLD") ("WAIT") ("NO_EXPORT" . t))
("TODO" ("HOLD") ("WAIT") ("NO_EXPORT"))
("READ" ("READ" . t) ("HOLD") ("WAIT"))
("GOTO" ("DATE" . t) ("HOLD") ("WAIT"))
("CONT" ("HOLD") ("WAIT"))
("ATTN" ("HOLD") ("WAIT"))))
(setq org-tag-alist
'((:startgroup . nil)
("WORK" . ?w)
("HOME" . ?h)
("FUN" . ?f)
("UNTAGGED" . ?u)
(:endgroup . nil)
("NOTE" . ?n)))
(setq org-treat-S-cursor-todo-selection-as-state-change nil
org-fast-tag-selection-single-key 'expert)
(setq org-global-properties
'(("Effort_ALL" . "0:00 0:15 0:30 0:45 1:00 2:00 3:00 4:00 5:00 6:00")))
(setq org-columns-default-format
"%80ITEM(Task) %10Effort(Effort){:} %10CLOCKSUM")
;;; Faces
(setq org-todo-keyword-faces
'(("TODO" :foreground "red" :weight normal)
("GOTO" :foreground "red" :weight normal)
("READ" :foreground "red" :weight normal)
("CONT" :foreground "DeepSkyBlue" :weight normal)
("ATTN" :foreground "DeepSkyBlue" :weight normal)
("DONE" :foreground "forest green" :weight normal)
("DELG" :foreground "dark orange" :weight normal)
("WAIT" :foreground "orange" :weight normal)
("HOLD" :foreground "magenta" :weight normal)
("CANC" :foreground "lime green" :weight normal)
("MEETING" :foreground "forest green" :weight normal)
("PHONE" :foreground "forest green" :weight normal)
("REPEAT" :foreground "indian red" :weight normal)))
(setq org-fontify-done-headline nil)
(setq org-priority-faces
'((?A . (:foreground "Red" :weight bold))
(?B . (:foreground "firebrick"))
(?C . (:foreground "tomato"))))
;;; Clocking
(setq org-clock-history-length 23
org-clock-in-resume t
org-clock-into-drawer t
org-clock-idle-time nil
org-log-into-drawer "LOGBOOK"
org-log-reschedule 'time
org-clock-out-remove-zero-time-clocks t
org-clock-out-when-done '("DONE" "CANC" "WAIT" "HOLD")
org-clock-persist t
org-clock-persist-query-resume nil
org-clock-auto-clock-resolution 'when-no-clock-is-running
org-clock-mode-line-total 'auto
org-clock-in-switch-to-state (lambda (kw)
(when (and (not
(and (boundp 'org-capture-mode)
org-capture-mode)))
(cond
((member (org-get-todo-state)
(list "TODO" "READ"))
"CONT")
((member (org-get-todo-state)
(list "GOTO"))
"ATTN"))))
org-clock-continuously t
org-time-stamp-rounding-minutes '(1 1)
org-clock-report-include-clocking-task t
org-time-clocksum-format '(:hours "%d"
:require-hours t
:minutes ":%02d"
:require-minutes t)
org-catch-invisible-edits 'error
org-clone-delete-id t)
;; Default Tasks for Working, Home, Breaks
(defvar org-working-task-id
"e56f201f-64a7-4f4a-8c3c-4151e3fdf880")
(defvar org-break-task-id
"c921affd-91f0-4ba9-8462-6c50dc1ed34e")
(defvar org-home-task-id
"ade37344-ccd9-4c93-aa15-406886a86627")
(add-hook 'org-clock-in-hook ; mark current default task
(lambda ()
(let ((current-id (org-id-get org-clock-marker)))
(when (member current-id (list org-working-task-id
org-home-task-id))
(org-clock-mark-default-task)))))
;; Clock in default task if no other task is given
(defun db/find-parent-task ()
;; http://doc.norang.ca/org-mode.html#Clocking
"Return point of the nearest parent task, and NIL if no such task exists."
(save-mark-and-excursion
(save-restriction
(widen)
(let ((parent-task nil))
(or (org-at-heading-p)
(org-back-to-heading t))
(while (and (not parent-task)
(org-up-heading-safe))
(let ((tags (nth 5 (org-heading-components))))
(unless (and tags (member "NOP" (split-string tags ":" t)))
(setq parent-task (point)))))
parent-task))))
(defun db/ensure-running-clock ()
"Clocks in into the parent task, if it exists, or the default task."
(when (and (not org-clock-clocking-in)
(not org-clock-resolving-clocks-due-to-idleness))
(let ((parent-task (db/find-parent-task)))
(save-mark-and-excursion
(cond
(parent-task
;; found parent task
(org-with-point-at parent-task
(org-clock-in)))
((and (markerp org-clock-default-task)
(marker-buffer org-clock-default-task))
;; default task is set
(org-with-point-at org-clock-default-task
(org-clock-in)))
(t
(org-clock-in '(4))))))))
(add-hook 'org-clock-out-hook #'db/ensure-running-clock 'append)
;; clock-in helpers
(defun clock-in-task-by-id (task-id)
"Clock in org mode task as given by TASK-ID."
(org-with-point-at (org-id-find task-id 'marker)
(org-clock-in))
(org-save-all-org-buffers))
(defun clock-out-task-by-id (task-id)
"Clock out org mode task as given by TASK-ID."
(org-with-point-at (org-id-find task-id 'marker)
(org-clock-out))
(org-save-all-org-buffers))
(defun db/org-clock-in-last-task (&optional arg)
;; from doc.norang.ca, originally bh/clock-in-last-task
"Clock in the interrupted task if there is one.
Skip the default task and get the next one. If ARG is given,
forces clocking in of the default task."
(interactive "p")
(let ((clock-in-to-task
(cond
((eq arg 4) org-clock-default-task)
((and (org-clock-is-active)
(equal org-clock-default-task (cadr org-clock-history)))
(caddr org-clock-history))
((org-clock-is-active) (cadr org-clock-history))
((equal org-clock-default-task (car org-clock-history))
(cadr org-clock-history))
(t (car org-clock-history)))))
(widen)
(org-with-point-at clock-in-to-task
(org-clock-in nil))))
;; Communicate the currently clocked in task to the outside world
(defvar db/org-clock-current-task-file
"~/.org-current-task")
(defun db/org-current-task ()
"Format currently clocked task and write it to
`db/org-clock-current-task-file'."
(with-temp-file db/org-clock-current-task-file
(let ((clock-buffer (marker-buffer org-clock-marker)))
(if (null clock-buffer)
(insert "No running clock"))
(let ((current-task org-clock-heading)
(current-file (file-name-sans-extension
(file-name-nondirectory
(buffer-file-name clock-buffer)))))
(insert current-file "/" current-task)))))
(add-hook 'org-clock-in-hook #'db/org-current-task)
(defun db/select-clocking-task ()
"Select task from recent clocked-in tasks."
(interactive)
(org-clock-in '(4)))
;;; Agenda Customization
(defvar db/org-default-work-file
"~/Documents/uni/admin/misc/work.org")
(defvar db/org-default-home-file
"~/Documents/home/home.org")
(defvar db/org-default-notes-file
"~/Documents/home/notes.org")
(defvar db/org-default-refile-file
"~/Desktop/refile.org")
(defvar db/org-default-pensieve-file
"~/Documents/home/pensieve.org.gpg")
(setq org-agenda-files (list db/org-default-home-file
db/org-default-work-file
db/org-default-refile-file
db/org-default-notes-file))
(setq org-agenda-include-diary nil
org-agenda-span 1
org-agenda-diary-file db/org-default-refile-file
org-agenda-insert-diary-strategy 'top-level
org-catch-invisible-edits 'show
org-ellipsis ""
org-agenda-sorting-strategy '((agenda time-up habit-up priority-down)
(todo category-keep)
(tags category-keep)
(search category-keep)))
(setq org-agenda-window-setup 'current-window
org-agenda-restore-windows-after-quit t
org-agenda-compact-blocks nil)
(setq org-agenda-todo-ignore-with-date nil
org-agenda-todo-ignore-deadlines nil
org-agenda-todo-ignore-scheduled nil
org-agenda-todo-ignore-timestamp nil
org-agenda-skip-deadline-if-done t
org-agenda-skip-scheduled-if-done t
org-agenda-skip-timestamp-if-done t
org-agenda-skip-scheduled-if-deadline-is-shown 'not-today
org-agenda-tags-todo-honor-ignore-options t
org-agenda-start-with-log-mode nil
org-agenda-log-mode-items '(closed state)
org-agenda-remove-tags t
org-agenda-sticky nil
org-agenda-inhibit-startup t
org-agenda-tags-todo-honor-ignore-options t
org-agenda-dim-blocked-tasks nil
org-enforce-todo-checkbox-dependencies t
org-enforce-todo-dependencies t
org-agenda-use-time-grid t
org-agenda-persistent-filter t
org-agenda-search-headline-for-time nil)
(setq org-agenda-clock-consistency-checks
'(:max-duration 999999999
:min-duration 0
:max-gap 0
:gap-ok-around nil
:default-face ((:background "DarkRed") (:foreground "white"))
:overlap-face nil :gap-face nil :no-end-time-face nil
:long-face nil :short-face nil))
(eval-after-load 'org-agenda
'(bind-key "i" 'org-agenda-clock-in org-agenda-mode-map))
(add-hook 'org-agenda-mode-hook #'hl-line-mode 'append)
(setq org-agenda-clockreport-parameter-plist
'(:link t :maxlevel 4 :compact t :narrow 60 :fileskip0 t))
(setq org-stuck-projects
'("-REGULAR-HOLD-NOTE+TODO=\"\""
("CONT" "TODO" "READ" "WAIT" "GOTO" "DELG")
("DATE" "NOP" "HOLD")
""))
(setq org-agenda-prefix-format
'((agenda . " %11s%-4c %4e %?-12t")
(timeline . "% s")
(todo . " %-4c ")
(tags . " %-4c ")
(search . " %-4c ")))
(defun db/org-agenda-list-deadlines (&optional match)
;; XXX org-agenda-later does not work, fix this
"Prepare agenda view that only lists upcoming deadlines.
Ignores MATCH."
(interactive "P")
(catch 'exit
(org-agenda-prepare "Deadlines")
(org-compile-prefix-format 'agenda)
(org-set-sorting-strategy 'agenda)
(let* ((today (org-today))
(thefiles (org-agenda-files nil 'ifmode))
(inhibit-redisplay (not debug-on-error))
s rtn rtnall file files date start-pos end-pos)
;; headline
(unless org-agenda-compact-blocks
(setq s (point))
(if org-agenda-overriding-header
(insert (org-add-props (copy-sequence org-agenda-overriding-header)
nil 'face 'org-agenda-structure) "\n"))
(org-agenda-mark-header-line s))
;; actual content
(setq date (calendar-gregorian-from-absolute today)
s (point)
start-pos (point)
files thefiles
rtnall nil)
(while (setq file (pop files))
(catch 'nextfile
(org-check-agenda-file file)
(setq rtn (apply 'org-agenda-get-day-entries
file date
'(:deadline)))
(setq rtnall (append rtnall rtn)))) ;; all entries
(when rtnall
(insert (org-agenda-finalize-entries rtnall 'agenda)
"\n"))
;; finalize
(goto-char (point-min))
(or org-agenda-multi (org-agenda-fit-window-to-buffer))
(unless (and (pos-visible-in-window-p (point-min))
(pos-visible-in-window-p (point-max)))
(goto-char (1- (point-max)))
(recenter -1)
(if (not (pos-visible-in-window-p (or start-pos 1)))
(progn
(goto-char (or start-pos 1))
(recenter 1))))
(goto-char (or start-pos 1))
(add-text-properties
(point-min) (point-max)
`(org-agenda-type agenda
org-redo-cmd
(db/org-agenda-list-deadlines ,match)))
(org-agenda-finalize)
(setq buffer-read-only t)
(message ""))))
(defun db/org-agenda-skip-tag (tag &optional others)
;; https://stackoverflow.com/questions/10074016/org-mode-filter-on-tag-in-agenda-view
"Skip all entries that correspond to TAG.
If OTHERS is true, skip all entries that do not correspond to TAG."
(let* ((next-headline (save-mark-and-excursion
(or (outline-next-heading) (point-max))))
(current-headline (or (and (org-at-heading-p)
(point))
(save-mark-and-excursion
;; remember to also consider invisible headings
(org-back-to-heading t))))
(has-tag (member tag (org-get-tags-at current-headline))))
(if (or (and others (not has-tag))
(and (not others) has-tag))
next-headline
nil)))
(defun db/cmp-date-property (prop)
;; https://emacs.stackexchange.com/questions/26351/custom-sorting-for-agenda
"Compare two `org-mode' agenda entries, `A' and `B', by some date property.
If a is before b, return -1. If a is after b, return 1. If they
are equal return nil."
(lexical-let ((prop prop))
#'(lambda (a b)
(let* ((a-pos (get-text-property 0 'org-marker a))
(b-pos (get-text-property 0 'org-marker b))
(a-date (or (org-entry-get a-pos prop)
(format "<%s>"