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

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

[elpa] externals/pulsar bc084499c4 04/28: Add function to reveal Org or


From: ELPA Syncer
Subject: [elpa] externals/pulsar bc084499c4 04/28: Add function to reveal Org or Outline entry
Date: Tue, 22 Mar 2022 06:58:01 -0400 (EDT)

branch: externals/pulsar
commit bc084499c4e42699fcf7c20fbd8a6185383ed914
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@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

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