First commit.

This commit is contained in:
2022-01-09 21:19:46 +01:00
commit df36844dcc
107 changed files with 6565 additions and 0 deletions

954
lisp/modes/org.el Normal file
View File

@@ -0,0 +1,954 @@
;;; org.el --- Org mode support -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(defconst *user-org-data-directory*
(path-join *user-data-directory* "org")
"Path to user's org data store.")
(defconst *user-org-cache-directory*
(path-join *user-cache-directory* "org")
"Path to user's org cache store.")
(defvar user/org-mobile-sync-timer nil
"Timer used for syncing OrgMobile.")
(defvar user/org-mobile-sync-secs (* 60 20)
"Interval of OrgMobile sync in seconds.")
(defun user--org-mode-hook ()
"Org mode hook."
(unless (derived-mode-p 'text-mode)
(user--text-mode-hook))
(with-feature 'org-sticky-header
;; Enable sticky org mode header.
(org-sticky-header-mode t))
;; Highlighting lines that are too long since it often causes false
;; positives on URLs.
(user/whitespace-disable-style '(lines lines-tail))
(rainbow-delimiters-mode-disable)
(setq
;; Proper filling of org-mode text, form:
;; * http://lists.gnu.org/archive/html/emacs-orgmode/2008-01/msg00375.html
paragraph-separate
"\f\\|\\*+ \\|[ ]*$\\| [ \t]*[:|]\\|^[ \t]+\\[[0-9]\\{4\\}-"
paragraph-start
(concat "\f\\|[ ]*$\\|\\*+ \\|\f\\|[ \t]*\\([-+*][ \t]+\\|"
"[0-9]+[.)][ \t] +\\)\\|[ \t]*[:|]\\|"
"^[ \t]+\\[[0-9]\\{4\\}-"))
(with-feature 'org-table-sticky-header
;; Enable sticky headers for tables.
(org-table-sticky-header-mode t))
(user/smartparens-enable)
(org-bullets-mode t)
;;; (Bindings) ;;;
(user/bind-key-local :basic :open-buffer-context 'org-iswitchb)
(user/bind-key-local :basic :narrow-to-page 'org-narrow-to-subtree)
(user/bind-key-local :basic :narrow-to-region 'org-narrow-to-block)
(user/bind-key-local :basic :narrow-to-function 'org-narrow-to-element)
(user/bind-key-local :code :context-promote 'org-shiftup)
(user/bind-key-local :code :context-demote 'org-shiftdown))
(defun user--org-agenda-finalize-hook ()
"Org agenda display hook."
;; Enable appointment notifications.
(org-agenda-to-appt t))
(defun user--org-load-hook ()
"Org-mode loaded hook."
(when (not noninteractive)
;; Resume clocking tasks when Emacs is restarted.
(org-clock-persistence-insinuate))
;; Load modules.
(when org-modules-loaded
(org-load-modules-maybe 'force))
;; ;; Load Babel languages.
;; (org-babel-do-load-languages 'org-babel-load-languages
;; org-babel-load-languages))
)
(defun user/org-open-at-point (&optional arg)
"Like `org-open-at-point' but will use external browser with prefix ARG."
(interactive "P")
(if (not arg)
(org-open-at-point)
(let ((browse-url-browser-function #'browse-url-default-browser))
(org-open-at-point))))
(defun user/org-annotate-file-storage-file ()
"Get the path to the annotation storage file."
(or (with-project-root project-root (path-abs-buffer)
(path-join project-root (concat (user/proj-name project) ".org")))
org-annotate-file-storage-file))
(defun user/org-annotate-file ()
"Annotate the current buffer."
(interactive)
(with-feature 'org-annotate-file
(let ((storage-file (user/org-annotate-file-storage-file))
(popwin-config '(:position :bottom)))
(popwin:display-buffer-1 (org-annotate-file-show-section storage-file)
:default-config-keywords popwin-config))))
;; (defun user/org-mobile-sync-pull-and-push ()
;; "Sync OrgMobile directory."
;; (org-mobile-pull)
;; (org-mobile-push)
;; (with-eval-after-load 'sauron
;; (sauron-add-event 'my 3 "Called org-mobile-pull and org-mobile-push")))
;; (defun user/org-mobile-sync-start ()
;; "Start automated `org-mobile-push'."
;; (interactive)
;; (setq user/org-mobile-sync-timer
;; (run-with-idle-timer user/org-mobile-sync-secs t
;; 'user/org-mobile-sync-pull-and-push)))
;; (defun user/org-mobile-sync-stop ()
;; "Stop automated `org-mobile-push'."
;; (interactive)
;; (cancel-timer user/org-mobile-sync-timer))
(use-package org
:init
;; Create data and cache stores.
(make-directory *user-org-data-directory* t)
(make-directory *user-org-cache-directory* t)
;; Fix for EIN if org hasn't been setup yet.
(autoload 'org-add-link-type "org" "" t)
:hook
((org-load-hook . user--org-load-hook)
(org-mode-hook . user--org-mode-hook))
:bind
(:map org-mode-map
("C-c C-o" . user/org-open-at-point))
:config
;; https://github.com/sabof/org-bullets
;; utf-8 bullets for org-mode
(use-package org-bullets)
;; (use-package org-plus-contrib
;; :ensure t
;; :no-require t)
(validate-setq
;; Org data store.
org-directory *user-org-data-directory*
;; Notes data store.
;; org-default-notes-file (path-join *user-org-data-directory* "refile.org")
;; Pressing return on a link follows it.
org-return-follows-link t
;; Log time for TODO state changes.
;; org-log-done 'time
;; Log time when rescheduling an entry.
;; org-log-reschedule 'time
;; org-log-redeadline 'time
;; Round clock times to 15 minute increments.
;; org-time-stamp-rounding-minutes (quote (1 15))
;; Log drawer state changes.
;; org-log-into-drawer t
;; Allow single letter commands at beginning of headlines.
;; org-use-speed-commands t
;; Don't use the image width when inlining
org-image-actual-width nil
;; Fontify code blocks by default.
org-src-fontify-natively t
;; Tab should operate according to local mode.
org-src-tab-acts-natively t
;; Disable the indentation increases by one space in a demotion command
org-adapt-indentation nil
;; Don't preserve source code indentation so it can be adapted to document.
org-src-preserve-indentation nil
org-edit-src-content-indentation 0
;; Prevent editing of invisible regions.
org-catch-invisible-edits 'error
;; Allow fast state transitions.
;; org-use-fast-todo-selection 'auto
;; Do not record timestamp when using S-cursor to change state.
;; org-treat-S-cursor-todo-selection-as-state-change nil
;; Start in folded view.
org-startup-folded t
;; Enable speed commands.
org-use-speed-commands t
org-speed-commands-user
'(("0" . 'delete-window)
("1" . 'delete-other-windows)
("2" . 'split-window-vertically)
("3" . 'split-window-horizontally)
("h" . 'hide-other)
("s" . 'org-save-all-org-buffers)
("z" . 'org-add-note)
("N" . 'org-narrow-to-subtree)
("W" . 'widen)
("m" . 'org-mark-subtree)))
(when (eq default-terminal-coding-system 'utf-8)
(validate-setq
;; Prettify content using UTF-8.
org-pretty-entities t))
;; (setq org-todo-keyword-faces
;; (quote (("DONE" :foreground "red" :weight bold))))
;; TODO
;; Incompatible with validate-setq.
;; (setq
;; State transitions (http://doc.norang.ca/org-mode.html).
;; org-todo-keywords
;; (quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
;; (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "PHONE"
;; "MEETING")))
;; Triggered state changes.
;; org-todo-state-tags-triggers
;; (quote (("CANCELLED" ("CANCELLED" . t))
;; ("WAITING" ("WAITING" . t))
;; ("HOLD" ("WAITING") ("HOLD" . t))
;; (done ("WAITING") ("HOLD"))
;; ("TODO" ("WAITING") ("CANCELLED") ("HOLD"))
;; ("NEXT" ("WAITING") ("CANCELLED") ("HOLD"))
;; ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))))
;; (add-many-to-list
;; 'org-modules
;; ;; File attachment manager.
;; 'org-attach
;; ;; Link to BibTeX entries.
;; 'org-bibtex
;; ;; Link to tags.
;; 'org-ctags
;; ;; Link to articles and messages in Gnus.
;; 'org-gnus
;; ;; Habit tracking.
;; 'org-habit
;; ;; Support links to info pages.
;; 'org-info
;; ;; Support links to man pages.
;; 'org-man
;; ;; Export org buffer to MIME email message.
;; 'org-mime
;; ;; Allow external applications to talk to org.
;; 'org-protocol
;; ;; Embed source code in org-mode.
;; 'org-src)
;; (when (feature-p 'bbdb)
;; (add-to-list 'org-modules 'org-bbdb))
;; (when (feature-p 'emacs-w3m)
;; (add-to-list 'org-modules 'org-w3m))
;; (when (feature-p 'wanderlust)
;; (add-to-list 'org-modules 'org-wl))
;; (with-executable 'git
;; (add-to-list 'org-modules 'org-git-link))
;; (setq org-agenda-files '("~/org/GPE_OBIF.org"))
;; (setq org-default-notes-file "~/org/GPE_OBIF.org" initial-buffer-choice org-default-notes-file)
(setq org-duration-format (quote h:mm))
(setq org-hierarchical-todo-statistics nil)
(setq org-startup-folded "folded")
(setq org-todo-keywords '((sequence "TODO" "|" "DONE" "REJECTED")))
(when (display-graphic-p)
(validate-setq
;; Display inline images when starting up.
org-startup-with-inline-images t))
;; https://orgmode.org/manual/Refile-and-Copy.html
(use-package org-refile
:ensure nil
:config
(validate-setq
;; Allow refile to create parent tasks, with confirmation.
org-refile-allow-creating-parent-nodes 'confirm
;; Cache refile operations for performance.
org-refile-use-cache t))
;; https://www.gnu.org/software/emacs/manual/html_node/org/Tables.html
(use-package org-table
:ensure nil
:config
;; https://github.com/cute-jumper/org-table-sticky-header
;; A minor mode to show the sticky header for org-mode tables.
(use-package org-table-sticky-header))
;; https://orgmode.org/manual/Capture.html
;; https://www.labri.fr/perso/nrougier/GTD/index.html
(use-package org-capture
:ensure nil
:init
(user/bind-key-global :apps :capture-task 'org-capture)
:config
;; Incompatible with validate-setq.
;; TODO
;; (setq
;; Capture templates.
;; org-capture-templates
;; (quote (("t" "todo" entry (file org-default-notes-file)
;; "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
;; ("r" "respond" entry (file org-default-notes-file)
;; "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n"
;; :clock-in t :clock-resume t :immediate-finish t)
;; ("n" "note" entry (file org-default-notes-file)
;; "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
;; ("j" "Journal" entry
;; (file+datetree (path-join *user-org-data-directory* "diary.org"))
;; "* %?\n%U\n" :clock-in t :clock-resume t)
;; ("w" "org-protocol" entry (file org-default-notes-file)
;; "* TODO Review %c\n%U\n" :immediate-finish t)
;; ("m" "Meeting" entry (file org-default-notes-file)
;; "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t)
;; ("p" "Phone call" entry (file "~/git/org/refile.org")
;; "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t)
;; ("h" "Habit" entry (file org-default-notes-file)
;; (concat "* NEXT %?\n%U\n%a\n"
;; "SCHEDULED: "
;; "%(format-time-string \"<%Y-%m-%d %a .+1d/3d>\")\n:"
;; "PROPERTIES:\n:STYLE: habit\n"
;; ":REPEAT_TO_STATE: NEXT\n:END:\n")))))
;; https://github.com/tkf/org-mode/blob/master/lisp/org-id.el
;; Global identifiers for Org-mode entries
(use-package org-id
:disabled
:ensure nil
:config
(validate-setq
org-id-locations-file
(path-join *user-org-data-directory* "org-id-locations")))
;; https://github.com/grugrut/helm-books/tree/625aadec1541a5ca36951e4ce1301f4b6fe2bf3f
;; Book search interface for emacs helm.
(use-package helm-books
:disabled
:config
(add-to-list
'org-capture-templates
'("b" "book memo" entry
(file (concat org-directory "book.org"))
"* %(helm-books)")))
;; https://github.com/Chobbes/org-chef
;; A package for making a cookbook and managing recipes with org-mode.
(use-package org-chef
:disabled
:config
(add-to-list
'org-capture-templates
`("c" "Cookbook" entry
(file ,(path-join *user-org-data-directory* "cookbook.org"))
"%(org-chef-get-recipe-from-url)"
:empty-lines 1)))
;; https://github.com/waymondo/org-repo-todo
;; Simple repository todo management with org-mode
(use-package org-repo-todo))
;; https://github.com/emacs-mirror/emacs/blob/master/lisp/org/ob-core.el
;; Working with Code Blocks
(use-package ob-core
:ensure nil
:config
(validate-setq
;; Don't ask for validation.
org-confirm-babel-evaluate nil)
(add-many-to-list
'org-babel-load-languages
;; Emacs Lisp
'(emacs-lisp . t)
;; Shell script
'(shell . t))
(let ((to-load '((emacs-lisp . t) (shell . t))))
(with-executable 'g++
(push '(C . t) to-load)
;; Use of lsp-clangd for C/C++
(setq org-babel-C++-compiler "bear g++"))
(with-executable 'dot
(push '(dot . t) to-load))
(with-executable 'ghc
(push '(haskell . t) to-load))
(with-executable 'gnuplot
(push '(gnuplot . t) to-load))
(with-executable 'latex
(push '(latex . t) to-load))
(with-executable 'perl
(push '(perl . t) to-load))
(with-executable 'python
(push '(python . t) to-load))
(with-executable 'R
(push '(R . t) to-load))
(with-executable 'ruby
(push '(ruby . t) to-load))
(when (feature-p 'plantuml-mode)
;; https://github.com/skuro/plantuml-mode
;; A major mode for editing PlantUML sources in Emacs
(use-package ob-plantuml
:ensure nil
:after modes/plantuml
:config
(validate-setq
org-plantuml-jar-path *user-plantuml-jar-path*))
(push '(plantuml . t) to-load))
(org-babel-do-load-languages 'org-babel-load-languages to-load))
;; https://github.com/dfeich/helm-lib-babel/tree/41bc0cdea8a604c6c8dc83ed5066644d33688fad
;; Emacs helm extension for inserting a reference to an org source block function
(use-package helm-lib-babel)
;; https://github.com/astahlman/ob-async
;; Asynchronous src_block execution for org-babel
(use-package ob-async
:defer
:config
(add-to-list
;; Execute org-babel asynchronously.
'org-ctrl-c-ctrl-c-hook 'ob-async-org-babel-execute-src-block))
;; https://github.com/pope/ob-go
;; Org-Babel support for evaluating go code
(use-package ob-go
:if (executable-find "go")
:init (add-to-list 'org-babel-load-languages '(go . t)))
;; https://github.com/zweifisch/ob-http
;; Org-Babel support for evaluating http
(use-package ob-http
:init (add-to-list 'org-babel-load-languages '(http . t)))
;; https://github.com/micanzhang/ob-rust
;; Org-Babel support for evaluating Rust code
(use-package ob-rust
:if (executable-find "rustc")
:init (add-to-list 'org-babel-load-languages '(rust . t)))
;; https://github.com/krisajenkins/ob-translate
;; Allows you to translate blocks of text within org-mode
(use-package ob-translate
:disabled
:init (add-to-list 'org-babel-load-languages '(translate . t)))
;; https://github.com/andrmuel/ob-uart
;; Org babel support for UART communication
(use-package ob-uart
:disabled
:init (add-to-list 'org-babel-load-languages '(uart . t)))
;; https://github.com/ahendriksen/ob-tmux
;; Ob-tmux is an Emacs library that allows org mode to evaluate code blocks in a tmux session.
(use-package ob-tmux
:if (executable-find "tmux")
:init (add-to-list 'org-babel-load-languages '(tmux . t))))
;; https://github.com/emacs-mirror/emacs/blob/master/lisp/org/ox-org.el
;; Org Back-End for Org Export Engine
(use-package ox
:ensure nil
:config
(validate-setq
;; Export as UTF-8.
org-export-coding-system 'utf-8)
;; Org export modules to load by default.
(add-many-to-list
'org-export-backends
;; Ascii support.
'ascii
;; HTML.
'html
;; OpenDocument Text support.
'odt)
(with-executable 'latex
(add-many-to-list
'org-export-backends
;; Beamer presentation export.
'beamer
;; Plain LaTeX export.
'latex))
;; https://github.com/tomalexander/orgmode-mediawiki/tree/a9327150293e370e500ba55bddfe5fc435c6bf9b
;; A mediawiki export for Emacs org-mode
(use-package ox-mediawiki
:config (add-to-list 'org-export-backends 'mediawiki))
;; https://github.com/larstvei/ox-gfm
;; Github Flavored Markdown Back-End for Org Export Engine
(use-package ox-gfm
:config (add-to-list 'org-export-backends 'gfm))
;; https://github.com/stig/ox-jira.el
;; Org-mode export backend for JIRA markup
(use-package ox-jira
:disabled
:config (add-to-list 'org-export-backends 'jira))
;; https://github.com/kawabata/ox-pandoc
;; Another org-mode exporter via pandoc
(use-package ox-pandoc
:if (executable-find "pandoc")
:pin "MELPA"
:config (add-to-list 'org-export-backends 'pandoc))
;; https://github.com/choppsv1/org-rfc-export/tree/1a49535cf927cd52ffa05c815b890888c4addf86
;; Org-mode export back-end for creating internet-drafts and RFCs using xml2rfc.
(use-package ox-rfc
:disabled
:config (add-to-list 'org-export-backends 'rfc)))
;; Load org agenda.
(add-to-list 'org-modules 'org-agenda)
(add-to-list 'org-modules 'org)
;; https://orgmode.org/manual/Org-Mobile.html
(use-package org-mobile
:disabled
:ensure nil
:config
(validate-setq
;; Location of TODO items to sync.
org-mobile-inbox-for-pull org-default-notes-file
;; MobileOrg sync directory.
org-mobile-directory (path-join *user-org-data-directory* "mobile")
;; Custom agenda view.
org-mobile-force-id-on-agenda-items nil))
;; https://github.com/ifree/org-onenote
;; Post org file to onenote
(use-package org-onenote
:disabled)
;;; (Packages) ;;;
;; https://github.com/unhammer/org-rich-yank
;; Rich text clipboard for org-mode: Paste into a #+BEGIN_SRC block of correct mode, with link to where it came from
(use-package org-rich-yank
:bind-wrap
(:map org-mode-map
((:key :basic :alternate-paste) . org-rich-yank)))
;; https://github.com/tkf/org-mode/blob/master/lisp/org-clock.el
;; The time clocking code for Org-mode
(use-package org-clock
:ensure nil
:config
(validate-setq
;; Clock data store.
org-clock-persist-file (path-join *user-org-cache-directory*
"org-clock-save.el"))
(when (not noninteractive)
;; When running in batch, don't setup time tracking.
(validate-setq
;; Resume clocking task on clock-in if the clock is open.
org-clock-in-resume t
;; Save clock data and state changes and notes in the LOGBOOK drawer.
org-clock-into-drawer t
;; Remove clock line if time is zero.
org-clock-out-remove-zero-time-clocks t
;; Stop clock when entry is marked as DONE.
org-clock-out-when-done t
;; Show the amount of time spent on the current task today.
org-clock-mode-line-total 'today
;; Resume clock when reopening Emacs.
org-clock-persist t
;; Enable auto clock resolution for finding open clocks.
org-clock-auto-clock-resolution 'when-no-clock-is-running
;; Include current clocking task in clock reports.
org-clock-report-include-clocking-task t)))
;; https://github.com/alphapapa/org-sticky-header
;; Show off-screen Org heading at top of window
(use-package org-sticky-header)
;; https://github.com/daimrod/org-sync
;; Synchronize Org documents with external services
(use-package org-sync
:disabled
:config
(validate-setq
;; Org sync cache store.
org-sync-cache-file (path-join *user-org-cache-directory* "org-sync-cache"))
;; Redmine module.
(load "org-sync-redmine")
;; GitHub module.
(load "org-sync-github"))
;; https://github.com/dengste/org-caldav
;; Caldav sync for Emacs orgmode
(use-package org-caldav
:disabled
:config
(validate-setq
;; Path to state synchronization file.
org-caldav-save-directory (path-join *user-org-cache-directory* "org-caldav")
;; Path to inbox file.
org-caldav-inbox (path-join *user-org-data-directory* "org-caldav-inbox.org")
;; Path to backup file.
org-caldav-backup-file (path-join *user-org-data-directory* "org-caldav-backup.org")
;; Link to org agenda.
org-caldav-files org-agenda-files
;; Ask before deleting entries on server.
org-caldav-delete-calendar-entries 'ask)
;; Ensure that state synchronization directory exists.
(make-directory org-caldav-save-directory t))
;; https://github.com/alphapapa/org-web-tools
;; View, capture, and archive Web pages in Org-mode
(use-package org-web-tools)
;; https://github.com/facetframer/orgnav
;; Quickly navigate and search your emacs org trees; use this navigation to capture and organize
(use-package orgnav)
;; https://github.com/rlister/org-present
;; Ultra-minimalist presentation minor-mode for Emacs org-mode
(use-package org-present
:disabled
:config
(with-eval-after-load 'org-present
(add-hook 'org-present-mode-hook
(lambda ()
(org-present-big)
(org-display-inline-images)
(org-present-hide-cursor)
(org-present-read-only)))
(add-hook 'org-present-mode-quit-hook
(lambda ()
(org-present-small)
(org-remove-inline-images)
(org-present-show-cursor)
(org-present-read-write)))))
;; https://github.com/alphapapa/org-rifle
;; Rifle through your Org-mode buffers and acquire your target
(use-package helm-org-rifle)
;; https://github.com/weirdNox/org-noter
;; Emacs document annotator, using Org-mode
(use-package org-noter
:disabled)
;; https://github.com/louietan/anki-editor
;; Emacs minor mode for making Anki cards with Org
(use-package anki-editor)
;; https://github.com/dfeich/org-screenshot
;; screenshots integrated with emacs org mode attachments
(use-package org-attach-screenshot
:disabled)
;; https://github.com/harrybournis/org-fancy-priorities
;; Display Org Mode priorities as custom strings
(use-package org-fancy-priorities
:hook (org-mode-hook . org-fancy-priorities-mode))
;; https://github.com/calvinwyoung/org-autolist
;; Making it even easier to edit lists in org-mode!
(use-package org-autolist
:hook (org-mode-hook . org-autolist-mode))
;; https://github.com/abo-abo/org-download
;; Drag and drop images to Emacs org-mode
(use-package org-download)
;; https://github.com/tarsius/org-elisp-help
;; Org links to emacs-lisp documentation
(use-package org-elisp-help)
;; https://github.com/emacsjanitors/org-fstree
;; Include a filesystem subtree into an org file
(use-package org-fstree
:disabled)
;; https://github.com/flexibeast/org-vcard
;; Export and import vCards from within GNU Emacs' Org mode.
(use-package org-vcard
:disabled
:config
(validate-setq
org-vcard-custom-styles-dir (path-join *user-org-data-directory* "org-vcard-styles")))
;; https://github.com/gizmomogwai/org-kanban
;; Kanban table for org-mode
;; Enables `#+BEGIN: kanban' for producing a kanban table.
(use-package org-kanban
:disabled))
;; https://orgmode.org/manual/Agenda-Commands.html
(use-package org-agenda
:ensure org-plus-contrib
:defer
:hook (org-agenda-finalize-hook . user--org-agenda-finalize-hook)
:bind-wrap
(((:key :apps :agenda) . org-agenda)
((:key :apps :todo) . org-todo-list))
:config
(let ((agenda-data-store (path-join *user-org-data-directory* "agendas")))
(validate-setq
;; Agenda data store.
org-agenda-files `(,agenda-data-store))
;; Ensure that agenda data store exists.
(make-directory agenda-data-store t))
(validate-setq
org-agenda-breadcrumbs-separator ""
;; Ignore agenda files that are unavailable.
org-agenda-skip-unavailable-files t
;; Restore window configuration when done with the agenda.
org-agenda-restore-windows-after-quit t
;; Start on Monday.
org-agenda-start-on-weekday 1
;; Show month by default.
;; org-agenda-span 'month
;; Don't display scheduled todos.
;; org-agenda-todo-ignore-scheduled 'future
;; Don't show nested todos.
;; org-agenda-todo-list-sublevels nil
;; Don't dim blocked tasks.
org-agenda-dim-blocked-tasks nil
;; Compact block agenda view.
;; org-agenda-compact-blocks t
;; Include Emacs' Diary in org-agenda.
org-agenda-include-diary t
;; Switch window when opening org-agenda.
;; org-agenda-window-setup 'other-window
;; Display indirect buffers in the "current" window.
org-indirect-buffer-display 'current-window
;; Reset all custom commands.
org-agenda-custom-commands nil)
(add-many-to-list
'org-agenda-custom-commands
;; `("T", "Daily Timesheet"
;; (my-org-timeline)
;; ))
`("a" "Agenda"
((agenda ""
((org-agenda-prefix-format "%-12:c%?-12t% b% s")
(org-genda-list))))))
;; (
;; (org-agenda-repeating-timestamp-show-all nil)
;; (org-agenda-remove-tags t)
;; (org-agenda-overriding-header "⚡ Calendar")
;; ;; (org-agenda-prefix-format "%?-12t% s")
;; (org-agenda-prefix-format " %?-12t% s")
;; (org-agenda-todo-keyword-format "")
;; (my-org-timeline)
;; )))))
;; '("a" "Agenda" org-agenda-list)
;; '("c" . "COLLECT...")
;; '("cb" "CollectBox" ((alltodo "")))
;; '("f" . "FOCUS...")
;; '("f." "Today"
;; ((agenda ""
;; ((org-agenda-entry-types '(:timestamp :sexp))
;; (org-agenda-overriding-header
;; (concat "CALENDAR Today"
;; (format-time-string "%a %d" (current-time))))
;; (org-agenda-span 'day)))
;; (tags-todo "LEVEL=1+REFILE"
;; ((org-agenda-overriding-header "COLLECTBOX (Unscheduled)")))
;; (tags-todo "DEADLINE=\"<+0d>\""
;; ((org-agenda-overriding-header "DUE TODAY")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notedeadline))
;; (org-agenda-sorting-strategy '(priority-down))))
;; (tags-todo "DEADLINE<\"<+0d>\""
;; ((org-agenda-overriding-header "OVERDUE")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notedeadline))
;; (org-agenda-sorting-strategy '(priority-down))))
;; (agenda ""
;; ((org-agenda-entry-types '(:scheduled))
;; (org-agenda-overriding-header "SCHEDULED")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'todo 'done))
;; (org-agenda-sorting-strategy
;; '(priority-down time-down))
;; (org-agenda-span 'day)
;; (org-agenda-start-on-weekday nil)
;; (org-agenda-time-grid nil)))
;; (todo "DONE"
;; ((org-agenda-overriding-header "COMPLETED"))))
;; ((org-agenda-format-date "")
;; (org-agenda-start-with-clockreport-mode nil)))
;; '("fh" "Hotlist"
;; ((tags-todo "DEADLINE<\"<+0d>\""
;; ((org-agenda-overriding-header "OVERDUE")))
;; (tags-todo "DEADLINE>=\"<+0d>\"+DEADLINE<=\"<+1w>\""
;; ((org-agenda-overriding-header "DUE IN NEXT 7 DAYS")))
;; (tags-todo "DEADLINE=\"\"+FLAGGED|DEADLINE>\"<+1w>\"+FLAGGED"
;; ((org-agenda-overriding-header "FLAGGED"))))
;; ((org-agenda-todo-ignore-scheduled 'future)))
;; '("r" . "REVIEW...")
;; '("ra" . "All Tasks...")
;; '("rad" "All Tasks (grouped by Due Date)"
;; ((tags-todo "DEADLINE<\"<+0d>\""
;; ((org-agenda-overriding-header "OVERDUE")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notdeadline))))
;; (tags-todo "DEADLINE=\"<+0d>\""
;; ((org-agenda-overriding-header "DUE TODAY")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notdeadline))))
;; (tags-todo "DEADLINE=\"<+1d>\""
;; ((org-agenda-overriding-header "DUE TOMORROW")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notdeadline))))
;; (tags-todo "DEADLINE>\"<+1d>\"+DEADLINE<=\"<+7d>\""
;; ((org-agenda-overriding-header "DUE WITHIN A WEEK")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notdeadline))))
;; (tags-todo "DEADLINE>\"<+7d>\"+DEADLINE<=\"<+28d>\""
;; ((org-agenda-overriding-header "DUE WITHIN A MONTH")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notdeadline))))
;; (tags-todo "DEADLINE>\"<+28d>\""
;; ((org-agenda-overriding-header "DUE LATER")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notdeadline))) )
;; (tags-todo "TODO={WAIT}"
;; ((org-agenda-overriding-header "WAITING FOR")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'deadline))))
;; (todo ""
;; ((org-agenda-overriding-header "WAITING FOR")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'deadline)))))
;; ((org-agenda-sorting-strategy '(priority-down))
;; (org-agenda-write-buffer-name "All Tasks (grouped by Due Date)"))
;; "~/Documents/Org/all-tasks-by-due-date.pdf")
;; '("ra1" "All Tasks with a due date"
;; ((alltodo ""))
;; ((org-agenda-overriding-header "All Tasks (sorted by Due Date)")
;; (org-agenda-skip-function
;; '(org-agenda-skip-entry-if 'notdeadline))
;; (org-agenda-sorting-strategy '(deadline-up))))
;; '("rt" . "Timesheet...")
;; '("rtw" "Weekly Timesheet"
;; ((agenda ""))
;; (
;; ;; (org-agenda-format-date "")
;; (org-agenda-overriding-header "WEEKLY TIMESHEET")
;; (org-agenda-skip-function '(org-agenda-skip-entry-if 'timestamp))
;; (org-agenda-span 'week)
;; (org-agenda-start-on-weekday 1)
;; (org-agenda-start-with-clockreport-mode t)
;; (org-agenda-time-grid nil)))
;; '("rc" . "Calendar...")
;; '("rc7" "Events and appointments for 7 days"
;; ((agenda ""))
;; ((org-agenda-entry-types '(:timestamp :sexp))
;; ;; (org-agenda-overriding-header "Calendar for 7 days")
;; ;; (org-agenda-repeating-timestamp-show-all t)
;; (org-agenda-span 'week)
;; (org-agenda-format-date "\n%a %d")
;; ;; (org-agenda-date-weekend ... new face ...)
;; (org-agenda-time-grid nil)))
;; '("rw" "Weekly review"
;; ((tags "CATEGORY={@REFILE}&LEVEL<=2"
;; ((org-agenda-overriding-header "NEW TASKS")))
;; (agenda ""
;; ((org-agenda-clockreport-mode t)
;; (org-agenda-format-date
;; (concat "\n"
;; "%Y-%m-%d" " %a "
;; (make-string (window-width) ?_)))
;; (org-agenda-overriding-header "PAST WEEK")
;; (org-agenda-prefix-format " %?-11t %i %-12:c% s")
;; (org-agenda-show-log 'clockcheck)
;; (org-agenda-span 7)
;; (org-agenda-start-day "-1w")
;; (org-deadline-warning-days 0)))
;; (agenda ""
;; ((org-agenda-overriding-header "NEXT MONTH")
;; (org-agenda-span 'month)
;; (org-agenda-start-day "+0d")
;; (org-deadline-warning-days 0)))
;; (todo "PROJECT"
;; ((org-agenda-overriding-header "PROJECT LIST")))
;; (todo "DONE|PROJECTDONE"
;; ((org-agenda-overriding-header
;; "Candidates to be archived"))))))
;; (when (not noninteractive)
;; ;; When running in batch, don't setup windows.
;; (validate-setq
;; ;; Show agenda in current window.
;; org-agenda-window-setup 'current-window))
)
;; https://github.com/emacs-mirror/emacs/blob/master/lisp/org/org-habit.el
;; The habit tracking code for Org
(use-package org-habit
:ensure nil
:config
(validate-setq
;; Position the habit graph to the right.
org-habit-graph-column 50))
;; https://github.com/alphapapa/org-super-agenda
;; Supercharge your Org daily/weekly agenda by grouping items
(use-package org-super-agenda
:disabled
:config
(add-to-list
'org-agenda-custom-commands
'("u" "Super view"
((agenda "" ((org-super-agenda-groups
'((:name "Today"
:time-grid t)))))
(todo "" ((org-agenda-overriding-header "")
(org-super-agenda-groups
'((:name "Projects"
:children todo)
(:discard (:anything t)))))))))
(org-super-agenda-mode))
;; https://github.com/spegoraro/org-alert
;; System notifications of org agenda items
(use-package org-alert
:after alert
:config
(org-alert-enable))
;; https://github.com/Malabarba/org-agenda-property
;; Display org properties in the agenda buffer
(use-package org-agenda-property)
;; https://github.com/Fuco1/org-timeline
;; Add graphical view of agenda to agenda buffer
(use-package org-timeline
:disabled
:hook (org-agenda-finalize-hook . org-timeline-insert-timeline))
;; https://github.com/tkf/org-mode/blob/master/contrib/lisp/org-annotate-file.el
;; Annotate a file with org syntax
(use-package org-annotate-file
:disabled
:ensure org-plus-contrib
:defer
:init
(autoload 'org-annotate-file "org-annotate-file" nil t)
:bind-wrap
((:key :util :annotate-buffer) . user/org-annotate-file)
:config
(validate-setq
;; Annotations data store.
org-annotate-file-storage-file (path-join *user-org-data-directory*
"annotations.org")
;; Add link to current line number.
org-annotate-file-add-search t))
(provide 'modes/org)
;;; org.el ends here