[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dslide a0460d4070 012/230: Return early by user-error when
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dslide a0460d4070 012/230: Return early by user-error when not in org-tree-slide-mode |
Date: |
Sun, 7 Jul 2024 19:00:08 -0400 (EDT) |
branch: elpa/dslide
commit a0460d40709cf5f091c4ce849856ea13ff469307
Author: Psionik K <73710933+psionic-k@users.noreply.github.com>
Commit: Psionik K <73710933+psionic-k@users.noreply.github.com>
Return early by user-error when not in org-tree-slide-mode
Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
---
org-tree-slide.el | 87 ++++++++++++++++++++++++++++---------------------------
1 file changed, 45 insertions(+), 42 deletions(-)
diff --git a/org-tree-slide.el b/org-tree-slide.el
index 942ff7387a..4fba5943ba 100644
--- a/org-tree-slide.el
+++ b/org-tree-slide.el
@@ -391,53 +391,56 @@ Profiles:
(defun org-tree-slide-move-next-tree ()
"Display the next slide."
(interactive)
- (when (org-tree-slide--active-p)
- (let ((msg (plist-get org-tree-slide-indicator :next))
- (message-log-max nil))
- (when msg
- (message "%s" msg)))
- (cond
- ((and (buffer-narrowed-p)
- (org-tree-slide--last-tree-p (point)))
- (org-tree-slide-content))
- ;; displaying a slide, not the contents
- ((or
- (or (and (org-tree-slide--before-first-heading-p)
- (not (org-at-heading-p)))
- (and (= (line-beginning-position) 1)
- (not (buffer-narrowed-p))))
- (or (org-tree-slide--first-heading-with-narrow-p)
- (not (org-at-heading-p))))
- (run-hooks 'org-tree-slide-before-move-next-hook)
- (widen)
- (org-tree-slide--outline-next-heading)
- (org-tree-slide--display-tree-with-narrow))
- ;; stay the same slide (for CONTENT MODE, on the subtrees)
- (t (org-tree-slide--display-tree-with-narrow)))))
+ (unless (org-tree-slide--active-p)
+ (user-error "org-tree-slide-mode inactive"))
+ (let ((msg (plist-get org-tree-slide-indicator :next))
+ (message-log-max nil))
+ (when msg
+ (message "%s" msg)))
+ (cond
+ ((and (buffer-narrowed-p)
+ (org-tree-slide--last-tree-p (point)))
+ (org-tree-slide-content))
+ ;; displaying a slide, not the contents
+ ((or
+ (or (and (org-tree-slide--before-first-heading-p)
+ (not (org-at-heading-p)))
+ ;; TODO when does this happen?
+ (and (= (line-beginning-position) 1)
+ (not (buffer-narrowed-p))))
+ (or (org-tree-slide--first-heading-with-narrow-p)
+ (not (org-at-heading-p))))
+ (run-hooks 'org-tree-slide-before-move-next-hook)
+ (widen)
+ (org-tree-slide--outline-next-heading)
+ (org-tree-slide--display-tree-with-narrow))
+ ;; stay the same slide (for CONTENT MODE, on the subtrees)
+ (t (org-tree-slide--display-tree-with-narrow))))
;;;###autoload
(defun org-tree-slide-move-previous-tree ()
"Display the previous slide."
(interactive)
- (when (org-tree-slide--active-p)
- (let ((msg (plist-get org-tree-slide-indicator :previous))
- (message-log-max nil))
- (when msg
- (message "%s" msg)))
- (org-tree-slide--hide-slide-header) ; for at the first
heading
- (run-hooks 'org-tree-slide-before-move-previous-hook)
- (widen)
- (cond
- ((org-tree-slide--before-first-heading-p)
- (message "before first heading (org-tree-slide)" ))
- ((not (org-at-heading-p))
- (org-tree-slide--outline-previous-heading)
- (org-tree-slide--outline-previous-heading))
- (t (org-tree-slide--outline-previous-heading)))
- (org-tree-slide--display-tree-with-narrow)
- ;; To avoid error of missing header in Emacs24
- (if (= emacs-major-version 24)
- (goto-char (point-min)))))
+ (unless (org-tree-slide--active-p)
+ (user-error "org-tree-slide-mode inactive"))
+ (let ((msg (plist-get org-tree-slide-indicator :previous))
+ (message-log-max nil))
+ (when msg
+ (message "%s" msg)))
+ (org-tree-slide--hide-slide-header) ; for at the first heading
+ (run-hooks 'org-tree-slide-before-move-previous-hook)
+ (widen)
+ (cond
+ ((org-tree-slide--before-first-heading-p)
+ (message "before first heading (org-tree-slide)" ))
+ ((not (org-at-heading-p))
+ (org-tree-slide--outline-previous-heading)
+ (org-tree-slide--outline-previous-heading))
+ (t (org-tree-slide--outline-previous-heading)))
+ (org-tree-slide--display-tree-with-narrow)
+ ;; To avoid error of missing header in Emacs24
+ (if (= emacs-major-version 24)
+ (goto-char (point-min))))
;;;###autoload
(defun org-tree-slide-simple-profile ()
- [nongnu] elpa/dslide 45a9620a54 054/230: babel blocks can now be used in both directions, (continued)
- [nongnu] elpa/dslide 45a9620a54 054/230: babel blocks can now be used in both directions, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide f3ae2af0cc 039/230: changed sequence-callbacks to not include sequence as a key, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 015796186f 048/230: !fixme Not sure if this is necessary. Shipping my last tested., ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 4e2086e49e 034/230: rename display-state -> slide-buffer-state, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 30196efe70 010/230: The header overlay should be buffer local, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide e75488d7ac 018/230: rearrange, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide cf56e034ff 008/230: Overlays for selective display of contents, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 39a9045682 011/230: Simplify blank-lines expression using make-string, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 0316764255 006/230: moving a comment, automatic formatting, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 3969814eb4 015/230: rearrangement, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide a0460d4070 012/230: Return early by user-error when not in org-tree-slide-mode,
ELPA Syncer <=
- [nongnu] elpa/dslide 0732479ac8 019/230: rearrange, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 393985506a 021/230: After-narrow-hook, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide dddbc58e20 020/230: The repackaging. org-tree-slide -> macro-slides, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 10ee601187 007/230: enable lexical binding, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide b9219d205c 023/230: typos, comments, line-noise, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 1dbbed70f8 025/230: missing custom group & type, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 63d93ec6bf 028/230: Dead code on slide, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 9a67bc2f3e 026/230: line noise, compiler warnings, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 3e7ceb0845 024/230: missing deps, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 1d8041aba1 027/230: Sequence (slide) callbacks, ELPA Syncer, 2024/07/07