emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-present 140a8c3a34 01/12: feat: Add a toggle for wheth


From: ELPA Syncer
Subject: [nongnu] elpa/org-present 140a8c3a34 01/12: feat: Add a toggle for whether to hide stars in headings
Date: Sat, 6 Aug 2022 14:58:55 -0400 (EDT)

branch: elpa/org-present
commit 140a8c3a34fdd9bb91da0d1c2717e82d31475da8
Author: Keith Pinson <keith.pinson@banno.com>
Commit: Keith Pinson <keith.pinson@banno.com>

    feat: Add a toggle for whether to hide stars in headings
    
    Switch ' to #' in a couple of places to get more help from the compiler, 
per:
    https://endlessparentheses.com/get-in-the-habit-of-using-sharp-quote.html
---
 org-present.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/org-present.el b/org-present.el
index 822c017dee..1188f84c24 100644
--- a/org-present.el
+++ b/org-present.el
@@ -167,6 +167,9 @@
      (regexp-opt '("title:" "author:" "date:" "email:"))
      string)))
 
+(defvar org-present-hide-stars-in-headings t
+  "Whether to hide the asterisk characters in headings while in presentation 
mode.")
+
 (defun org-present-add-overlays ()
   "Add overlays for this mode."
   (add-to-invisibility-spec '(org-present))
@@ -177,9 +180,10 @@
       (let ((end (if (org-present-show-option (match-string 2)) 2 0)))
         (org-present-add-overlay (match-beginning 1) (match-end end))))
     ;; hide stars in headings
-    (goto-char (point-min))
-    (while (re-search-forward "^\\(*+\\)" nil t)
-      (org-present-add-overlay (match-beginning 1) (match-end 1)))
+    (if org-present-hide-stars-in-headings
+        (progn (goto-char (point-min))
+               (while (re-search-forward "^\\(*+\\)" nil t)
+                 (org-present-add-overlay (match-beginning 1) (match-end 1)))))
     ;; hide emphasis markers
     (goto-char (point-min))
     (while (re-search-forward org-emph-re nil t)
@@ -188,7 +192,7 @@
 
 (defun org-present-rm-overlays ()
   "Remove overlays for this mode."
-  (mapc 'delete-overlay org-present-overlays-list)
+  (mapc #'delete-overlay org-present-overlays-list)
   (remove-from-invisibility-spec '(org-present)))
 
 (defun org-present-read-only ()
@@ -197,7 +201,7 @@
   (setq buffer-read-only t)
   (setq org-present-cursor-cache cursor-type
         cursor-type nil)
-  (define-key org-present-mode-keymap (kbd "SPC") 'org-present-next))
+  (define-key org-present-mode-keymap (kbd "SPC") #'org-present-next))
 
 (defun org-present-read-write ()
   "Make buffer read-only."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]