rearrange and update to emacs 26

This commit is contained in:
petrucci4prez 2018-06-03 21:09:16 -04:00
parent 1186d5d7cb
commit 027d08e8f3
2 changed files with 256 additions and 255 deletions

18
conf.el
View File

@ -1,4 +1,3 @@
(setq inhibit-startup-screen t)
(tool-bar-mode -1)
@ -70,7 +69,6 @@
(global-set-key (kbd "<f1>") 'org-agenda)
(global-set-key (kbd "<f2>") 'org-capture)
(global-set-key (kbd "<f3>") 'org-iswitchb)
(use-package delight
:ensure t)
@ -269,6 +267,7 @@ event of an error or nonlocal exit."
(setq org-startup-indented t)
(delight 'org-indent-mode)
(setq org-directory "~/Org")
(run-at-time "00:59" 3600 'org-save-all-org-buffers)
(use-package org-bullets
:ensure t
@ -932,10 +931,10 @@ tasks with context tags"
(setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-prefix-format
'((agenda . " %-12:c%-7:e%?-12t% s")
'((agenda . " %-12:c %-5:e %?-12t% s")
(timeline . " % s")
(todo . " %-12:c")
(tags . " %-12:c%-7:e")
(tags . " %-12:c %-5:e ")
(search . " %-12:c")))
(defconst nd/org-agenda-todo-sort-order '("NEXT" "WAIT" "HOLD" "TODO"))
@ -1028,8 +1027,8 @@ tasks with context tags"
"Non-critical Errors"
(,(nd/agenda-base-header-command task-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems)
,(nd/agenda-base-header-command task-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems)
,(nd/agenda-base-project-command project-match "Undone Completed" :undone-complete)
,(nd/agenda-base-project-command project-match "Done Incompleted" :done-incomplete)))
,(nd/agenda-base-project-command task-match "Undone Completed" :undone-complete)
,(nd/agenda-base-project-command task-match "Done Incompleted" :done-incomplete)))
("A"
"Archivable Tasks and Projects"
(,(nd/agenda-base-header-command task-match "Archivable Atomic Tasks" ''nd/skip-non-archivable-atomic-tasks)
@ -1039,9 +1038,10 @@ tasks with context tags"
(setq org-agenda-start-on-weekday 0)
(setq org-agenda-span 'day)
(setq org-agenda-time-grid (quote ((daily today remove-match)
#("----------------" 0 16 (org-heading t))
(0900 1100 1300 1500 1700))))
(setq org-agenda-current-time-string "### -- NOW -- ###")
(setq org-agenda-time-grid '((daily today remove-match)
(0800 1000 1200 1200 1400 1600)
"......" "-----------------"))
(add-hook 'org-finalize-agenda-hook 'place-agenda-tags)
(defun place-agenda-tags ()

View File

@ -113,7 +113,6 @@ These are commands that should work in any mode. Make the assumption that functi
#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "<f1>") 'org-agenda)
(global-set-key (kbd "<f2>") 'org-capture)
(global-set-key (kbd "<f3>") 'org-iswitchb)
#+END_SRC
* printing
**
@ -406,6 +405,7 @@ event of an error or nonlocal exit."
(setq org-startup-indented t)
(delight 'org-indent-mode)
(setq org-directory "~/Org")
(run-at-time "00:59" 3600 'org-save-all-org-buffers)
#+END_SRC
** ui
*** bullets
@ -804,11 +804,11 @@ Returns t if heading has certain relationship to other headings
#+END_SRC
**** project level testing
#+BEGIN_SRC emacs-lisp
(defconst nd/project-invalid-todostates
(defconst nd/project-invalid-todostates
'("WAIT" "NEXT")
"projects cannot have these todostates")
(defconst nd/project-statuscodes
(defconst nd/project-statuscodes
'(:archivable
:complete
:stuck
@ -820,27 +820,27 @@ Returns t if heading has certain relationship to other headings
:invalid-todostate
:scheduled-project)
"list of statuscodes to be used in assessing projects
Note they are listed in order of priority (eg items further
down the list override higher items")
Note they are listed in order of priority (eg items further
down the list override higher items")
(defmacro nd/compare-statuscodes (operator statuscode-1 statuscode-2)
(defmacro nd/compare-statuscodes (operator statuscode-1 statuscode-2)
"syntactic suger to compare statuscodes by position"
`(,operator (position ,statuscode-1 nd/project-statuscodes)
(position ,statuscode-2 nd/project-statuscodes)))
(defun nd/status< (statuscode-1 statuscode-2)
(defun nd/status< (statuscode-1 statuscode-2)
"returns t is statuscode-1 is lesser priority than statuscode-2"
(nd/compare-statuscodes < statuscode-1 statuscode-2))
(defun nd/status> (statuscode-1 statuscode-2)
(defun nd/status> (statuscode-1 statuscode-2)
"returns t is statuscode-1 is greater priority than statuscode-2"
(nd/compare-statuscodes > statuscode-1 statuscode-2))
(defun nd/status= (statuscode-1 statuscode-2)
(defun nd/status= (statuscode-1 statuscode-2)
"returns t is statuscode-1 is equal priority than statuscode-2"
(nd/compare-statuscodes = statuscode-1 statuscode-2))
(defun nd/descend-into-project ()
(defun nd/descend-into-project ()
"returns statuscode of project and recursively descends into subprojects"
(let ((project-state :archivable)
(previous-point))
@ -889,17 +889,17 @@ Returns t if heading has certain relationship to other headings
(org-forward-heading-same-level 1 t)))
project-state))
(defmacro nd/is-project-keyword-status-p (test-keyword operator statuscode)
(defmacro nd/is-project-keyword-status-p (test-keyword operator statuscode)
"tests if a project has toplevel heading of top-keyword and
child status equal to status code and returns keyword if
both are true"
child status equal to status code and returns keyword if
both are true"
`(and
(equal ,keyword ,test-keyword)
(nd/compare-statuscodes ,operator (nd/descend-into-project) ,statuscode)))
(defun nd/is-project-status-p (statuscode)
(defun nd/is-project-status-p (statuscode)
"Returns t if project matches statuscode given.
Note that this assumes the headline being tested is a valid project"
Note that this assumes the headline being tested is a valid project"
(case statuscode
;; projects closed more than 30 days ago
;; note CANC overrides all subtasks/projects
@ -1213,18 +1213,18 @@ Note that this is used for "normal" projects as well as iterators
#+END_SRC
*** custom commands
#+BEGIN_SRC emacs-lisp
(setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-prefix-format
'((agenda . " %-12:c%-7:e%?-12t% s")
(setq org-agenda-prefix-format
'((agenda . " %-12:c %-5:e %?-12t% s")
(timeline . " % s")
(todo . " %-12:c")
(tags . " %-12:c%-7:e")
(tags . " %-12:c %-5:e ")
(search . " %-12:c")))
(defconst nd/org-agenda-todo-sort-order '("NEXT" "WAIT" "HOLD" "TODO"))
(defconst nd/org-agenda-todo-sort-order '("NEXT" "WAIT" "HOLD" "TODO"))
(setq org-agenda-cmp-user-defined
(setq org-agenda-cmp-user-defined
'(lambda (a b)
(let ((pa (- (length (member
(get-text-property 1 'todo-state a)
@ -1236,14 +1236,14 @@ Note that this is used for "normal" projects as well as iterators
((> pa pb) +1)
((< pa pb) -1)))))
(defun nd/agenda-base-header-command (match header skip-fun)
(defun nd/agenda-base-header-command (match header skip-fun)
`(tags
,match
((org-agenda-overriding-header ,header)
(org-agenda-skip-function ,skip-fun)
(org-agenda-sorting-strategy '(category-keep)))))
(defun nd/agenda-base-task-command (match header skip-fun &optional sort)
(defun nd/agenda-base-task-command (match header skip-fun &optional sort)
(or sort (setq sort ''(category-keep)))
`(tags-todo
,match
@ -1252,7 +1252,7 @@ Note that this is used for "normal" projects as well as iterators
(org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy ,sort))))
(defun nd/agenda-base-project-command (match header statuscode)
(defun nd/agenda-base-project-command (match header statuscode)
`(tags
,match
((org-agenda-overriding-header
@ -1260,7 +1260,7 @@ Note that this is used for "normal" projects as well as iterators
(org-agenda-skip-function '(nd/skip-projects-without-statuscode ,statuscode))
(org-agenda-sorting-strategy '(category-keep)))))
(let ((task-match "-NA-REFILE-%inc-PARENT_TYPE=\"periodical\"/")
(let ((task-match "-NA-REFILE-%inc-PARENT_TYPE=\"periodical\"/")
(project-match "-NA-REFILE-%inc-PARENT_TYPE=\"periodical\"-PARENT_TYPE=\"iterator\"/")
(periodical-match "-NA-REFILE+PARENT_TYPE=\"periodical\"-PARENT_TYPE=\"iterator\"/")
(iterator-match "-NA-REFILE-PARENT_TYPE=\"periodical\"+PARENT_TYPE=\"iterator\"/"))
@ -1312,8 +1312,8 @@ Note that this is used for "normal" projects as well as iterators
"Non-critical Errors"
(,(nd/agenda-base-header-command task-match "Undone Closed" ''nd/skip-non-undone-closed-todoitems)
,(nd/agenda-base-header-command task-match "Done Unclosed" ''nd/skip-non-done-unclosed-todoitems)
,(nd/agenda-base-project-command project-match "Undone Completed" :undone-complete)
,(nd/agenda-base-project-command project-match "Done Incompleted" :done-incomplete)))
,(nd/agenda-base-project-command task-match "Undone Completed" :undone-complete)
,(nd/agenda-base-project-command task-match "Done Incompleted" :done-incomplete)))
("A"
"Archivable Tasks and Projects"
(,(nd/agenda-base-header-command task-match "Archivable Atomic Tasks" ''nd/skip-non-archivable-atomic-tasks)
@ -1325,11 +1325,12 @@ Note that this is used for "normal" projects as well as iterators
*** views
**** calendar display
#+BEGIN_SRC emacs-lisp
(setq org-agenda-start-on-weekday 0)
(setq org-agenda-span 'day)
(setq org-agenda-time-grid (quote ((daily today remove-match)
#("----------------" 0 16 (org-heading t))
(0900 1100 1300 1500 1700))))
(setq org-agenda-start-on-weekday 0)
(setq org-agenda-span 'day)
(setq org-agenda-current-time-string "### -- NOW -- ###")
(setq org-agenda-time-grid '((daily today remove-match)
(0800 1000 1200 1200 1400 1600)
"......" "-----------------"))
#+End_src
**** right align tags
the agenda does not do this by default...it's annoying