[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-tree-slide a3b46848e4 111/144: org-tree-slide-content:
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-tree-slide a3b46848e4 111/144: org-tree-slide-content: Return to exact point in slide presentation (#30) |
Date: |
Tue, 18 Jan 2022 08:59:53 -0500 (EST) |
branch: elpa/org-tree-slide
commit a3b46848e45948be9d06c51431dc502ef84d1c5e
Author: Boruch Baum <boruch_baum@gmx.com>
Commit: Takaaki ISHIKAWA <takaxp@ieee.org>
org-tree-slide-content: Return to exact point in slide presentation (#30)
+ When entering content-view, this places the cursor at the point in
the heading tree where the user was, instead of always at the top of
the file.
+ With this feature, a user can enter content-view, and return to the
exact position within the presentation in just one command, M-x
org-tree-slide-content.
+ Works even after navigating within content-view.
+ Useful also when forgetting exactly where one had been before
entering content-view.
---
ChangeLog | 7 ++++++-
org-tree-slide.el | 35 +++++++++++++++++++++++++----------
2 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cb748c2c6c..56741df325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-30 Boruch Baum <boruch_baum@gmx.com>
+
+ * org-tree-slide.el (org-tree-slide-content): Toggle back to slide
+ presentation, to exact position where you left off.
+ (org-tree-slide-content-pos): New variable to support this feature.
+
2018-11-26 Takaaki ISHIKAWA <takaxp@ieee.org>
* org-tree-slide.el: Extract header colors from default face of frame
@@ -235,4 +241,3 @@
2011-09-28 Takaaki ISHIKAWA <takaxp@ieee.org>
* org-tree-slide.el: Initial release
-
diff --git a/org-tree-slide.el b/org-tree-slide.el
index 2e1f411b1d..a62f27f8a7 100644
--- a/org-tree-slide.el
+++ b/org-tree-slide.el
@@ -238,6 +238,8 @@ nil: keep the same position."
"A hook run before moving to the previous slide.")
(defvar org-tree-slide-before-content-view-hook nil
"A hook run before showing the content.")
+(defvar org-tree-slide-content-pos nil
+ "Where to return when toggling function `org-tree-slide-content'.")
;;;###autoload
(define-minor-mode org-tree-slide-mode
@@ -312,16 +314,29 @@ Profiles:
"Change the display for viewing content of the org file during the slide
view mode is active."
(interactive)
(when (org-tree-slide--active-p)
- (run-hooks 'org-tree-slide-before-content-view-hook)
- (widen)
- (org-tree-slide--hide-slide-header)
- (org-tree-slide--move-to-the-first-heading)
- (org-overview)
- (cond ((eq 0 org-tree-slide-skip-outline-level)
- (org-content))
- ((< 2 org-tree-slide-skip-outline-level)
- (org-content (1- org-tree-slide-skip-outline-level))))
- (message "<< CONTENT >>")))
+ (cond
+ (org-tree-slide-content-pos
+; (widen)
+ (goto-char org-tree-slide-content-pos)
+ (org-tree-slide--display-tree-with-narrow)
+ (goto-char org-tree-slide-content-pos)
+ (setq org-tree-slide-content-pos nil))
+ (t
+ (setq org-tree-slide-content-pos
+ (max (1+ (point-min)) (point)))
+ (run-hooks 'org-tree-slide-before-content-view-hook)
+ (widen)
+ (org-tree-slide--hide-slide-header)
+ (org-tree-slide--move-to-the-first-heading)
+ (org-overview)
+ (cond ((eq 0 org-tree-slide-skip-outline-level)
+ (org-content))
+ ((< 2 org-tree-slide-skip-outline-level)
+ (org-content (1- org-tree-slide-skip-outline-level))))
+; (goto-char (point-min))
+ (redisplay)
+ (goto-char org-tree-slide-content-pos)
+ (message "<< CONTENT >>")))))
;;;###autoload
(defun org-tree-slide-move-next-tree ()
- [nongnu] elpa/org-tree-slide be2d679c35 028/144: Add a link, (continued)
- [nongnu] elpa/org-tree-slide be2d679c35 028/144: Add a link, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 871d75f872 055/144: Merge branch 'master' of github.com:takaxp/org-tree-slide, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide a85c6e2b9c 062/144: Added a new toggle to skip commented trees, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide b30805ac45 063/144: Fix typo, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide c9c413ba8b 064/144: Added a flag to control face setting, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 3e56b63ad1 024/144: Version 2.5.0, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 1687d83b18 046/144: Fix typo README.org, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 78a5c46e55 049/144: Add autoload magic comments, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 8dc16ab4ed 107/144: Revise `org-tree-slide-content`, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 2ff3a05844 109/144: Removed obsoleted hooks, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide a3b46848e4 111/144: org-tree-slide-content: Return to exact point in slide presentation (#30),
ELPA Syncer <=
- [nongnu] elpa/org-tree-slide 25a0936d0c 009/144: Version 2.0.1, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 39a6039b18 023/144: Add an option to control modeline display, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 36fefc1a2f 038/144: Update README, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide faf9421439 041/144: Update README, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 5d4f714052 020/144: Change descriptions, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide e835028d43 051/144: Fix README.org, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 09e99877d7 045/144: Fix a bug for an org buffer without header, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 949c77146f 025/144: org-tree-slide-skip-done set nil as default, ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 28975a4492 018/144: Support displaying a slide number in a mode-line., ELPA Syncer, 2022/01/18
- [nongnu] elpa/org-tree-slide 996ed8cc6b 058/144: * README.org: update as el-get has recipe already included., ELPA Syncer, 2022/01/18