Improve org-agenda

master
trémeur 2 years ago
parent 8c10c1bc7a
commit 703101c4bd

@ -13,3 +13,8 @@
"mis Hedra" "mis Du" "mis Kevardhu"])
(setq org-todo-keywords
'((sequence "TODO" "|" "DONE" "CANCELLED")))
(setq org-agenda-time-grid
'((daily today require-timed remove-match)
(800 1000 1200 1400 1600 1800 2000)
"......" "----------------"))
(setq org-agenda-time-leading-zero t)

@ -267,7 +267,6 @@ Standard =elfeed= settings:
#+BEGIN_SRC emacs-lisp
(defun elfeed-load-db-and-open ()
"Wrapper to load the elfeed db from disk before opening"
(interactive)
(elfeed-db-load)
(elfeed)
@ -283,7 +282,6 @@ Standard =elfeed= settings:
'(define-key elfeed-search-mode-map (kbd "m") 'elfeed-toggle-star))
(defun elfeed-save-db-and-bury ()
"Wrapper to save the elfeed db to disk before burying buffer"
(interactive)
(elfeed-db-save)
(quit-window))
@ -348,7 +346,6 @@ I kind of hate markdown but I still have to use it sometimes.
("\\.markdown\\'" . markdown-mode))
:init
(add-hook 'markdown-mode-hook 'auto-fill-mode)
(add-hook 'markdown-mode-hook 'typo-mode)
:config
(setq markdown-asymmetric-header t)
:custom
@ -551,11 +548,9 @@ Set the files to be included.
#+BEGIN_SRC emacs-lisp
(unless (atwork)
(setq org-agenda-files (list "~/Documents/drive/org/calendar"
"~/Documents/drive/org/period.org"
"~/Documents/drive/org/habit.org")))
(when (atwork)
(setq org-agenda-files (list "~/Documents/drive/org/calendar"
"~/Documents/drive/org/period.org"
"~/Documents/drive/org/acwri.org")))
#+END_SRC
@ -571,6 +566,15 @@ Set how the agenda looks.
(setq org-agenda-todo-ignore-deadlines t)
#+END_SRC
Add period information to the agenda header (this has a very weird output, completely different when you insert a function from just using text, utterly bizarre).
#+BEGIN_SRC emacs-lisp
(setq org-agenda-custom-commands
'(("a" "Slightly modified agenda view"
((agenda ""
((org-agenda-overriding-header (periodise))))))))
#+END_SRC
Use a horizontal line to divide each day from the next.
#+BEGIN_SRC emacs-lisp
@ -666,7 +670,7 @@ As previously described, “the big boy”. I know little about most of these se
** =typo=
Automatically use smart quotes. (Cant be set to =text-mode-hook=, unfortunately, as this messes things up in LaTeX; but the only other text-modes I use are =org= and Markdown, I think.)
Automatically use smart quotes. (Cant be set to =text-mode-hook=, unfortunately, as this messes things up in LaTeX; but the only other text-modes I use are =org= and Markdown, I think.) Also, best to /unset/ this mode in source blocks in =org=, [[https://emacs.stackexchange.com/questions/55944/disable-minor-mode-inside-source-blocks][hook taken from here]].
#+BEGIN_SRC emacs-lisp
(use-package typo
@ -675,6 +679,9 @@ Automatically use smart quotes. (Cant be set to =text-mode-hook=, unfortunate
:init
(add-hook 'org-mode-hook 'typo-mode)
(add-hook 'markdown-mode-hook 'typo-mode))
(defun unsmart-hook ()
(add-hook 'typo-disable-electricity-functions 'org-in-src-block-p nil :local))
(add-hook 'org-mode-hook 'unsmart-hook)
#+END_SRC
** =yasnippet=

@ -0,0 +1,30 @@
(defun periodise ()
(setq periodfile "~/Documents/drive/org/period.org")
(find-file-noselect periodfile)
(setq thebuffer (file-name-nondirectory periodfile))
(with-current-buffer thebuffer
(setq theyear (string-to-number (buffer-substring-no-properties 2 6)))
(setq themonth (string-to-number (buffer-substring-no-properties 7 9)))
(setq thedate (string-to-number (buffer-substring-no-properties 10 12)))
(kill-buffer thebuffer))
(setq dayof nil)
(push theyear dayof)
(push thedate dayof)
(push themonth dayof)
(setq thatday (calendar-absolute-from-gregorian dayof))
(setq today (calendar-absolute-from-gregorian (calendar-current-date)))
(setq days (+ 1 (- today thatday)))
(insert (concat "Day " (format "%S" days))))
(defun menstruate ()
(interactive)
(setq periodfile "~/Documents/drive/org/period.org")
(find-file-noselect periodfile)
(setq thebuffer (file-name-nondirectory periodfile))
(with-current-buffer thebuffer
(goto-char (point-min))
(insert "\n")
(goto-char (point-min))
(org-time-stamp '(16) nil)
(write-file periodfile)
(kill-buffer thebuffer)))
Loading…
Cancel
Save