branch: elpa/org-present commit dfcb71c1999eab075d5fc468d8561b78f88d02c1 Merge: ef1f1c5da9 d506a63fc5 Author: Ric Lister <rlis...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #26 from Kazark/toggle-heading-stars Add a toggle for whether to hide stars in headings --- org-present.el | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/org-present.el b/org-present.el index 363b4d074f..c0f69b7810 100644 --- a/org-present.el +++ b/org-present.el @@ -166,6 +166,13 @@ (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. If you turn this off (by setting it to nil) make sure to set +`org-hide-emphasis-markers' non-nil, since currently `org-present''s algorithm +for hiding emphasis markers has a bad interaction with bullets. This combo also +makes tabs work in presentation mode as in the rest of Org mode.") + (defun org-present-add-overlays () "Add overlays for this mode." (add-to-invisibility-spec '(org-present)) @@ -176,9 +183,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/verbatim markers if not already hidden by org (if org-hide-emphasis-markers nil ;; TODO https://github.com/rlister/org-present/issues/12 @@ -198,14 +206,16 @@ (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 () "Make buffer read-only." (interactive) (setq buffer-read-only t) - (define-key org-present-mode-keymap (kbd "SPC") 'org-present-next)) + (setq org-present-cursor-cache cursor-type + cursor-type nil) + (define-key org-present-mode-keymap (kbd "SPC") #'org-present-next)) (defun org-present-read-write () "Make buffer read-only."