Add newline before habits in agenda view

master
Jacopo De Simoi 2 years ago
parent a3b196b094
commit af33e3a8f4
  1. 3
      .gitmodules
  2. 56
      global.org
  3. 1
      org-timeline

3
.gitmodules vendored

@ -142,3 +142,6 @@
[submodule "emacs-powerthesaurus"]
path = emacs-powerthesaurus
url = https://github.com/SavchenkoValeriy/emacs-powerthesaurus
[submodule "org-timeline"]
path = org-timeline
url = https://github.com/Fuco1/org-timeline.git

@ -22,6 +22,7 @@
** TODO revert org-files on frame activation.
What was the deal with auto-revert-mode again?
** DONE Add an empty line before habits in the daily agenda
* COMMENT About indentation in this file
This file will be indented with ~org-adapt-indentation~ set to t
@ -1114,6 +1115,61 @@
(setq org-use-speed-commands t)
#+end_src
Customize the agenda interface a bit
- newline before habits
#+begin_src emacs-lisp
(defun wilder/insert-before-first (pred el list &optional base)
"Returns a list in which EL is inserted before the first occurrence in LIST satisfying PRED"
(if (not list)
base
(if (funcall pred (car list))
(append base (list el) list)
(wilder/insert-before-first pred el (cdr list) (nconc base (list (car list)))))))
(defun org-agenda-finalize-entries (list &optional type)
"Sort, limit and concatenate the LIST of agenda items.
The optional argument TYPE tells the agenda type."
(setq org-planner list)
(let ((max-effort (cond ((listp org-agenda-max-effort)
(cdr (assoc type org-agenda-max-effort)))
(t org-agenda-max-effort)))
(max-todo (cond ((listp org-agenda-max-todos)
(cdr (assoc type org-agenda-max-todos)))
(t org-agenda-max-todos)))
(max-tags (cond ((listp org-agenda-max-tags)
(cdr (assoc type org-agenda-max-tags)))
(t org-agenda-max-tags)))
(max-entries (cond ((listp org-agenda-max-entries)
(cdr (assoc type org-agenda-max-entries)))
(t org-agenda-max-entries))))
(when org-agenda-before-sorting-filter-function
(setq list
(delq nil
(mapcar
org-agenda-before-sorting-filter-function list))))
(setq list (mapcar #'org-agenda-highlight-todo list)
list (mapcar #'identity (sort list #'org-entries-lessp)))
(when max-effort
(setq list (org-agenda-limit-entries
list 'effort-minutes max-effort
(lambda (e) (or e (if org-agenda-sort-noeffort-is-high
32767 -1))))))
(when max-todo
(setq list (org-agenda-limit-entries list 'todo-state max-todo)))
(when max-tags
(setq list (org-agenda-limit-entries list 'tags max-tags)))
(when max-entries
(setq list (org-agenda-limit-entries list 'org-hd-marker max-entries)))
(when (and org-agenda-dim-blocked-tasks org-blocker-hook)
(setq list (mapcar #'org-agenda--mark-blocked-entry list)))
(setq list
(wilder/insert-before-first #'(lambda (string)
(get-text-property 0 'org-habit-p string))
"" list))
(mapconcat #'identity list "\n")))
#+end_src
- Sleeker time-grid
#+begin_src emacs-lisp
(setq org-agenda-time-grid '((daily today require-timed)

@ -0,0 +1 @@
Subproject commit 2b300abc8adc9955418fa2334f55e0610bff79f5
Loading…
Cancel
Save