[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-superstar bb560c6f7b 143/162: Add new feature: Conditi
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/org-superstar bb560c6f7b 143/162: Add new feature: Conditionally hide TODO bullets. |
Date: |
Fri, 31 Dec 2021 19:35:38 -0500 (EST) |
branch: elpa/org-superstar
commit bb560c6f7bde114493135ded1d923b884a89e567
Author: D. Williams <d.williams@posteo.net>
Commit: D. Williams <d.williams@posteo.net>
Add new feature: Conditionally hide TODO bullets.
---
org-superstar.el | 52 +++++++++++++++++++++++++++++++---------------------
1 file changed, 31 insertions(+), 21 deletions(-)
diff --git a/org-superstar.el b/org-superstar.el
index ae68256238..1bebf3d2c9 100644
--- a/org-superstar.el
+++ b/org-superstar.el
@@ -5,7 +5,7 @@
;; Author: D. Williams <d.williams@posteo.net>
;; Maintainer: D. Williams <d.williams@posteo.net>
;; Keywords: faces, outlines
-;; Version: 1.4.0
+;; Version: 1.5.0
;; Homepage: https://github.com/integral-dw/org-superstar-mode
;; Package-Requires: ((org "9.1.9") (emacs "26.1"))
@@ -178,10 +178,10 @@ variable for your changes to take effect."
:format "Bullet character: %v\n"
:tag "Simple bullet character")
(list :tag "Advanced string and fallback"
- (string :value "◉"
- :format "String of characters to compose: %v")
- (character :value ?◉
- :format "Fallback character for terminal:
%v\n")))))
+ (string :value "◉"
+ :format "String of characters to compose: %v")
+ (character :value ?◉
+ :format "Fallback character for terminal:
%v\n")))))
(defun org-superstar--set-fbullet (symbol value)
"Set SYMBOL ‘org-superstar-first-inlinetask-bullet’ to VALUE.
@@ -372,9 +372,15 @@ Instead of displaying bullets corresponding to TODO items
according to ‘org-superstar-headline-bullets-list’ (dependent on
the headline’s level), display a bullet according to
‘org-superstar-todo-bullet-alist’ (dependent on the TODO
-keyword)."
+keyword).
+
+If set to the symbol ‘hide’, hide the leading bullet entirely
+instead."
:group 'org-superstar
- :type 'boolean)
+ :type '(choice
+ (const :tag "Enable special TODO item bullets" t)
+ (const :tag "Disable special TODO item bullets" nil)
+ (const :tag "Hide TODO item bullets altogether" hide)))
(defvar-local org-superstar-lightweight-lists nil
"Non-nil means circumvent expensive calls to ‘org-superstar-plain-list-p’.
@@ -500,15 +506,15 @@ the current keyword, return nil."
org-superstar-todo-bullet-alist))
(todo-bullet (cdr todo-bullet))
(todo-fallback nil))
- (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)))))
+ (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)))))
(defun org-superstar--hbullets-length ()
"Return the length of ‘org-superstar-headline-bullets-list’."
@@ -535,7 +541,9 @@ See also ‘org-superstar-cycle-headline-bullets’."
(n (if org-odd-levels-only (/ (1- level) 2) (1- level)))
(todo-bullet (when org-superstar-special-todo-items
(org-superstar--todo-bullet))))
- (cond (todo-bullet)
+ (cond (todo-bullet
+ (unless (eq org-superstar-special-todo-items 'hide)
+ todo-bullet))
((integerp max-bullets)
(org-superstar--nth-headline-bullet (% n max-bullets)))
(max-bullets
@@ -658,10 +666,12 @@ prettifying bullets in (for example) source blocks."
This function uses ‘org-superstar-headline-or-inlinetask-p’ to avoid
prettifying bullets in (for example) source blocks."
(when (org-superstar-headline-or-inlinetask-p)
- (let ((level (org-superstar--heading-level)))
- (compose-region (match-beginning 1) (match-end 1)
- (org-superstar--hbullet level))))
- 'org-superstar-header-bullet)
+ (let ((bullet (org-superstar--hbullet (org-superstar--heading-level))))
+ (if bullet
+ (compose-region (match-beginning 1) (match-end 1)
+ bullet)
+ (org-superstar--make-invisible 1)))
+ 'org-superstar-header-bullet))
(defun org-superstar--prettify-other-hbullet ()
"Prettify the second last star in a headline.
- [nongnu] elpa/org-superstar 95ad994f82 072/162: fixed typo, (continued)
- [nongnu] elpa/org-superstar 95ad994f82 072/162: fixed typo, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 2f9f9d6b21 070/162: version bump to 1.0.0, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 61bf289b42 073/162: Removed no longer needed temporary testing file., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 31c8dc54a9 082/162: updating README to reflect addition to MELPA, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 7a33a131a2 095/162: Removed MWE file issue-10.org, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 4659cfc120 103/162: Adding a helpful trick to the README., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 9f86f5aa22 106/162: Add a new point to the FAQ discussing what remains of Issue #10., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar dd9e24efb2 116/162: Added a reference for bullet resources, addressing PR #18., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar bf6ea02aa1 139/162: Update issue templates, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar b13c994bca 144/162: Update README, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar bb560c6f7b 143/162: Add new feature: Conditionally hide TODO bullets.,
Stefan Kangas <=
- [nongnu] elpa/org-superstar dcb6c56d50 027/162: fixed spurious compose-region for empty regions (level 1 headers), Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 1741f6eed8 053/162: Fixed custom interface of special-todo-items, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar d17d10c443 044/162: updated README, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar c6b8bd604f 023/162: marked update in roadmap, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar c0dacd8562 052/162: updated README to reflect new version, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar d94e141c36 069/162: Added a REVIEW marker., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 8a6215a10f 084/162: Merge pull request #6 from progfolio/fix-org-superstar-restart-docstring, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 092de74fb9 099/162: Fixed typo in README., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar f75220cd2d 089/162: Downgrade version requirements, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 3fbfc0a47e 092/162: Merge pull request #11 from integral-dw/issue-10, Stefan Kangas, 2021/12/31