more cleaning

This commit is contained in:
petrucci4prez 2018-05-19 15:09:15 -04:00
parent a574085746
commit 3f55f7bac0
2 changed files with 98 additions and 102 deletions

View File

@ -312,8 +312,6 @@ event of an error or nonlocal exit."
(advice-add #'org-fast-tag-selection :around #'nd/org-tag-window-advice) (advice-add #'org-fast-tag-selection :around #'nd/org-tag-window-advice)
;;(add-hook 'org-capture-mode-hook 'evil-append)
(setq org-src-window-setup 'current-window) (setq org-src-window-setup 'current-window)
(setq org-src-fontify-natively t) (setq org-src-fontify-natively t)
(setq org-edit-src-content-indentation 0) (setq org-edit-src-content-indentation 0)
@ -350,12 +348,12 @@ event of an error or nonlocal exit."
(sequence "WAIT(w@/!)" "HOLD(h@/!)" "|" "CANC(c@/!)"))) (sequence "WAIT(w@/!)" "HOLD(h@/!)" "|" "CANC(c@/!)")))
(setq org-todo-keyword-faces (setq org-todo-keyword-faces
(quote (("TODO" :foreground "light coral" :weight bold) '(("TODO" :foreground "light coral" :weight bold)
("NEXT" :foreground "khaki" :weight bold) ("NEXT" :foreground "khaki" :weight bold)
("DONE" :foreground "light green" :weight bold) ("DONE" :foreground "light green" :weight bold)
("WAIT" :foreground "orange" :weight bold) ("WAIT" :foreground "orange" :weight bold)
("HOLD" :foreground "violet" :weight bold) ("HOLD" :foreground "violet" :weight bold)
("CANC" :foreground "deep sky blue" :weight bold)))) ("CANC" :foreground "deep sky blue" :weight bold)))
(defun nd/filter-list-prefix (prefix str-list) (defun nd/filter-list-prefix (prefix str-list)
"Return a subset of tags-list whose first character matches prefix.' "Return a subset of tags-list whose first character matches prefix.'

View File

@ -288,6 +288,16 @@ event of an error or nonlocal exit."
`(advice-remove ,(car adform) ,(nth 2 adform))) `(advice-remove ,(car adform) ,(nth 2 adform)))
adlist)))) adlist))))
#+END_SRC #+END_SRC
** functions
#+BEGIN_SRC emacs-lisp
(defun nd/filter-list-prefix (prefix str-list)
"Return a subset of tags-list whose first character matches prefix.'
tags-list defaults to org-tag-alist if not given"
(seq-filter (lambda (i)
(and (stringp i)
(string-prefix-p prefix i)))
str-list))
#+END_SRC
* custom functions * custom functions
** follow window splitting ** follow window splitting
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -392,10 +402,10 @@ event of an error or nonlocal exit."
* org-mode * org-mode
** basic ** basic
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-log-done t) (setq org-log-done t)
(setq org-startup-indented t) (setq org-startup-indented t)
(delight 'org-indent-mode) (delight 'org-indent-mode)
(setq org-directory "~/Org") (setq org-directory "~/Org")
#+END_SRC #+END_SRC
** ui ** ui
*** bullets *** bullets
@ -423,7 +433,7 @@ Org mode is great and all, but the windows never show up in the right place
**** todo selection **** todo selection
I only need a teeny tiny window below my current window for todo selection I only need a teeny tiny window below my current window for todo selection
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun nd/org-todo-position (buffer alist) (defun nd/org-todo-position (buffer alist)
(let ((win (car (cl-delete-if-not (let ((win (car (cl-delete-if-not
(lambda (window) (lambda (window)
(with-current-buffer (window-buffer window) (with-current-buffer (window-buffer window)
@ -435,7 +445,7 @@ I only need a teeny tiny window below my current window for todo selection
(set-window-buffer new buffer) (set-window-buffer new buffer)
new)))) new))))
(defun nd/org-todo-window-advice (orig-fn) (defun nd/org-todo-window-advice (orig-fn)
"Advice to fix window placement in `org-fast-todo-selection'." "Advice to fix window placement in `org-fast-todo-selection'."
(let ((override '("\\*Org todo\\*" nd/org-todo-position))) (let ((override '("\\*Org todo\\*" nd/org-todo-position)))
(add-to-list 'display-buffer-alist override) (add-to-list 'display-buffer-alist override)
@ -445,12 +455,12 @@ I only need a teeny tiny window below my current window for todo selection
(setq display-buffer-alist (setq display-buffer-alist
(delete override display-buffer-alist)))))) (delete override display-buffer-alist))))))
(advice-add #'org-fast-todo-selection :around #'nd/org-todo-window-advice) (advice-add #'org-fast-todo-selection :around #'nd/org-todo-window-advice)
#+END_SRC #+END_SRC
**** tag selection **** tag selection
By default, the tag selection window obliterates all but the current window...how disorienting :/ By default, the tag selection window obliterates all but the current window...how disorienting :/
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun nd/org-tag-window-advice (orig-fn current inherited table &optional todo-table) (defun nd/org-tag-window-advice (orig-fn current inherited table &optional todo-table)
"Advice to fix window placement in `org-fast-tags-selection'." "Advice to fix window placement in `org-fast-tags-selection'."
(nd/with-advice (nd/with-advice
((#'delete-other-windows :override #'ignore) ((#'delete-other-windows :override #'ignore)
@ -459,11 +469,7 @@ By default, the tag selection window obliterates all but the current window...ho
(split-window-below (or size -9))))) (split-window-below (or size -9)))))
(unwind-protect (funcall orig-fn current inherited table todo-table)))) (unwind-protect (funcall orig-fn current inherited table todo-table))))
(advice-add #'org-fast-tag-selection :around #'nd/org-tag-window-advice) (advice-add #'org-fast-tag-selection :around #'nd/org-tag-window-advice)
#+END_SRC
** evil modes
#+BEGIN_SRC emacs-lisp
;;(add-hook 'org-capture-mode-hook 'evil-append)
#+END_SRC #+END_SRC
** src ** src
*** basic *** basic
@ -511,19 +517,19 @@ By default, the tag selection window obliterates all but the current window...ho
** todo states ** todo states
*** sequences *** sequences
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-todo-keywords (setq org-todo-keywords
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)") '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
(sequence "WAIT(w@/!)" "HOLD(h@/!)" "|" "CANC(c@/!)"))) (sequence "WAIT(w@/!)" "HOLD(h@/!)" "|" "CANC(c@/!)")))
#+END_SRC #+END_SRC
*** colors *** colors
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-todo-keyword-faces (setq org-todo-keyword-faces
(quote (("TODO" :foreground "light coral" :weight bold) '(("TODO" :foreground "light coral" :weight bold)
("NEXT" :foreground "khaki" :weight bold) ("NEXT" :foreground "khaki" :weight bold)
("DONE" :foreground "light green" :weight bold) ("DONE" :foreground "light green" :weight bold)
("WAIT" :foreground "orange" :weight bold) ("WAIT" :foreground "orange" :weight bold)
("HOLD" :foreground "violet" :weight bold) ("HOLD" :foreground "violet" :weight bold)
("CANC" :foreground "deep sky blue" :weight bold)))) ("CANC" :foreground "deep sky blue" :weight bold)))
#+END_SRC #+END_SRC
** tags ** tags
I use tags for agenda filtering. Very fast and simple. I use tags for agenda filtering. Very fast and simple.
@ -536,24 +542,16 @@ There are several types of tags I use:
- attribute: useful flags for filtering; these start with "%" - attribute: useful flags for filtering; these start with "%"
- life areas: key areas of life which define priorities and goals; these start with "_" - life areas: key areas of life which define priorities and goals; these start with "_"
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun nd/filter-list-prefix (prefix str-list) (defun nd/add-tag-face (fg-name prefix)
"Return a subset of tags-list whose first character matches prefix.'
tags-list defaults to org-tag-alist if not given"
(seq-filter (lambda (i)
(and (stringp i)
(string-prefix-p prefix i)))
str-list))
(defun nd/add-tag-face (fg-name prefix)
"Adds list of cons cells to org-tag-faces with foreground set to fg-name. "Adds list of cons cells to org-tag-faces with foreground set to fg-name.
Start and end specify the positions in org-tag-alist which define the tags Start and end specify the positions in org-tag-alist which define the tags
to which the faces are applied" to which the faces are applied"
(dolist (tag (nd/filter-list-prefix prefix (mapcar #'car org-tag-alist))) (dolist (tag (nd/filter-list-prefix prefix (mapcar #'car org-tag-alist)))
(push `(,tag . (:foreground ,fg-name)) org-tag-faces))) (push `(,tag . (:foreground ,fg-name)) org-tag-faces)))
;; for some reason, most special chars don't really ;; for some reason, most special chars don't really
;; work in org-tag-alist, only #, @, %, and _ ;; work in org-tag-alist, only #, @, %, and _
(setq org-tag-alist (setq org-tag-alist
'((:startgroup) '((:startgroup)
("@errand" . ?e) ("@errand" . ?e)
("@home" . ?h) ("@home" . ?h)
@ -580,12 +578,12 @@ There are several types of tags I use:
("_soc" . ?S) ("_soc" . ?S)
(:endgroup))) (:endgroup)))
(setq org-tag-faces '()) (setq org-tag-faces '())
(nd/add-tag-face "PaleGreen" "@") (nd/add-tag-face "PaleGreen" "@")
(nd/add-tag-face "SkyBlue" "#") (nd/add-tag-face "SkyBlue" "#")
(nd/add-tag-face "PaleGoldenrod" "%") (nd/add-tag-face "PaleGoldenrod" "%")
(nd/add-tag-face "violet" "_") (nd/add-tag-face "violet" "_")
#+END_SRC #+END_SRC
** properties ** properties