[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-superstar da32880de2 047/162: Honor org-odd-levels-onl
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/org-superstar da32880de2 047/162: Honor org-odd-levels-only when computing heading levels. |
Date: |
Fri, 31 Dec 2021 19:35:23 -0500 (EST) |
branch: elpa/org-superstar
commit da32880de2ba5aecea1ade9b37de7379f19db4fe
Author: D. Williams <d.williams@posteo.net>
Commit: D. Williams <d.williams@posteo.net>
Honor org-odd-levels-only when computing heading levels.
Idea taken from org-bullets (c19b13b).
Added new function --get-TODO to access org TODO keywords.
Added a simple sample file for odd levels.
---
org-superstar.el | 14 ++++++++++----
tests/sample-odd.org | 9 +++++++++
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/org-superstar.el b/org-superstar.el
index db75f9dff6..65d91dba55 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: 0.2.0
+;; Version: 0.3.0
;; Homepage: https://github.com/dw-github-mirror/org-superstar-mode
;; Package-Requires: ((org "9.1.9") (emacs "26.2"))
@@ -305,6 +305,14 @@ function for your changes to take effect."
;;; Accessor Functions
+(defun org-superstar--get-TODO (pom)
+ "Return the TODO keyword at point or marker POM.
+If no TODO property is found, return nil."
+ (let ((todo-property
+ (cdar (org-entry-properties pom "TODO"))))
+ (when (stringp todo-property)
+ todo-property)))
+
(defun org-superstar--hbullets ()
"Return the length of ‘org-superstar-headline-bullets-list’."
(length org-superstar-headline-bullets-list))
@@ -314,7 +322,7 @@ function for your changes to take effect."
See also ‘org-superstar-cycle-headline-bullets’."
(let ((max-bullets org-superstar-cycle-headline-bullets)
- (n (1- level)))
+ (n (if org-odd-levels-only (/ (1- level) 2) (1- level))))
(string-to-char
(cond ((integerp max-bullets)
(elt org-superstar-headline-bullets-list
@@ -463,8 +471,6 @@ prettifying bullets in (for example) source blocks."
(org-superstar--lbullet)))
'org-superstar-leading)))
-
-
(defun org-superstar--unprettify-hbullets ()
"Revert visual tweaks made to header bullets in current buffer."
(save-excursion
diff --git a/tests/sample-odd.org b/tests/sample-odd.org
new file mode 100644
index 0000000000..7a280c5157
--- /dev/null
+++ b/tests/sample-odd.org
@@ -0,0 +1,9 @@
+#+TITLE: Sample File
+#+STARTUP: odd
+#+STARTUP: showeverything
+* 1
+*** 2
+***** 3
+******* 4
+********* 5
+*********** 6
- [nongnu] elpa/org-superstar 8fd1d05c6c 013/162: Added wrapper around org-list-in-valid-context-p for refinement purposes, (continued)
- [nongnu] elpa/org-superstar 8fd1d05c6c 013/162: Added wrapper around org-list-in-valid-context-p for refinement purposes, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 54811604be 012/162: adding new sample image, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 070360a2d2 009/162: Formatting changes to adhere more closely to coding conventions., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 6143af17ed 015/162: updating .gitignore to skip .dir-locals.el, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar b72da86641 014/162: added image to README, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 59391390df 056/162: Added support for making leading stars invisible., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 7e2ca95932 033/162: added new, more modular sample inputs for incoming unit testing, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar d6071eb477 071/162: Updating README to fit first major version (1.0.0), Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar c3de9e52a8 035/162: adding reference files in faceup format, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 4517690c41 021/162: Copied description from README, added more UTF8 bullet hints., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar da32880de2 047/162: Honor org-odd-levels-only when computing heading levels.,
Stefan Kangas <=
- [nongnu] elpa/org-superstar db21c0f07e 037/162: removing already moved file. git is weird., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar d04eb018fd 060/162: Moved old announcements to the bottom of the README., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 92336ba0fe 054/162: added a new variable for upcoming feature: remove-leading-stars, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar c9f1406645 067/162: forgot quote, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar bd36b34d93 066/162: further minimized test slomode.el, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 6fcf4b58fb 059/162: Treat org-hide-leading-stars-before-indent-mode like the base variable., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 377ad5af7b 051/162: Preparing documentation for new release, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar d2f03b9666 041/162: removed spurious whitespace, Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 6089c47f8b 031/162: Major cleanup: fix fontification edge cases, remove redundant variables., Stefan Kangas, 2021/12/31
- [nongnu] elpa/org-superstar 212cf5821e 063/162: Version bump to signify patch., Stefan Kangas, 2021/12/31