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

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

[nongnu] elpa/org-present 9709ca2d04 34/47: Merge pull request #25 from


From: ELPA Syncer
Subject: [nongnu] elpa/org-present 9709ca2d04 34/47: Merge pull request #25 from Kazark/emphasis-markers
Date: Sat, 8 Jan 2022 13:58:31 -0500 (EST)

branch: elpa/org-present
commit 9709ca2d04a59959354222ac4d3f8b750785739a
Merge: 00679dc2b0 614eb997c5
Author: Ric Lister <rlister+gh@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #25 from Kazark/emphasis-markers
    
    Fix needless hiding of emphasis markers already hidden by Org
---
 org-present.el | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/org-present.el b/org-present.el
index c0e9b23075..74d12607c4 100644
--- a/org-present.el
+++ b/org-present.el
@@ -180,16 +180,22 @@
     (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)
-      (org-present-add-overlay (match-beginning 2) (1+ (match-beginning 2)))
-      (org-present-add-overlay (1- (match-end 2)) (match-end 2)))
-    ;; hide verbatim markers
-    (goto-char (point-min))
-    (while (re-search-forward org-verbatim-re nil t)
-      (org-present-add-overlay (match-beginning 2) (1+ (match-beginning 2)))
-      (org-present-add-overlay (1- (match-end 2)) (match-end 2)))))
+    ;; 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
+      ;; It would be better to reuse org's own facility for this, if possible.
+      ;; However it is not obvious how to do this.
+      (progn
+        ;; hide emphasis markers
+        (goto-char (point-min))
+        (while (re-search-forward org-emph-re nil t)
+          (org-present-add-overlay (match-beginning 2) (1+ (match-beginning 
2)))
+          (org-present-add-overlay (1- (match-end 2)) (match-end 2)))
+        ;; hide verbatim markers
+        (goto-char (point-min))
+        (while (re-search-forward org-verbatim-re nil t)
+          (org-present-add-overlay (match-beginning 2) (1+ (match-beginning 
2)))
+          (org-present-add-overlay (1- (match-end 2)) (match-end 2)))))))
 
 (defun org-present-rm-overlays ()
   "Remove overlays for this mode."



reply via email to

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