From b9f9e4b82c2424fc870fd3ebbea57a3749099e15 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 22 Jan 2019 16:48:44 +0100 Subject: [PATCH] Update org-tree-slide. Signed-off-by: Andreas Gerler --- .../org-tree-slide-pkg.el | 2 - .../org-tree-slide-autoloads.el | 28 +- .../org-tree-slide-pkg.el | 2 + .../org-tree-slide.el | 442 +++++++++--------- elpa/org-tree-slide-readme.txt | 36 -- 5 files changed, 254 insertions(+), 256 deletions(-) delete mode 100644 elpa/org-tree-slide-20180906.949/org-tree-slide-pkg.el rename elpa/{org-tree-slide-20180906.949 => org-tree-slide-20181226.947}/org-tree-slide-autoloads.el (87%) create mode 100644 elpa/org-tree-slide-20181226.947/org-tree-slide-pkg.el rename elpa/{org-tree-slide-20180906.949 => org-tree-slide-20181226.947}/org-tree-slide.el (75%) delete mode 100644 elpa/org-tree-slide-readme.txt diff --git a/elpa/org-tree-slide-20180906.949/org-tree-slide-pkg.el b/elpa/org-tree-slide-20180906.949/org-tree-slide-pkg.el deleted file mode 100644 index 8613e630..00000000 --- a/elpa/org-tree-slide-20180906.949/org-tree-slide-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "org-tree-slide" "20180906.949" "A presentation tool for org-mode" 'nil :commit "d45152fad1c0a153251073806f1b65ebd3731411" :keywords '("org-mode" "presentation" "narrowing") :authors '(("Takaaki ISHIKAWA ")) :maintainer '("Takaaki ISHIKAWA ")) diff --git a/elpa/org-tree-slide-20180906.949/org-tree-slide-autoloads.el b/elpa/org-tree-slide-20181226.947/org-tree-slide-autoloads.el similarity index 87% rename from elpa/org-tree-slide-20180906.949/org-tree-slide-autoloads.el rename to elpa/org-tree-slide-20181226.947/org-tree-slide-autoloads.el index 16776be4..8d83c10e 100644 --- a/elpa/org-tree-slide-20180906.949/org-tree-slide-autoloads.el +++ b/elpa/org-tree-slide-20181226.947/org-tree-slide-autoloads.el @@ -59,18 +59,28 @@ Start slideshow with setting a count down timer. \(fn)" t nil) (autoload 'org-tree-slide-without-init-play "org-tree-slide" "\ -Start slideshow without the init play. Just enter org-tree-slide-mode. +Start slideshow without the init play. Just enter \"org-tree-slide-mode\". \(fn)" t nil) (autoload 'org-tree-slide-content "org-tree-slide" "\ -Change the display for viewing content of the org file during - the slide view mode is active. +Change the display for viewing content of the org file during the slide view mode is active. + +\(fn)" t nil) + +(autoload 'org-tree-slide-move-next-tree "org-tree-slide" "\ +Display the next slide. + +\(fn)" t nil) + +(autoload 'org-tree-slide-move-previous-tree "org-tree-slide" "\ +Display the previous slide. \(fn)" t nil) (autoload 'org-tree-slide-simple-profile "org-tree-slide" "\ Set variables for simple use. + `org-tree-slide-header' => nil `org-tree-slide-slide-in-effect' => nil `org-tree-slide-heading-emphasis' => nil @@ -83,6 +93,7 @@ Set variables for simple use. (autoload 'org-tree-slide-presentation-profile "org-tree-slide" "\ Set variables for presentation use. + `org-tree-slide-header' => t `org-tree-slide-slide-in-effect' => t `org-tree-slide-heading-emphasis' => nil @@ -95,6 +106,7 @@ Set variables for presentation use. (autoload 'org-tree-slide-narrowing-control-profile "org-tree-slide" "\ Set variables for TODO pursuit with narrowing. + `org-tree-slide-header' => nil `org-tree-slide-slide-in-effect' => nil `org-tree-slide-heading-emphasis' => nil @@ -106,27 +118,27 @@ Set variables for TODO pursuit with narrowing. \(fn)" t nil) (autoload 'org-tree-slide-display-header-toggle "org-tree-slide" "\ -Toggle displaying the slide header +Toggle displaying the slide header. \(fn)" t nil) (autoload 'org-tree-slide-slide-in-effect-toggle "org-tree-slide" "\ -Toggle using slide-in effect +Toggle using slide-in effect. \(fn)" t nil) (autoload 'org-tree-slide-heading-emphasis-toggle "org-tree-slide" "\ -Toggle applying emphasis to heading +Toggle applying emphasis to heading. \(fn)" t nil) (autoload 'org-tree-slide-skip-done-toggle "org-tree-slide" "\ -Toggle show TODO item only or not +Toggle show TODO item only or not. \(fn)" t nil) (autoload 'org-tree-slide-skip-comments-toggle "org-tree-slide" "\ -Toggle show COMMENT item or not +Toggle show COMMENT item or not. \(fn)" t nil) diff --git a/elpa/org-tree-slide-20181226.947/org-tree-slide-pkg.el b/elpa/org-tree-slide-20181226.947/org-tree-slide-pkg.el new file mode 100644 index 00000000..568a81c8 --- /dev/null +++ b/elpa/org-tree-slide-20181226.947/org-tree-slide-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "org-tree-slide" "20181226.947" "A presentation tool for org-mode" 'nil :commit "603a383117b8c19004baeecfe34837e20568fdbd" :keywords '("convenience" "org-mode" "presentation" "narrowing") :authors '(("Takaaki ISHIKAWA ")) :maintainer '("Takaaki ISHIKAWA ") :url "https://github.com/takaxp/org-tree-slide") diff --git a/elpa/org-tree-slide-20180906.949/org-tree-slide.el b/elpa/org-tree-slide-20181226.947/org-tree-slide.el similarity index 75% rename from elpa/org-tree-slide-20180906.949/org-tree-slide.el rename to elpa/org-tree-slide-20181226.947/org-tree-slide.el index 77696e49..3145d4a0 100644 --- a/elpa/org-tree-slide-20180906.949/org-tree-slide.el +++ b/elpa/org-tree-slide-20181226.947/org-tree-slide.el @@ -1,14 +1,14 @@ ;;; org-tree-slide.el --- A presentation tool for org-mode ;; -;; Copyright (C) 2011-2017 Takaaki ISHIKAWA +;; Copyright (C) 2011-2018 Takaaki ISHIKAWA ;; ;; Author: Takaaki ISHIKAWA -;; Version: 2.8.8 -;; Package-Version: 20180906.949 +;; Version: 2.8.13 +;; Package-Version: 20181226.947 ;; Maintainer: Takaaki ISHIKAWA ;; Twitter: @takaxp -;; Repository: https://github.com/takaxp/org-tree-slide -;; Keywords: org-mode, presentation, narrowing +;; URL: https://github.com/takaxp/org-tree-slide +;; Keywords: convenience, org-mode, presentation, narrowing ;; ;; Committers: Yuuki ARISAWA (@uk-ar) ;; Eric S Fraga @@ -37,7 +37,7 @@ ;; Requirement: ;; org-mode 6.33x or higher version ;; The latest version of the org-mode is recommended. -;; (see http://orgmode.org/) +;; (see https://orgmode.org/) ;; ;; Usage: ;; 1. Put this elisp into your load-path @@ -76,10 +76,9 @@ (require 'org) (require 'org-timer) -;;(require 'org-clock) ; org-clock-in, -out, -clocking-p -(defconst org-tree-slide "2.8.8" - "The version number of the org-tree-slide.el") +(defconst org-tree-slide "2.8.13" + "The version number of the org-tree-slide.el.") (defgroup org-tree-slide nil "User variables for org-tree-slide." @@ -87,26 +86,28 @@ (defcustom org-tree-slide-skip-outline-level 0 "Skip slides if a heading level is higher than or equal to this variable. + `0': never skip at any heading + `1': will skip all slides and be terminated automatically. + Not recommended to use this number. e.g. set `4', *** heading A ; display as a slide entry **** heading B ; skip! do not display as the next slide **** heading C ; skip! - *** heading D ; display as the next slide -" + *** heading D ; display as the next slide" :type 'integer :group 'org-tree-slide) (defcustom org-tree-slide-fold-subtrees-skipped t "If this flag is true, the subtrees in a slide will be displayed in fold. - When nil, the body of the subtrees will be revealed. -" + +When nil, the body of the subtrees will be revealed." :type 'boolean :group 'org-tree-slide) (defcustom org-tree-slide-header t - "The status of displaying the slide header" + "The status of displaying the slide header." :type 'boolean :group 'org-tree-slide) @@ -117,8 +118,9 @@ (defcustom org-tree-slide-cursor-init t "Specify a cursor position when exit slideshow. - `t': the cursor will move automatically to the head of buffer. - nil: keep the same position." + +Non-nil: the cursor will move automatically to the head of buffer. +nil: keep the same position." :type 'boolean :group 'org-tree-slide) @@ -133,7 +135,7 @@ :group 'org-tree-slide) (defcustom org-tree-slide-heading-emphasis nil - "Specify to use a custom face heading, or not" + "Specify to use a custom face heading, or not." :type 'boolean :group 'org-tree-slide) @@ -154,18 +156,19 @@ (defcustom org-tree-slide-activate-message "Hello! This is org-tree-slide :-)" - "Message in mini buffer when org-tree-slide is activated." + "Message in mini buffer when \"org-tree-slide\" is activated." :type 'string :group 'org-tree-slide) (defcustom org-tree-slide-deactivate-message "Quit, Bye!" - "Message in mini buffer when org-tree-slide is deactivated." + "Message in mini buffer when \"org-tree-slide\" is deactivated." :type 'string :group 'org-tree-slide) (defcustom org-tree-slide-modeline-display 'outside "Specify how to display the slide number in mode line. + 'lighter: shown in lighter (update info actively, then it's slow) 'outside: update infomation when moving to the next/previous slide nil: nothing to be shown" @@ -222,31 +225,20 @@ :group 'org-tree-slide) (defvar org-tree-slide-mode nil) -;; These hooks was obsoleted, and will be deleted by Oct. 2015. -(defvar org-tree-slide-mode-play-hook nil - "[obsolete] A hook run when org-tree-slide--play is evaluated to start the slide show") -(defvar org-tree-slide-mode-stop-hook nil - "[obsolete] A hook run when org-tree-slide--stop is evaluated to stop the slide show") -(defvar org-tree-slide-mode-before-narrow-hook nil - "[obsolete] A hook run before evaluating org-tree-slide--display-tree-with-narrow") -(defvar org-tree-slide-mode-after-narrow-hook nil - "[obsolete] A hook run after evaluating org-tree-slide--display-tree-with-narrow") - -;; Updated hooks (defvar org-tree-slide-play-hook nil - "A hook run when org-tree-slide--play is evaluated to start the slide show") + "A hook run when `org-tree-slide--play' is evaluated to start the slideshow.") (defvar org-tree-slide-stop-hook nil - "A hook run when org-tree-slide--stop is evaluated to stop the slide show") + "A hook run when `org-tree-slide--stop' is evaluated to stop the slideshow.") (defvar org-tree-slide-before-narrow-hook nil - "A hook run before evaluating org-tree-slide--display-tree-with-narrow") + "A hook run before evaluating `org-tree-slide--display-tree-with-narrow'.") (defvar org-tree-slide-after-narrow-hook nil - "A hook run after evaluating org-tree-slide--display-tree-with-narrow") + "A hook run after evaluating `org-tree-slide--display-tree-with-narrow'.") (defvar org-tree-slide-before-move-next-hook nil - "A hook run before moving to the next slide") + "A hook run before moving to the next slide.") (defvar org-tree-slide-before-move-previous-hook nil - "A hook run before moving to the previous slide") + "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") + "A hook run before showing the content.") ;;;###autoload (define-minor-mode org-tree-slide-mode @@ -309,7 +301,7 @@ Profiles: ;;;###autoload (defun org-tree-slide-without-init-play () - "Start slideshow without the init play. Just enter org-tree-slide-mode." + "Start slideshow without the init play. Just enter \"org-tree-slide-mode\"." (interactive) (org-tree-slide-mode) (widen) @@ -318,29 +310,78 @@ Profiles: ;;;###autoload (defun org-tree-slide-content () - "Change the display for viewing content of the org file during - the slide view mode is active." + "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) - (org-content (if (> org-tree-slide-skip-outline-level 0) - (1- org-tree-slide-skip-outline-level))) + (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 >>"))) +;;;###autoload +(defun org-tree-slide-move-next-tree () + "Display the next slide." + (interactive) + (when (org-tree-slide--active-p) + (unless (equal org-tree-slide-modeline-display 'outside) + (message " Next >>")) + (cond + ;; displaying a slide, not the contents + ((and (org-tree-slide--narrowing-p) + (org-tree-slide--last-tree-p (point))) + (org-tree-slide-content)) + ((or + (or (and (org-tree-slide--before-first-heading-p) + (not (org-at-heading-p))) + (and (= (point-at-bol) 1) (not (org-tree-slide--narrowing-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) + (unless (equal org-tree-slide-modeline-display 'outside) + (message "<< Previous")) + (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 () "Set variables for simple use. + `org-tree-slide-header' => nil `org-tree-slide-slide-in-effect' => nil `org-tree-slide-heading-emphasis' => nil `org-tree-slide-cursor-init' => t `org-tree-slide-modeline-display' => nil `org-tree-slide-skip-done' => nil - `org-tree-slide-skip-comments' => t -" + `org-tree-slide-skip-comments' => t" (interactive) (setq org-tree-slide-header nil) (setq org-tree-slide-slide-in-effect nil) @@ -354,14 +395,14 @@ Profiles: ;;;###autoload (defun org-tree-slide-presentation-profile () "Set variables for presentation use. + `org-tree-slide-header' => t `org-tree-slide-slide-in-effect' => t `org-tree-slide-heading-emphasis' => nil `org-tree-slide-cursor-init' => t `org-tree-slide-modeline-display' => 'outside `org-tree-slide-skip-done' => nil - `org-tree-slide-skip-comments' => t -" + `org-tree-slide-skip-comments' => t" (interactive) (setq org-tree-slide-header t) (setq org-tree-slide-slide-in-effect t) @@ -375,14 +416,14 @@ Profiles: ;;;###autoload (defun org-tree-slide-narrowing-control-profile () "Set variables for TODO pursuit with narrowing. + `org-tree-slide-header' => nil `org-tree-slide-slide-in-effect' => nil `org-tree-slide-heading-emphasis' => nil `org-tree-slide-cursor-init' => nil `org-tree-slide-modeline-display' => 'lighter `org-tree-slide-skip-done' => t - `org-tree-slide-skip-comments' => t -" + `org-tree-slide-skip-comments' => t" (interactive) (setq org-tree-slide-header nil) (setq org-tree-slide-slide-in-effect nil) @@ -395,7 +436,7 @@ Profiles: ;;;###autoload (defun org-tree-slide-display-header-toggle () - "Toggle displaying the slide header" + "Toggle displaying the slide header." (interactive) (setq org-tree-slide-header (not org-tree-slide-header)) (unless org-tree-slide-header @@ -404,14 +445,14 @@ Profiles: ;;;###autoload (defun org-tree-slide-slide-in-effect-toggle () - "Toggle using slide-in effect" + "Toggle using slide-in effect." (interactive) (setq org-tree-slide-slide-in-effect (not org-tree-slide-slide-in-effect)) (org-tree-slide--display-tree-with-narrow)) ;;;###autoload (defun org-tree-slide-heading-emphasis-toggle () - "Toggle applying emphasis to heading" + "Toggle applying emphasis to heading." (interactive) (setq org-tree-slide-heading-emphasis (not org-tree-slide-heading-emphasis)) (org-tree-slide--apply-custom-heading-face org-tree-slide-heading-emphasis)) @@ -419,7 +460,7 @@ Profiles: (defvar org-tree-slide--previous-line 0) ;;;###autoload (defun org-tree-slide-skip-done-toggle () - "Toggle show TODO item only or not" + "Toggle show TODO item only or not." (interactive) (setq org-tree-slide-skip-done (not org-tree-slide-skip-done)) (setq org-tree-slide--previous-line -1) ; to update modeline intentionally @@ -430,74 +471,29 @@ Profiles: ;;;###autoload (defun org-tree-slide-skip-comments-toggle () - "Toggle show COMMENT item or not" + "Toggle show COMMENT item or not." (interactive) (setq org-tree-slide-skip-comments (not org-tree-slide-skip-comments)) (if org-tree-slide-skip-comments (message "COMMENT: HIDE") (message "COMMENT: SHOW"))) -(defun org-tree-slide-move-next-tree () - "Display the next slide" - (interactive) - (when (org-tree-slide--active-p) - (unless (equal org-tree-slide-modeline-display 'outside) - (message " Next >>")) - (cond - ((and (org-tree-slide--narrowing-p) ;displaying a slide, not the contents - (org-tree-slide--last-tree-p (progn (beginning-of-line) (point)))) ;the last subtree - (org-tree-slide-content)) - ((or - (or (and (org-tree-slide--before-first-heading-p) - (not (org-at-heading-p))) - (and (= (point-at-bol) 1) (not (org-tree-slide--narrowing-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 nil (org-tree-slide--display-tree-with-narrow))) - ;; (when (and org-tree-slide-skip-done (looking-at (concat "^\\*+ " org-not-done-regexp))) (org-clock-in) ) - )) - -(defun org-tree-slide-move-previous-tree () - "Display the previous slide" - (interactive) - (when (org-tree-slide--active-p) - (unless (equal org-tree-slide-modeline-display 'outside) - (message "<< Previous")) - (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))) - ;; (when (and org-tree-slide-skip-done (looking-at (concat "^\\*+ " org-not-done-regexp))) (org-clock-in) ) - (org-tree-slide--display-tree-with-narrow) - ;; To avoid error of missing header in Emacs24 - (if (= emacs-major-version 24) - (goto-char (point-min))))) - ;;; Internal functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar org-tree-slide--slide-number nil) (make-variable-buffer-local 'org-tree-slide--slide-number) (defvar org-tree-slide--lighter " TSlide" - "Lighter for org-tree-slide. -This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") + "Lighter for `org-tree-slide'. +This is displayed by default if `org-tree-slide-modeline-display' is nil.") (defun org-tree-slide--line-number-at-pos () + "Return the line number when widen." (save-excursion (save-restriction (widen) (line-number-at-pos)))) (defun org-tree-slide--update-modeline () + "Update mode line." (when (org-tree-slide--active-p) (cond ((equal org-tree-slide-modeline-display 'lighter) @@ -508,41 +504,47 @@ This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") ;; just return the current org-tree-slide--slide-number quickly. ((equal org-tree-slide-modeline-display 'outside) org-tree-slide--slide-number) - (t org-tree-slide--lighter)))) + (t + org-tree-slide--lighter)))) (defvar org-tree-slide--header-overlay nil "Flag to check the status of overlay for a slide header.") (defun org-tree-slide--setup () + "Setup." (when (org-tree-slide--active-p) (org-tree-slide--play))) (defun org-tree-slide--abort () + "Abort." (when (equal major-mode 'org-mode) (org-tree-slide--stop))) (defun org-tree-slide--play () - "Start slide view with the first tree of the org-mode buffer." - (run-hooks 'org-tree-slide-mode-play-hook) + "Start slide view with the first tree of the org mode buffer." (run-hooks 'org-tree-slide-play-hook) - (org-tree-slide--apply-local-header-to-slide-header) - (when org-tree-slide-heading-emphasis - (org-tree-slide--apply-custom-heading-face t)) - (when (or org-tree-slide-cursor-init (org-tree-slide--before-first-heading-p)) - (org-tree-slide--move-to-the-first-heading)) - (org-tree-slide--beginning-of-tree) - (when (org-tree-slide--heading-skip-p) - (org-tree-slide--outline-next-heading)) - (org-tree-slide--display-tree-with-narrow) - (when org-tree-slide-activate-message - (message "%s" org-tree-slide-activate-message))) + (if (org-tree-slide--all-skip-p) + (let ((org-tree-slide-deactivate-message + "[notice] Terminated. Skipped all slides.")) + (org-tree-slide--stop)) + (org-tree-slide--apply-local-header-to-slide-header) + (when org-tree-slide-heading-emphasis + (org-tree-slide--apply-custom-heading-face t)) + (when (or org-tree-slide-cursor-init + (org-tree-slide--before-first-heading-p)) + (org-tree-slide--move-to-the-first-heading)) + (org-tree-slide--beginning-of-tree) + (when (org-tree-slide--heading-skip-p) + (org-tree-slide--outline-next-heading)) + (org-tree-slide--display-tree-with-narrow) + (when org-tree-slide-activate-message + (message "%s" org-tree-slide-activate-message)))) (defvar org-tree-slide-startup "overview" - "If you have `#+STARTUP:' line in your org buffer, the org buffer will - be shown with corresponding status (content, showall, overview:default).") + "If you have \"#+startup:\" line in your org buffer, the org buffer will be shown with corresponding status (content, showall, overview:default).") (defun org-tree-slide--stop () - "Stop the slide view, and redraw the org-mode buffer with #+STARTUP:." + "Stop the slide view, and redraw the orgmode buffer with #+STARTUP:." (widen) (org-show-siblings) (when (or org-tree-slide-cursor-init (org-tree-slide--before-first-heading-p)) @@ -560,15 +562,12 @@ This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") (org-timer-stop)) (when org-tree-slide-heading-emphasis (org-tree-slide--apply-custom-heading-face nil)) - ;; (when (and org-tree-slide-skip-done (looking-at (concat "^\\*+ " org-not-done-regexp))) (when (org-clocking-p) (org-clock-out) ) ) - (run-hooks 'org-tree-slide-mode-stop-hook) (run-hooks 'org-tree-slide-stop-hook) (when org-tree-slide-deactivate-message (message "%s" org-tree-slide-deactivate-message))) (defun org-tree-slide--display-tree-with-narrow () "Show a tree with narrowing and also set a header at the head of slide." - (run-hooks 'org-tree-slide-mode-before-narrow-hook) (run-hooks 'org-tree-slide-before-narrow-hook) (when (equal org-tree-slide-modeline-display 'outside) (setq org-tree-slide--slide-number @@ -589,8 +588,7 @@ This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") (org-tree-slide--slide-in org-tree-slide-slide-in-blank-lines)) (when org-tree-slide-header (org-tree-slide--show-slide-header)) - (run-hooks 'org-tree-slide-after-narrow-hook) - (run-hooks 'org-tree-slide-mode-after-narrow-hook)) + (run-hooks 'org-tree-slide-after-narrow-hook)) (defun org-tree-slide--show-subtree () "Show everything after this heading at deeper levels except COMMENT items." @@ -607,35 +605,41 @@ This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") (if (eobp) (point-max) (1+ (point))))))) (defun org-tree-slide--outline-next-heading () + "Go to the next heading." (org-tree-slide--outline-select-method - (org-tree-slide--outline-skip-type - (if (outline-next-heading) t 'last) - (org-outline-level)) + (if (outline-next-heading) + (if (org-tree-slide--heading-skip-p) + 'skip + nil) + 'last) 'next)) (defun org-tree-slide--outline-previous-heading () + "Go to the previous heading." (org-tree-slide--outline-select-method - (org-tree-slide--outline-skip-type - (if (outline-previous-heading) t 'first) - (org-outline-level)) + (if (outline-previous-heading) + (if (org-tree-slide--heading-skip-p) + 'skip + nil) + 'first) 'previous)) -(defvar org-tree-slide--all-skipped t - "A flag to know if all trees are skipped") - (defun org-tree-slide--outline-select-method (action direction) - (cond ((and (equal action 'last) (equal direction 'next)) - (unless org-tree-slide--all-skipped - (org-tree-slide--outline-previous-heading))) ; Return back. - ((and (equal action 'first) (equal direction 'previous)) - (unless org-tree-slide--all-skipped - (org-tree-slide--move-to-the-first-heading))) ; Stay first heading - ((and (equal action 'skip) (equal direction 'next)) - (org-tree-slide--outline-next-heading)) ; recursive call - ((and (equal action 'skip) (equal direction 'previous)) - (org-tree-slide--outline-previous-heading)) ; recursive call + "Control heading selection with ACTION and DIRECTION." + (cond ((and (equal action 'last) + (equal direction 'next)) + (when (org-tree-slide--heading-skip-p) + (org-tree-slide-content))) ;; would be not reached here. + ((and (equal action 'first) + (equal direction 'previous)) + (org-tree-slide--move-to-the-first-heading)) + ((and (equal action 'skip) + (equal direction 'next)) + (org-tree-slide--outline-next-heading)) ;; find next again + ((and (equal action 'skip) + (equal direction 'previous)) + (org-tree-slide--outline-previous-heading)) ;; find previous again (t - (setq org-tree-slide--all-skipped nil) nil))) (defun org-tree-slide--heading-skip-p () @@ -643,17 +647,20 @@ This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") ** COMMENT ; t hoge ; nil hoge ; nil -*** hoge ; nil -" - (or (or (org-tree-slide--heading-done-skip-p) - (org-tree-slide--heading-level-skip-p)) +*** hoge ; nil" + (or (org-tree-slide--heading-done-skip-p) + (org-tree-slide--heading-level-skip-p) (org-tree-slide--heading-skip-comment-p))) -(defun org-tree-slide--heading-level-skip-p (&optional level) +(defun org-tree-slide--heading-level-skip-p (&optional heading-level) + "Check the current heading should be skipped or not based on outline level. +If HEADING-LEVEL is non-nil, the provided outline level is checked." (and (> org-tree-slide-skip-outline-level 0) - (<= org-tree-slide-skip-outline-level (or level (org-outline-level))))) + (<= org-tree-slide-skip-outline-level + (or heading-level (org-outline-level))))) (defun org-tree-slide--heading-done-skip-p () + "Return t, if the current heading is already done." (and org-tree-slide-skip-done (not (looking-at @@ -661,16 +668,12 @@ This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") (concat "^\\*+ " org-not-done-regexp))))) (defun org-tree-slide--heading-skip-comment-p () + "Return t, if the current heading is commented." (and org-tree-slide-skip-comments (looking-at (concat "^\\*+ " org-comment-string)))) -(defun org-tree-slide--outline-skip-type (has-target-outline current-level) - (cond ((equal has-target-outline 'last) 'last) - ((equal has-target-outline 'first) 'first) - ((org-tree-slide--heading-skip-p) 'skip) - (t nil))) - (defun org-tree-slide--slide-in (blank-lines) + "Apply slide in. The slide will be moved from BLANK-LINES below to top." (let ((min-line -1)) (when org-tree-slide-header (setq min-line 2)) @@ -680,17 +683,13 @@ This is displayed by default if `org-tree-slide-modeline-display' is `nil'.") (setq blank-lines (1- blank-lines))))) (defvar org-tree-slide-title nil - "If you have `#+TITLE:' line in your org buffer, it wil be used as a title - of the slide. If the buffer has no `#+TITLE:' line, the name of - current buffer will be displayed.") + "If you have \"#+title:\" line in your org buffer, it wil be used as a title of the slide. If the buffer has no \"#+title:\" line, the name of current buffer will be displayed.") (defvar org-tree-slide-email nil - "If you have `#+EMAIL:' line in your org buffer, it will be used as - an address of the slide.") + "If you have \"#+email:\" line in your org buffer, it will be used as an address of the slide.") (defvar org-tree-slide-author nil - "If you have `#+AUTHOR:' line in your org buffer, it will be used as - a name of the slide author.") + "If you have \"#+author:\" line in your org buffer, it will be used as a name of the slide author.") (defcustom org-tree-slide-breadcrumbs " > " "Display breadcrumbs in the slide header. @@ -707,6 +706,7 @@ concat the headers." :group 'org-tree-slide) (defun org-tree-slide--apply-local-header-to-slide-header () + "Form the header." (save-excursion (org-tree-slide--move-to-the-first-heading) (let ((limit (point))) @@ -720,17 +720,16 @@ concat the headers." 'org-tree-slide-startup "#\\+STARTUP:[ \t]*\\(.*\\)$" limit)))) (defun org-tree-slide--set-header-var-by-regxep (header-variable regexp limit) + "Set HEADER-VARIABLE using REGEXP. LIMIT is used to change searching bound." (goto-char 1) (set header-variable (if (re-search-forward regexp limit t) (match-string 1) nil))) (defface org-tree-slide-header-overlay-face - '((((class color) (background dark)) - (:bold t :foreground "white" :background "black")) - (((class color) (background light)) - (:bold t :foreground "black" :background "white")) - (t (:bold t :foreground "black" :background "white"))) - "Face for org-tree-slide--header-overlay") + `((t (:bold t :foreground ,(face-foreground 'default) + :background ,(face-background 'default)))) + "Face for org-tree-slide--header-overlay" + :group 'org-tree-slide) (defun org-tree-slide--get-parents (&optional delim) "Get parent headlines and concat them with DELIM." @@ -747,6 +746,9 @@ concat the headers." (mapconcat 'identity parents delim))))) (defun org-tree-slide--set-slide-header (blank-lines) + "Set the header with overlay. + +Some number of BLANK-LINES will be shown below the header." (org-tree-slide--hide-slide-header) (setq org-tree-slide--header-overlay (make-overlay (point-min) (+ 1 (point-min)))) @@ -772,31 +774,36 @@ concat the headers." (org-tree-slide--get-blank-lines blank-lines)))) (defun org-tree-slide--get-blank-lines (lines) + "Return breaks by LINES." (let ((breaks "")) (while (< 0 lines) (setq lines (1- lines)) (setq breaks (concat breaks "\n"))) breaks)) -(defun org-tree-slide--show-slide-header () - (org-tree-slide--set-slide-header 2)) +(defun org-tree-slide--show-slide-header (&optional lines) + "Show header. When LINES is nil, the default value is 2." + (org-tree-slide--set-slide-header (or lines 2))) (defun org-tree-slide--hide-slide-header () + "Hide header." (when org-tree-slide--header-overlay (delete-overlay org-tree-slide--header-overlay))) (defun org-tree-slide--move-to-the-first-heading () - (setq org-tree-slide--all-skipped t) + "Go to the first heading. Narrowing will be canceled. +If no heading in the buffer, Return nil and stay top of the buffer. +Otherwise, return the point. This doesn't check whether skipping or not." (widen) (goto-char 1) - (unless (looking-at "^\\*+ ") - (outline-next-heading)) - (when (org-tree-slide--heading-skip-p) - (setq org-tree-slide--all-skipped t) - (org-tree-slide--outline-next-heading))) + (if (looking-at "^\\*+ ") + (progn + (beginning-of-line) + (point)) + (outline-next-heading))) (defun org-tree-slide--apply-custom-heading-face (status) - "Change status of heading face." + "Change status of heading face. If STATUS is nil, apply the default values." (unless org-tree-slide-never-touch-face (cond (status (custom-set-faces @@ -813,6 +820,7 @@ concat the headers." )))) (defun org-tree-slide--count-slide (&optional pos) + "Return formatted the slide number. If POS is nil, `point' will be used." (save-excursion (save-restriction (widen) @@ -834,22 +842,44 @@ concat the headers." (t (format "[%d/%d]" current-slide count))))))) +(defun org-tree-slide--last-point-at-bot () + "Return nil, if no heading is the last tree. Otherwise, return the point. +Searching the last point will start from the current cursor position. +Move point to an appropriate position before searching by call this function." + (save-excursion + (save-restriction + (widen) + (unless (org-tree-slide--before-first-heading-p) + (org-tree-slide--beginning-of-tree) + (if (org-tree-slide--heading-skip-p) + (when (outline-previous-heading) + (org-tree-slide--last-point-at-bot)) + (point)))))) + +(defun org-tree-slide--beginning-of-tree () + "Move point to beginning of tree. +If the cursor exist before first heading, do nothing." + (unless (org-tree-slide--before-first-heading-p) + (beginning-of-line) + (unless (org-at-heading-p) + (org-tree-slide--outline-previous-heading)))) + (defun org-tree-slide--active-p () + "Return nil, if the current `major-mode' is not `org-mode'." (and org-tree-slide-mode (equal major-mode 'org-mode))) (defun org-tree-slide--narrowing-p () - "Check the current status if narrowing or not" + "Check the current status if narrowing or not." (not (and (= (point-min) 1) (= (point-max) (1+ (buffer-size)))))) (defun org-tree-slide--before-first-heading-p () - "Extension of org-before-first-heading-p to support org 6.33x. + "Extension of `org-before-first-heading-p' to support org 6.33x. #+TITLE: title ; t #+STARTUP: content ; t * first ; t hoge ; nil ** second ; nil -** third ; nil -" +** third ; nil" (and (org-before-first-heading-p) (not (org-tree-slide--narrowing-p)))) (defun org-tree-slide--first-heading-with-narrow-p () @@ -859,43 +889,35 @@ concat the headers." hoge ; nil *** second ; nil hoge ; nil -*** third ; nil -" +*** third ; nil" (and (org-tree-slide--narrowing-p) (= (point-at-bol) (point-min)))) +(defun org-tree-slide--all-skip-p () + "Check the buffer has at least one slide to be shown." + (save-excursion + (save-restriction + (widen) + (goto-char (1+ (buffer-size))) + (unless (org-tree-slide--last-point-at-bot) + t)))) + (defun org-tree-slide--last-tree-p (target) - "Check if the target point is in the last heading or it's body. + "Check if the TARGET point is in the last heading or it's body. +If every heading is specified as skip, return nil. ** n-1 ; nil ** n ; t - hoge ; t -" + hoge ; t" (save-excursion (save-restriction (widen) (goto-char target) - (if (org-tree-slide--beginning-of-tree) - (= (point) (org-tree-slide--last-heading-position)) - nil)))) - -(defun org-tree-slide--last-heading-position () - "Return the position of the last heading. - If the position does not exist in the buffer, then return nil." - (save-excursion - (save-restriction - (goto-char (buffer-size)) - (org-tree-slide--beginning-of-tree)))) - -(defun org-tree-slide--beginning-of-tree () - "Return beginning point of the line, or t. - If the position does not exist in the buffer, then return nil." - (beginning-of-line) - (if (and (not (org-tree-slide--heading-skip-p)) ;if the header has to be skipped - (org-at-heading-p)) - (point) - (progn - (outline-previous-heading) ;go to previous heading - (org-tree-slide--beginning-of-tree)) ;recursion until a visible heading is found - )) ; return position or nil. + (org-tree-slide--beginning-of-tree) + (let ((p (point)) + (v (goto-char (1+ (buffer-size)))) + (l (org-tree-slide--last-point-at-bot))) + (if l + (= p l) + nil))))) (provide 'org-tree-slide) diff --git a/elpa/org-tree-slide-readme.txt b/elpa/org-tree-slide-readme.txt deleted file mode 100644 index 6e1e536a..00000000 --- a/elpa/org-tree-slide-readme.txt +++ /dev/null @@ -1,36 +0,0 @@ -Requirement: - org-mode 6.33x or higher version - The latest version of the org-mode is recommended. - (see http://orgmode.org/) - -Usage: - 1. Put this elisp into your load-path - 2. Add (require 'org-tree-slide) in your .emacs - 3. Open an org-mode file - 4. Toggle org-tree-slide-mode (M-x org-tree-slide-mode) - then Slideshow will start and you can find "TSlide" in mode line. - 5. / will move between slides - 6. `C-x s c' will show CONTENT of the org buffer - Select a heading and type , then Slideshow will start again. - 7. Toggle org-tree-slide-mode again to exit this minor mode - -Recommended minimum settings: - (global-set-key (kbd "") 'org-tree-slide-mode) - (global-set-key (kbd "S-") 'org-tree-slide-skip-done-toggle) - - and three useful profiles are available. - - 1. Simple use - M-x org-tree-slide-simple-profile - - 2. Presentation use - M-x org-tree-slide-presentation-profile - - 3. TODO Pursuit with narrowing - M-x org-tree-slide-narrowing-control-profile - - Type `C-h f org-tree-slide-mode', you can find more detail. - -Note: - - Make sure key maps below when you introduce this elisp. - - Customize variables, M-x customize-group ENT org-tree-slide ENT -- 2.47.3