[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-present 17412d085f 03/12: feat(folds): add org-present
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-present 17412d085f 03/12: feat(folds): add org-present-startup-folded a la org-startup-folded |
Date: |
Sat, 6 Aug 2022 14:58:55 -0400 (EDT) |
branch: elpa/org-present
commit 17412d085f949730844248749f64c853a08099f0
Author: Keith Pinson <keith.pinson@banno.com>
Commit: Keith Pinson <keith.pinson@banno.com>
feat(folds): add org-present-startup-folded a la org-startup-folded
This change seems appropriate to have in base `org-present` rather than as a
hook, because it accords with both parts of `org-present`.
1. It fits with the `org` part because it is equivalent to
`org-startup-folded`, but for presentation mode.
2. It fits with the `present` part because it is analogous to the
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.
We could have driven this feature of the `org-startup-folded` variable
itself,
but it's probably making too much of a assumption about users' preferences
to do
that. I want to make sure that this kind of change is opt-in for those who
want
it and doesn't disturb existing users by suddenly changing behavior on an
update.
---
org-present.el | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/org-present.el b/org-present.el
index 74d12607c4..467875cbd9 100644
--- a/org-present.el
+++ b/org-present.el
@@ -249,6 +249,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.")
@@ -260,11 +266,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
- [nongnu] elpa/org-present updated (c0f1f36b23 -> 4ec04e1b77), ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 7be98b2c03 02/12: doc(org-present-hide-stars-in-headings): advise on use and effects, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 60d063f20a 05/12: Add org-present-toggle-one-big-page, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 444f3b3b7e 06/12: link to blog and video, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 98b7d94a0f 11/12: Merge branch 'master' into master, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 140a8c3a34 01/12: feat: Add a toggle for whether to hide stars in headings, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 17412d085f 03/12: feat(folds): add org-present-startup-folded a la org-startup-folded,
ELPA Syncer <=
- [nongnu] elpa/org-present 3c3588be82 04/12: Add and fix description of key bindings, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present ef1f1c5da9 08/12: Merge pull request #27 from Kazark/org-present-startup-folded, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 4ec04e1b77 12/12: Merge pull request #36 from rhdxmr/master, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 868d7087ca 07/12: Merge pull request #44 from rlister/systemcrafters-link, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present d506a63fc5 09/12: Merge branch 'master' into toggle-heading-stars, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present dfcb71c199 10/12: Merge pull request #26 from Kazark/toggle-heading-stars, ELPA Syncer, 2022/08/06