[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-superstar e59514a287 055/162: implementing first draft
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/org-superstar e59514a287 055/162: implementing first draft version of invisible leading bullets |
Date: |
Fri, 31 Dec 2021 19:35:24 -0500 (EST) |
branch: elpa/org-superstar
commit e59514a28761fc8767e19cc77402349cf8472ab6
Author: D. Williams <d.williams@posteo.net>
Commit: D. Williams <d.williams@posteo.net>
implementing first draft version of invisible leading bullets
Version bump to 0.5.0
Added --make-invisible to deal with setting invisibility.
Updated font-lock-keywords generation.
Added needed function calls for buffer-invisibility-spec.
---
org-superstar.el | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/org-superstar.el b/org-superstar.el
index 192557c8af..bed8f9cae6 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.4.1
+;; Version: 0.5.0
;; Homepage: https://github.com/dw-github-mirror/org-superstar-mode
;; Package-Requires: ((org "9.1.9") (emacs "26.2"))
@@ -508,7 +508,6 @@ prettifying bullets in (for example) source blocks."
((org-superstar-inlinetask-p)
'org-inlinetask)))
-
(defun org-superstar--prettify-leading-hbullets ()
"Prettify the leading bullets of a header line.
Unless ‘org-hide-leading-stars’ is non-nil, each leading star is
@@ -529,6 +528,16 @@ prettifying bullets in (for example) source blocks."
(org-superstar--lbullet)))
'org-superstar-leading)))
+(defun org-superstar--make-invisible (subexp)
+ "Make part of the text matched by the last search invisible.
+SUBEXP, a number, specifies which parenthesized expression in the
+last regexp. If there is no SUBEXPth pair, do nothing."
+ (let ((start (match-beginning subexp))
+ (end (match-end subexp)))
+ (when start
+ (add-text-properties
+ start end '(invisible org-superstar-hide)))))
+
(defun org-superstar--unprettify-hbullets ()
"Revert visual tweaks made to header bullets in current buffer."
(save-excursion
@@ -554,11 +563,15 @@ routines of ‘\\[org-superstar-mode]’."
(1 (org-superstar--prettify-ibullets)))))
("^\\(?3:\\**?\\)\\(?2:\\*?\\)\\(?1:\\*\\) "
(1 (org-superstar--prettify-main-hbullet) prepend)
- ,@(unless org-hide-leading-stars
+ ,@(unless (or org-hide-leading-stars
+ org-superstar-remove-leading-stars)
'((3 (org-superstar--prettify-leading-hbullets)
t)
(2 (org-superstar--prettify-other-lbullet)
t)))
+ ,@(when org-superstar-remove-leading-stars
+ '((3 (org-superstar--make-invisible 3))
+ (2 (org-superstar--make-invisible 2))))
,@(when (featurep 'org-inlinetask)
'((2 (org-superstar--prettify-other-hbullet)
prepend)))
@@ -583,12 +596,15 @@ routines of ‘\\[org-superstar-mode]’."
:require 'org
(cond
(org-superstar-mode
+ ;;TODO: do not allow this mode outside of org
(font-lock-remove-keywords nil org-superstar--font-lock-keywords)
(org-superstar--update-font-lock-keywords)
(font-lock-add-keywords nil org-superstar--font-lock-keywords
'append)
- (org-superstar--fontify-buffer))
+ (org-superstar--fontify-buffer)
+ (add-to-invisibility-spec '(org-superstar-hide)))
(t
+ (remove-from-invisibility-spec '(org-superstar-hide))
(font-lock-remove-keywords nil org-superstar--font-lock-keywords)
(setq org-superstar--font-lock-keywords
(default-value 'org-superstar--font-lock-keywords))
- [nongnu] elpa/org-superstar db21c0f07e 037/162: removing already moved file. git is weird., (continued)
- [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
- [nongnu] elpa/org-superstar e59514a287 055/162: implementing first draft version of invisible leading bullets,
Stefan Kangas <=
- [nongnu] elpa/org-superstar db2e27d68a 049/162: Adding first draft of TODO item support., Stefan Kangas, 2021/12/31
- [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