[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-superstar 806b699b7d 149/162: Merge branch 'master' in
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/org-superstar 806b699b7d 149/162: Merge branch 'master' into volatile |
Date: |
Fri, 31 Dec 2021 19:35:39 -0500 (EST) |
branch: elpa/org-superstar
commit 806b699b7d5e79acd184b328ba039d5a1cb18beb
Merge: 3c973ce35d 6cdb79e5fa
Author: D. Williams <d.williams@posteo.net>
Commit: D. Williams <d.williams@posteo.net>
Merge branch 'master' into volatile
---
org-superstar.el | 62 +++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 43 insertions(+), 19 deletions(-)
diff --git a/org-superstar.el b/org-superstar.el
index 8f661af836..1aead5f82c 100644
--- a/org-superstar.el
+++ b/org-superstar.el
@@ -154,17 +154,27 @@ are not included in the alist are handled like normal
headings.
Alternatively, each alist element may be a proper list of the form
\(KEYWORD COMPOSE-STRING CHARACTER [REST...])
-where KEYWORD should be a TODO keyword, and COMPOSE-STRING should
-be a string according to the rules of the third argument of
-‘compose-region’. It will be used to compose the specific TODO
-item bullet. CHARACTER is the fallback character used in
-terminal displays, where composing characters cannot be relied
-upon. See also ‘org-superstar-leading-fallback’.
+where KEYWORD should be a TODO keyword (a string), and
+COMPOSE-STRING should be a string according to the rules of the
+third argument of ‘compose-region’. It will be used to compose
+the specific TODO item bullet. CHARACTER is the fallback
+character used in terminal displays, where composing characters
+cannot be relied upon. See also
+‘org-superstar-leading-fallback’.
+
+KEYWORD may also be the symbol ‘default’ instead of a string. In
+this case, this bullet is used for all TODO unspecified keywords.
You should call ‘org-superstar-restart’ after changing this
variable for your changes to take effect."
:group 'org-superstar
- :type '(alist :key-type (string :format "TODO keyword: %v")
+ :type '(alist :key-type
+ (choice :format "%[Toggle%] %v\n"
+ (string :tag "Bullet for (custom) TODO keyword"
+ :format "TODO keyword: %v")
+ (const :tag "Default TODO keyword"
+ :format "Default TODO keyword: %v"
+ default))
:value-type
(choice
(character :value ?◉
@@ -488,26 +498,40 @@ If no TODO property is found, return nil."
(when (stringp todo-property)
todo-property))))
+(defun org-superstar--todo-assoc (todo-kw)
+ "Obtain alist entry for the string keyword TODO-KW.
+
+If TODO-KW has no explicit entry in the alist
+‘org-superstar-todo-bullet-alist’, but there is an entry for the
+symbol ‘default’, return it instead. Otherwise, return nil."
+ (or
+ (assoc todo-kw
+ org-superstar-todo-bullet-alist
+ ;; I would use assoc-string, but then I'd have to deal with
+ ;; what to do should the user create a TODO keyword
+ ;; "default" for some forsaken reason.
+ (lambda (x y) (and (stringp x)
+ (string= x y))))
+ (assq 'default
+ org-superstar-todo-bullet-alist)))
+
(defun org-superstar--todo-bullet ()
"Return the desired TODO item bullet, if defined.
If no entry can be found in ‘org-superstar-todo-bullet-alist’ for
the current keyword, return nil."
- (let* ((todo-kw
- (org-superstar--get-todo (match-beginning 0)))
- (todo-bullet
- (assoc-string todo-kw
- org-superstar-todo-bullet-alist))
- (todo-bullet (cdr todo-bullet))
- (todo-fallback nil))
+ (when-let* ((todo-kw
+ (org-superstar--get-todo (match-beginning 0)))
+ (todo-bullet
+ (cdr (org-superstar--todo-assoc todo-kw))))
(cond
((characterp todo-bullet)
todo-bullet)
((listp todo-bullet)
- (setq todo-fallback (cadr todo-bullet))
- (setq todo-bullet (car todo-bullet))
- (if (org-superstar-graphic-p)
- todo-bullet
- todo-fallback)))))
+ (let ((todo-fallback (cadr todo-bullet))
+ (todo-bullet (car todo-bullet)))
+ (if (org-superstar-graphic-p)
+ todo-bullet
+ todo-fallback))))))
(defun org-superstar--hbullets-length ()
"Return the length of ‘org-superstar-headline-bullets-list’."
- [nongnu] elpa/org-superstar 27e90eece5 124/162: Implement org-indent compatibility, (continued)
- [nongnu] elpa/org-superstar 27e90eece5 124/162: Implement org-indent compatibility, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 48660e9269 120/162: Updated news regarding Doom and Spacemacs, updated FAQ., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar cfb98c0de6 123/162: updating .gitignore, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 6673412725 132/162: Updating README to signify changes, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 2800b83e88 133/162: Version Bump., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 7f83636db2 136/162: Update README for absolutely astonishing 33k+ dls on MELPA, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar a5af8b6ddf 141/162: Remove example files from #21., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 417b81772a 147/162: Support defining a default TODO bullet, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 3efb5f76cb 146/162: Allow hiding leading bullet for all todo keywords, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 6cdb79e5fa 148/162: Bugfix: Stop interpreting normal headings as TODO items., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 806b699b7d 149/162: Merge branch 'master' into volatile,
Stefan Kangas <=
- [nongnu] elpa/org-superstar 251b203b58 153/162: Update (C)opyright., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 9ac640d620 154/162: Avoid positional args in define-minor-mode, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 82440ccda4 155/162: Avoid empty font-lock keyword if inlinetask first bullet is not used, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 8077107c9f 157/162: improve code of disabling org-superstar in source code block, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 1bd93f9382 158/162: Merge pull request #30 from leungbk/define-minor-mode, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar c81cf4b8ec 050/162: added a minor sample file for new TODO key feature, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar d52497056f 118/162: Update issue templates: add feature related templates, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 3c973ce35d 145/162: Remove spurious package versioning info., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 9d64c42e50 152/162: Updated README., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar af91ebb24a 159/162: Merge branch 'volatile', Stefan Kangas, 2021/12/31