branch: externals/pulsar
commit bc084499c4e42699fcf7c20fbd8a6185383ed914
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>
    Add function to reveal Org or Outline entry
---
 pulsar.el | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/pulsar.el b/pulsar.el
index 0f040ef508..f1b8d9927e 100644
--- a/pulsar.el
+++ b/pulsar.el
@@ -265,5 +265,24 @@ The symbol is NAME, DOC for the doc string, and ARG is 
passed to
   "Reposition point at the center of the window and pulse line."
   nil)
 
+;;;; Reveal contents of Org or Outline headings
+
+(declare-function org-at-heading-p "org" (&optional _))
+(declare-function org-show-entry "org")
+(declare-function outline-on-heading-p "outline" (&optional invisible-ok))
+(declare-function outline-show-entry "outline")
+
+(defun pulsar-reveal-entry ()
+  "Reveal Org or Outline entry and pulse line."
+  (cond
+   ((and (eq major-mode 'org-mode)
+         (org-at-heading-p))
+    (org-show-entry))
+   ((and (or (eq major-mode 'outline-mode)
+             (bound-and-true-p outline-minor-mode))
+         (outline-on-heading-p))
+    (outline-show-entry)))
+  (pulsar-pulse-line))
+
 (provide 'pulsar)
 ;;; pulsar.el ends here

Reply via email to