1
0
Fork 0

Fix generation of todo keyword and tag faces

This commit is contained in:
Tom Willemse 2020-08-05 10:15:32 -07:00
parent 5145f6f340
commit 68e1de0ecb

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2020.0714.095527
;; Version: 2020.0805.092134
;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org-plus-contrib org-bullets org-edna diminish all-the-icons org-roam)
;; This program is free software; you can redistribute it and/or modify
@ -35,6 +35,7 @@
(require 'org-clock)
(require 'org-edna)
(require 'org-element)
(require 'org-faces)
(require 'org-habit)
(require 'org-roam)
(require 'subr-x)
@ -140,21 +141,23 @@ After running it once remove it from `org-capture-after-finalize-hook'."
(defun oni-org-generate-todo-keyword-faces ()
"Create faces for all todo keywords in the current buffer."
(when-let ((keywords (cl-remove-if (lambda (tag) (assoc tag org-todo-keyword-faces))
org-todo-keywords-1)))
(append org-todo-keyword-faces
(mapcar (lambda (keyword) (cons keyword (oni-org-color-for keyword)))
keywords))))
(if-let ((keywords (cl-remove-if (lambda (tag) (assoc tag org-todo-keyword-faces))
org-todo-keywords-1)))
(append org-todo-keyword-faces
(mapcar (lambda (keyword) (cons keyword (oni-org-color-for keyword)))
keywords))
org-todo-keyword-faces))
(defun oni-org-generate-tag-faces ()
"Create faces for all the tags in the current buffer."
(when-let ((tags (cl-remove-if (lambda (tag) (assoc (car tag) org-tag-faces))
(org-get-buffer-tags))))
(append org-tag-faces
(mapcar (lambda (tag)
(let ((tag (car tag)))
(cons tag (oni-org-color-for tag))))
tags))))
(if-let ((tags (cl-remove-if (lambda (tag) (assoc (car tag) org-tag-faces))
(org-get-buffer-tags))))
(append org-tag-faces
(mapcar (lambda (tag)
(let ((tag (car tag)))
(cons tag (oni-org-color-for tag))))
tags))
org-tag-faces))
(defun oni-org-set-todo-keyword-faces ()
"Set org-todo-keyword-faces to all different colors."