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

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

[nongnu] elpa/org-present ef1f1c5da9 08/12: Merge pull request #27 from


From: ELPA Syncer
Subject: [nongnu] elpa/org-present ef1f1c5da9 08/12: Merge pull request #27 from Kazark/org-present-startup-folded
Date: Sat, 6 Aug 2022 14:58:55 -0400 (EDT)

branch: elpa/org-present
commit ef1f1c5da987e098ccaa67e81a10789c746d254a
Merge: 868d7087ca 17412d085f
Author: Ric Lister <rlister@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #27 from Kazark/org-present-startup-folded
    
    Add org-present-startup-folded a la org-startup-folded
---
 org-present.el | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/org-present.el b/org-present.el
index 47b41dc9ed..363b4d074f 100644
--- a/org-present.el
+++ b/org-present.el
@@ -250,6 +250,12 @@
   (run-hooks 'org-present-mode-quit-hook)
   (setq org-present-mode nil))
 
+(defvar org-present-startup-folded nil
+  "Like `org-startup-folded', but for presentation mode. Also analogous to
+introduction of slide items by effects in other presentation programs: i.e., if
+you do not want to show the whole slide at first, but to unfurl it slowly, set
+this to non-nil.")
+
 (defvar org-present-after-navigate-functions nil
   "Abnormal hook run after org-present navigates to a new heading.")
 
@@ -261,11 +267,14 @@
    (replace-regexp-in-string "[ \t\n]*\\'" "" string)))
 
 (defun org-present-run-after-navigate-functions ()
-  "Run org-present-after-navigate hook, passing the name of the presentation 
buffer and the current heading."
-  (let* ((title-text (thing-at-point 'line))
-         (safe-title-text (replace-regexp-in-string "^[ \*]" "" title-text))
-         (current-heading (org-present-trim-string safe-title-text)))
-    (run-hook-with-args 'org-present-after-navigate-functions (buffer-name) 
current-heading)))
+  "Fold slide if `org-present-startup-folded' is non-nil.
+Run org-present-after-navigate hook, passing the name of the presentation 
buffer and the current heading."
+  (progn
+    (if org-present-startup-folded (org-cycle))
+    (let* ((title-text (thing-at-point 'line))
+           (safe-title-text (replace-regexp-in-string "^[ \*]" "" title-text))
+           (current-heading (org-present-trim-string safe-title-text)))
+      (run-hook-with-args 'org-present-after-navigate-functions (buffer-name) 
current-heading))))
 
 (provide 'org-present)
 ;;; org-present.el ends here



reply via email to

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