├── .github └── FUNDING.yml ├── .gitignore ├── ChangeLog ├── LICENSE ├── README.org ├── org-tree-slide-compt.el └── org-tree-slide.el /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: takaxp # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: takaxp # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | README.html 2 | index.html 3 | *.elc 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2023-03-05 Takaaki ISHIKAWA 2 | 3 | * org-tree-slide.el: This package requires Emacs 25.2 or later 4 | - outline-hide-subtree, outlineshow-children, and outline-show-subtree are NOT defined in outline.el contained in Emacs 25.1 or earlier 5 | - Users of Emacs 25.1 or earlier can still use org-tree-slide.el by loading org-tree-slide-compt.el before activating org-tree-slide.el. 6 | 7 | 2023-02-23 Lukas Zumvorde 8 | 9 | * org-tree-slide.el: Prevent warning messages during native compilation 10 | Add line breaks to docstrings to shorten them to <80 characters per line 11 | Replace deprecated function calls with their new equivalents 12 | - hide-subtree -> outline-hide-subtree 13 | - show-children -> outline-show-children 14 | - show-subtree -> outline-show-subtree 15 | require face-remap file explicitly to ensure face-remap-remove-relative is loaded 16 | Add missing type definition to defcustom of org-subtree-slide-heading-level-{1,2,3,4} 17 | 18 | 2020-06-11 Takaaki ISHIKAWA 19 | 20 | * org-tree-slide.el: Depends on emacs 24.3 21 | Replace org-tree-slide--narrowing-p with buffer-narrowed-p. 22 | 23 | 2020-06-05 Takaaki ISHIKAWA 24 | 25 | * org-tree-slide.el (org-tree-slide-indicator): New plist to control showing messages in mini buffer 26 | 27 | 2020-01-14 Norman Walsh 28 | 29 | * org-tree-slide.el: Add support for date header (#31) 30 | 31 | 2019-07-30 Takaaki ISHIKAWA 32 | 33 | * org-tree-slide.el (org-tree-slide-content--pos): Rename 34 | 35 | 2019-06-30 Boruch Baum 36 | 37 | * org-tree-slide.el (org-tree-slide-content): Toggle back to slide 38 | presentation, to exact position where you left off. 39 | (org-tree-slide-content--pos): New variable to support this feature. 40 | 41 | 2018-11-26 Takaaki ISHIKAWA 42 | 43 | * org-tree-slide.el: Extract header colors from default face of frame 44 | - the implementation of `org-tree-slide-header-overlay-face' is updated so that user don't need to set the variable explicitly. In case user customized theme is updated after loading this package, an appropriate function for updating the face spec should be run in `org-tree-slide-play-hook'. For instance, 45 | (defun my-reload-header-face () 46 | (face-spec-set 'org-tree-slide-header-overlay-face 47 | `((t (:bold t :foreground ,(face-foreground 'default) 48 | :background ,(face-background 'default)))))) 49 | (add-hook 'org-tree-slide-play-hook #'my-reload-header-face) 50 | 51 | 2018-09-06 Takaaki ISHIKAWA 52 | 53 | * org-tree-slide.el: Support additional heading faces (#28) 54 | - outline-1 and outline-4 can be also emphasized. 55 | 56 | 2017-11-30 Takaaki ISHIKAWA 57 | 58 | * org-tree-slide.el: Added a hook for CONTENT viewing mode 59 | 60 | 2016-05-14 Takaaki ISHIKAWA 61 | 62 | * org-tree-slide.el: Merged breadcrumbs feature (#23) (by Matus) 63 | - org-tree-slide-breadcrumbs is added to show breadcrumbs in the header 64 | 65 | 2015-12-23 Takaaki ISHIKAWA 66 | 67 | * org-tree-slide.el: Added Version header 68 | 69 | * org-tree-slide.el: Added a tag for Melpa Stable 70 | 71 | 2015-08-14 Takaaki ISHIKAWA 72 | 73 | * org-tree-slide.el: 'COMMENT'-subtree will be hidden (by Stefano) 74 | - org-tree-slide--show-subtree is added 75 | - Subtrees that start with 'COMMENT' will be hidden during presentation even though org-tree-slide-fold-subtrees-skipped is nil 76 | Thanks to Stefano BENNATI 77 | 78 | 2015-08-09 Takaaki ISHIKAWA 79 | 80 | * org-tree-slide.el: Added a flag to reveal subtrees to be skipped 81 | - org-tree-slide-fold-subtrees-skipped is added 82 | - The original idea was proposed by bennati (https://github.com/bennati) 83 | - org-tree-slide--heading-level-skip-p was revised so that the status can be checked by providing an arbitrary level number. 84 | 85 | 2015-02-27 Takaaki ISHIKAWA 86 | 87 | * org-tree-slide.el: Hide org-clock related code 88 | - To reduce loading time, org-clock related code was hidden. 89 | 90 | 2015-02-20 Takaaki ISHIKAWA 91 | 92 | * org-tree-slide.el: Default keymap was changed 93 | - Due to many reports on conflicting key binding, `' and `', these keymap changed to `C->' and `C-<'. 94 | 95 | * org-tree-slide.el: Add new hooks and rename old hooks 96 | - Added `org-tree-slide-before-move-next-hook' and `org-tree-slide-before-move-previous-hook' 97 | - Renamed hooks. `org-tree-slide-mode-play-hook', `org-tree-slide-mode-stop-hook', `org-tree-slide-mode-before-narrow-hook', `org-tree-slide-mode-after-narrow-hook' will be obsoleted soon. 98 | 99 | 2015-02-15 Takaaki ISHIKAWA 100 | 101 | * org-tree-slide.el (org-tree-slide): Replace ots- with org-tree-slide-- 102 | - According to the Coding Conventions provided from gnu.org, the prefix for internal functions should be described with two hyphens to avoid name conflicts with other packages. 103 | 104 | 2015-02-14 Takaaki ISHIKAWA 105 | 106 | * org-tree-slide: Refine displaying slide number in modeline 107 | - If 'lighter is specified, the slide number will be updated aggressively, then it's slow. On the other hand, 'outside is specified which will be shown quickly in the same position of 'lighter because it changes the number only if a slide is moved to the next/previous slide. 108 | 109 | * org-tree-slide: Added two hooks 110 | - org-tree-slide-mode-before-narrow-hook 111 | - org-tree-slide-mode-after-narrow-hook 112 | 113 | 2015-01-12 Takaaki ISHIKAWA 114 | 115 | * org-tree-slide.el (ots-stop): Suppress an error message from org-timer 116 | - When the presentation start without any timer setting, `org-timer-stop' reports an error "No timer running". Updated code supresses the report. 117 | 118 | * org-tree-slide.el (org-tree-slide-content): Hide skipped slides when CONTENT mode 119 | - Use `ots-skip-outline-level' in `ots-slide-content' (#8) 120 | Thanks to Eike Kettner 121 | Headlines that are skipped in presentation don't need to show up when 122 | displaying contents. 123 | 124 | 2013-07-21 Takaaki ISHIKAWA 125 | 126 | * org-tree-slide.el (ots-count-slide): Revised to distinguish status 127 | [-/-] ... before first heading and no headings in the buffer 128 | [-/%d] ... before first heading 129 | [%d/%d] ... slides 130 | 131 | * org-tree-slide.el: Support no headings 132 | - org-tree-slide-move-next-tree and org-tree-slide-move-previous-tree 133 | - Removed hide-subtree to avoid an error 134 | - ots-display-tree-with-narrow 135 | - ots-before-first-heading-p is used to wrap hide-subtree 136 | - (org-cycle-hide-drawers 'all) is disabled to speed up 137 | 138 | 2013-02-19 Takaaki ISHIKAWA 139 | 140 | * org-tree-slide.el (org-tree-slide-never-touch-face): Added a flag 141 | If this flag is `t', face settings wil NOT be touched. 142 | 143 | * org-tree-slide.el: support all trees are skipped 144 | - ots-move-to-the-first-heading 145 | - ots-all-skipped, as a flag 146 | - ots-heading-skip-p 147 | - ots-heading-level-skip-p 148 | - ots-heading-done-skip-p 149 | - ots-heading-skip-comment-p 150 | - ots-outline-select-method: [-/-] will be shown in mode line 151 | 152 | * org-tree-slide.el (ots-count-slide): remove unused code 153 | 154 | 2013-02-17 Takaaki ISHIKAWA 155 | 156 | * org-tree-slide.el (org-tree-slide-skip-comments-toggle): Added a toggle 157 | 158 | 2013-02-12 Takaaki ISHIKAWA 159 | 160 | * org-tree-slide.el: Issues #2, #5, #7 161 | - Added org-tree-slide-skip-comments to skip a tree with COMMENT (#5) 162 | Thanks to Eric S Fraga 163 | - Remove brackets from title (#7) 164 | - Added org-tree-slide-activate-message and 165 | org-tree-slide-deactivate-message to specify messages in mini-buffer (#2) 166 | 167 | 2013-01-27 Takaaki ISHIKAWA 168 | 169 | * org-tree-slide.el: Added hooks for start and stop presentation 170 | 171 | 2012-11-21 Takaaki ISHIKAWA 172 | 173 | * org-tree-slide.el: Support dark color theme (by @uk-ar) 174 | Thanks to ARISAWA-san. 175 | 176 | 2012-01-11 Takaaki ISHIKAWA 177 | 178 | * org-tree-slide.el: Add autoload magic comments 179 | 180 | 2011-12-18 Takaaki ISHIKAWA 181 | 182 | * org-tree-slide.el (org-tree-slide-move-next-tree): Fix a bug 183 | Support an org buffer without any header 184 | 185 | 2011-12-17 Takaaki ISHIKAWA 186 | 187 | * org-tree-slide.el: org-tree-slide-skip-done set nil as default 188 | 189 | 2011-12-12 Takaaki ISHIKAWA 190 | 191 | * org-tree-slide.el: Remove auto-play function (TBD) 192 | Auo-play function is under consideration as a future work. 193 | 194 | 2011-12-09 Takaaki ISHIKAWA 195 | 196 | * org-tree-slide.el: Add an option to control modeline display 197 | 198 | 2011-12-08 Takaaki ISHIKAWA 199 | 200 | * org-tree-slide.el (ots-update-modeline): Reduce redundant processing 201 | 202 | 2011-12-07 Takaaki ISHIKAWA 203 | 204 | * org-tree-slide.el: Add a new profile to control narrowing status 205 | - You can control a status of narrowing or not by this profile. 206 | Assigned a single key to `org-tree-slide-mode' is recommended, like 207 | (global-set-key (kbd "") 'org-tree-slide-mode) 208 | - Modify the way to display the current slide number. 209 | Replace " TSlide" by slide number in mode-line, like [1/10]. 210 | 211 | * org-tree-slide.el: Support displaying a slide number in a mode-line. 212 | 213 | * org-tree-slide.el: Adopt minor mode 214 | org-tree-slide adopt a minor mode! 215 | org-tree-slide-play and org-tree-slide-stop are replaced 216 | by org-tree-slide-mode. 217 | When you make org-tree-slide-mode active, org-tree-slide-play is called. 218 | Deactive it, org-tree-slide-stop will be called automatically. 219 | 220 | 2011-12-06 Takaaki ISHIKAWA 221 | 222 | * org-tree-slide.el: Support TITLE/AUTHOR/EMAIL in a header 223 | If #+TITLE:, #+AUTHOR:, or #+EMAIL: has a description in your org buffer, 224 | it will be used in the slide header. 225 | 226 | 2011-12-05 Takaaki ISHIKAWA 227 | 228 | * org-tree-slide.el: Fix an issue of title display 229 | 230 | * org-tree-slide.el: Fix the end of slide for skip ccontrol 231 | 232 | * org-tree-slide.el (org-tree-slide-skip-outline-level): 233 | Add skip control by heading level. Skip the current slide if the level 234 | is higher than or equal to this variable. 235 | 236 | 2011-12-02 Takaaki ISHIKAWA 237 | 238 | * org-tree-slide.el: Change function names, ots- is introduced. 239 | Two profiles were defined: 240 | org-tree-slide-simple-profile (no effect, no header) 241 | org-tree-slide-presentation-profile (slide-in effect, title header) 242 | 243 | 2011-11-02 Takaaki ISHIKAWA 244 | 245 | * org-tree-slide.el (tree-slide-content): 246 | Add CONTENT view to see all the subtrees. 247 | You can show the index of your slide using CONTENT view during slideshow. 248 | Find a tree that you want to restart your slideshow, and just type . 249 | 250 | 2011-10-30 Takaaki ISHIKAWA 251 | 252 | * org-tree-slide.el (tree-slide-slide-in): Add slide-in visual effect 253 | If you don't like this effect, use (setq tree-slide-slide-in-effect nil). 254 | You can also control the distance of moving slide-in trees, use 255 | `tree-slide-slide-in-brank-lines'. 256 | 257 | * org-tree-slide.el (tree-slide-slide-in-waiting): 258 | Add a variable to control slide-in duration. 259 | If you feel the slide-in speed so fast, then set this value bigger like 260 | `(setq tree-slide-slide-in-waiting 0.05)' 261 | 262 | 2011-10-28 Takaaki ISHIKAWA 263 | 264 | * org-tree-slide.el (tree-slide-play): Add timer to count down presentation 265 | By default, timer will NOT be activated. If you use a count down timer, 266 | please use prefix (C-u) when starting up slide view. Which means 267 | `C-u C-x sp ' is the right command. 268 | 269 | * org-tree-slide.el: Add play and stop function, and show slide header 270 | To play the slide, type `C-x s p'. 271 | To stop the slide, type `C-x s s'. 272 | 273 | * org-tree-slide.el: Add a function to change mode-line during presentation 274 | 275 | 2011-09-28 Takaaki ISHIKAWA 276 | 277 | * org-tree-slide.el: Initial release 278 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | #+title: README for Org Tree Slide 2 | #+author: Takaaki Ishikawa 3 | #+email: takaxp@ieee.org 4 | #+date: [2023-08-26 Sat 22:20] 5 | #+startup: content 6 | 7 | [[http://melpa.org/#/org-tree-slide][http://melpa.org/packages/org-tree-slide-badge.svg]] 8 | [[http://stable.melpa.org/#/org-tree-slide][http://stable.melpa.org/packages/org-tree-slide-badge.svg]] 9 | 10 | #+caption: An example demo of org-tree-slide 11 | [[https://github.com/takaxp/contents/blob/master/org-tree-slide/demo1.gif]] 12 | 13 | * 1. What's this? 14 | 15 | The main purpose of this elisp is to handle each tree in an org buffer as a slide by simple narrowing. This emacs lisp is a minor mode for Emacs Org-mode. 16 | 17 | Main features: 18 | 19 | - Live editable presentation 20 | - Fast switching of narrowing/widen 21 | - TODO pursuit with narrowing 22 | - Displaying the current number of slides in mode line 23 | - CONTENT view during a presentation 24 | - Slide-in effect 25 | - Slide header from org file's header 26 | - Countdown timer 27 | 28 | ** 1-1. Related packages 29 | 30 | There are various packages to make a presentation with org-mode. See [[http://orgmode.org/worg/org-tutorials/non-beamer-presentations.html]]. For more simple use, [[https://github.com/zonuexe/emacs-presentation-mode][presentation.el]] may suitable. 31 | 32 | * 2. Install 33 | 34 | 1. Put this elisp into your load-path 35 | 2. Add =(require 'org-tree-slide)= in your =.emacs= 36 | 37 | OR 38 | 39 | 1. Eval: =(auto-install-from-url "https://raw.github.com/takaxp/org-tree-slide/master/org-tree-slide.el")= (for auto-install users) 40 | 2. Add =(require 'org-tree-slide)= in your =.emacs= 41 | 42 | Then open an org file, just type =C-<= and =C->=, which means =C-M-,= and =C-M-.=, you can see a presentation will begin with a header, slide-in effect, and slide number in mode line. 43 | 44 | It is recommended to change the keybindings to make your presentation smoothly. Here is an example. 45 | 46 | #+begin_src emacs-lisp 47 | (with-eval-after-load "org-tree-slide" 48 | (define-key org-tree-slide-mode-map (kbd "") 'org-tree-slide-move-previous-tree) 49 | (define-key org-tree-slide-mode-map (kbd "") 'org-tree-slide-move-next-tree) 50 | ) 51 | #+end_src 52 | 53 | ** 2.1 el-get recipe 54 | 55 | If you are an [[https://github.com/dimitri/el-get][el-get]] user, just do 56 | 57 | : M-x el-get-install RET org-tree-slide 58 | 59 | ** 2.2 MELPA 60 | 61 | Now, you can install `org-tree-slide' via [[http://melpa.org/#/org-tree-slide][MELPA]]. 62 | 63 | ** 2.2 Requirements 64 | - Org-mode 6.33x or higher version is required. 65 | - This elisp doesn't require any additional packages. 66 | - Emacs 25.2 or later is required. But users of Emacs 25.1 or earlier (at least 24.4) can still use this package. Please load =org-tree-slide-compt.el= before activating org-tree-slide.el. 67 | 68 | ** 2.3 additional package (moom.el) 69 | 70 | Normally, presentations will appear in full screen or frame maximized. [[https://github.com/takaxp/moom#org-mode-org-tree-slide][moom]] is useful in such cases since the package can change frame position and size by keyboard and the font size will be increased suitably for your presentation. 71 | 72 | * 3. Recommended settings 73 | 74 | Assigning a single key to =org-tree-slide-mode= is recommended. 75 | 76 | #+begin_src emacs-lisp 77 | (global-set-key (kbd "") 'org-tree-slide-mode) 78 | (global-set-key (kbd "S-") 'org-tree-slide-skip-done-toggle) 79 | #+end_src 80 | 81 | OR 82 | 83 | #+begin_src emacs-lisp 84 | (define-key org-mode-map (kbd "") 'org-tree-slide-mode) 85 | (define-key org-mode-map (kbd "S-") 'org-tree-slide-skip-done-toggle) 86 | #+end_src 87 | 88 | * 4. Profiles 89 | 90 | Three useful profiles are available. Please select a profile that is the most suitable for your using scenario. 91 | 92 | If you select =simple= profile, call the following command while =org-tree-slide-mode= is ON. 93 | 94 | #+begin_src emacs-lisp 95 | M-x org-tree-slide-simple-profile 96 | #+end_src 97 | 98 | If you want to use this setting as the default, put the following configuration including recommended settings into your =.emacs=. 99 | 100 | #+begin_src emacs-lisp 101 | (when (require 'org-tree-slide nil t) 102 | (global-set-key (kbd "") 'org-tree-slide-mode) 103 | (global-set-key (kbd "S-") 'org-tree-slide-skip-done-toggle) 104 | (org-tree-slide-simple-profile)) 105 | #+end_src 106 | 107 | =org-tree-slide-presentation-profile= and =org-tree-slide-narrowing-control-profile= are also available. 108 | 109 | ** 4-1. `Simple' 110 | 111 | This profile will display trees in your org buffer by simple narrowing. You can change trees without =widen= command. Most of the visual effect is disabled. 112 | 113 | Type =M-x org-tree-slide-simple-profile= while =org-tree-slide-mode= is ON. 114 | 115 | 1. No header display 116 | 2. No slide-in effect 117 | 3. The cursor will move to the head of the buffer when exit 118 | 4. No slide number display in mode line 119 | 5. Display every type of tree except =org-comment-string= (e.g. COMMENT) 120 | 121 | ** 4-2. `Presentation' 122 | 123 | This profile is the default setting of org-tree-slide. If an org buffer includes =#+title:=, =#+email:=, and =#+author:=, org-tree-slide attempts to use those variables in the slide header. A date in the header will be set with the presentation of the day. You can enjoy a slide-in effect, the current slide number in mode line. 124 | 125 | # A presentation with a count down timer is started by =M-x org-tree-slide-play-with-timer=. 126 | 127 | If you want to show the content of your presentation, type =C-x s c= or =M-x org-tree-slide-content=. All of the headings will be shown in a buffer like a Table Of Content except some headings configured as skipping by =org-tree-slide-skip-outline-level=. Find a heading that you want to show, and type =C->=, the presentation will be resumed. 128 | 129 | It is possible to skip slides when a heading level is higher than or equal to a value of =org-tree-slide-skip-outline-level=. see User variables. 130 | 131 | To exit a presentation, set =org-tree-slide-mode= OFF. The cursor move to the head of the buffer and the trees will be rendered according to the value of =#+startup:= if possible. 132 | 133 | =M-x org-tree-slide-presentation-profile= 134 | 135 | 1. Display header 136 | 2. Enable slide-in effect 137 | 3. The cursor will move to the head of buffer when exit 138 | 4. Display slide number in mode line 139 | 5. Display every type of tree except =org-comment-string= (e.g. COMMENT) 140 | 141 | ** 4-3. `TODO Pursuit with narrowing' 142 | 143 | This profile will display trees restricted to =TODO status= without a header and slide-in effect. It is very useful to concentrate your focus on the current TODO item that is not done, and go to the next task by typing of =C->=. This is "TODO Pursuit with narrowing". If you want to track every kind of tree including finished items, toggle =M-x org-tree-slide-skip-done-toggle= OFF. 144 | 145 | When you exit =org-tree-slide-mode=, the cursor will keep the same position, it is therefore possible to focus again by toggle =M-x org-tree-slide-mode=. 146 | 147 | If you feel the cursor moving is very slow, please change a value of =org-tree-slide-modeline-display= to ='outside= or =nil=. 148 | 149 | =M-x org-tree-slide-narrowing-control-profile= 150 | 151 | 1. No header display 152 | 2. No slide-in effect 153 | 3. The cursor will keep the same position when exit 154 | 4. Display slide number in mode line 155 | 5. Display TODO trees only except =org-comment-string= (e.g. COMMENT) 156 | 157 | * 5. User variables 158 | 159 | #+caption: User variables 160 | |----+--------------------------------------------+---------------+---------| 161 | | | Variable | Default value | Select | 162 | |----+--------------------------------------------+---------------+---------| 163 | | 1 | org-tree-slide-skip-outline-level | 0 | Numeric | 164 | | 2 | org-tree-slide-header | t | Boolean | 165 | | 3 | org-tree-slide-slide-in-effect | t | Boolean | 166 | | 4 | org-tree-slide-cursor-init | t | Boolean | 167 | | 5 | org-tree-slide-slide-in-blank-lines | 10 | Numeric | 168 | | 6 | org-tree-slide-slide-in-waiting | 0.02 | Float | 169 | | 7 | org-tree-slide-heading-emphasis | nil | Boolean | 170 | | 8 | org-tree-slide-never-touch-face | nil | Boolean | 171 | | 9 | org-tree-slide-skip-done | nil | Boolean | 172 | | 10 | org-tree-slide-skip-comments | t | [*1] | 173 | | 11 | org-tree-slide-activate-message | Hello... | String | 174 | | 12 | org-tree-slide-deactivate-message | Quit, Bye! | String | 175 | | 13 | org-tree-slide-modeline-display | 'outside | [*2] | 176 | | 14 | org-tree-slide-fold-subtrees-skipped | t | Boolean | 177 | | 15 | org-tree-slide-breadcrumbs | " > " | String | 178 | | 16 | org-tree-slide-breadcrumbs-hide-todo-state | t | Boolean | 179 | | 17 | org-tree-slide-indicator | plist | [*3] | 180 | 181 | #+begin_quote 182 | [*1] { nil | t | 'inherit } 183 | t: skip only the current heading with COMMENT, child headings without COMMENT will be shown, 184 | 'inherit: skip headings with COMMENT and its child headings, 185 | nil: show even if it has COMMENT. 186 | (note) =org-tree-slide-skip-comments-toggle= will switch between ~t~ and ~nil~ normally, but if =org-tree-slide-skip-comments= is specified as ~'inherit~, then the toggle will switch between ~'inherit~ and ~t~. 187 | 188 | [*2] { nil | 'lighter | 'outside } 189 | 'outside: shown in the mode line outside of lighter, 190 | 'lighter: shown in lighter (slow), 191 | nil: nothing to be shown. 192 | 193 | [*3] '(:next " Next >>" :previous "<< Previous" :content "<< CONTENT >>") 194 | If you prefer to show nothing for entering content mode, then specify as 195 | '(:next " Next >>" :previous "<< Previous" :content nil) 196 | #+end_quote 197 | 198 | ** 5-1. Useful settings for experts 199 | 200 | If you like this elisp, the following setting is more useful. Try it! 201 | 202 | In this case, == / == / == / == are assigned in order to control org-tree-slide. 203 | 204 | #+begin_src emacs-lisp 205 | (when (require 'org-tree-slide nil t) 206 | (global-set-key (kbd "") 'org-tree-slide-mode) 207 | (global-set-key (kbd "S-") 'org-tree-slide-skip-done-toggle) 208 | (define-key org-tree-slide-mode-map (kbd "") 209 | 'org-tree-slide-move-previous-tree) 210 | (define-key org-tree-slide-mode-map (kbd "") 211 | 'org-tree-slide-move-next-tree) 212 | (define-key org-tree-slide-mode-map (kbd "") 213 | 'org-tree-slide-content) 214 | (setq org-tree-slide-skip-outline-level 4) 215 | (org-tree-slide-narrowing-control-profile) 216 | (setq org-tree-slide-skip-comments 'inherit) 217 | (setq org-tree-slide-skip-done nil)) 218 | #+end_src 219 | 220 | * 6. Functions 221 | ** Control functions 222 | 223 | - org-tree-slide-move-next-tree (=C->=) 224 | - org-tree-slide-move-previous-tree (=C-<=) 225 | - org-tree-slide-content (=C-x s c=) 226 | 227 | ** Startup options 228 | 229 | These functions will toggle =org-tree-slide-mode= ON, automatically. 230 | 231 | - org-tree-slide-without-init-play 232 | - org-tree-slide-play-with-timer 233 | 234 | ** Toggle variables 235 | 236 | - org-tree-slide-display-header-toggle 237 | - org-tree-slide-slide-in-effect-toggle 238 | - org-tree-slide-skip-done-toggle 239 | - org-tree-slide-skip-comments-toggle 240 | - org-tree-slide-heading-emphasis-toggle 241 | 242 | ** Batch setting of user variables 243 | 244 | - org-tree-slide-simple-profile 245 | - org-tree-slide-presentation-profile 246 | - org-tree-slide-narrowing-control-profile 247 | 248 | ** Hooks 249 | 250 | - org-tree-slide-play-hook 251 | - org-tree-slide-stop-hook 252 | - org-tree-slide-before-narrow-hook 253 | - org-tree-slide-after-narrow-hook 254 | - org-tree-slide-before-move-next-hook 255 | - org-tree-slide-before-move-previous-hook 256 | 257 | NOTE: For senior user, some hook were renamed, please update your configurations 258 | 259 | * 7. Additional settings 260 | ** Hide org-meta-line 261 | 262 | The following code could be useful if you want to make =#+= lines invisible during presentation. 263 | 264 | #+begin_src emacs-lisp 265 | (with-eval-after-load "org-tree-slide" 266 | (defvar my-hide-org-meta-line-p nil) 267 | (defun my-hide-org-meta-line () 268 | (interactive) 269 | (setq my-hide-org-meta-line-p t) 270 | (set-face-attribute 'org-meta-line nil 271 | :foreground (face-attribute 'default :background))) 272 | (defun my-show-org-meta-line () 273 | (interactive) 274 | (setq my-hide-org-meta-line-p nil) 275 | (set-face-attribute 'org-meta-line nil :foreground nil)) 276 | 277 | (defun my-toggle-org-meta-line () 278 | (interactive) 279 | (if my-hide-org-meta-line-p 280 | (my-show-org-meta-line) (my-hide-org-meta-line))) 281 | 282 | (add-hook 'org-tree-slide-play-hook #'my-hide-org-meta-line) 283 | (add-hook 'org-tree-slide-stop-hook #'my-show-org-meta-line)) 284 | #+end_src 285 | 286 | 287 | * 8. History 288 | 289 | see also [[https://github.com/takaxp/org-tree-slide/blob/master/ChangeLog][ChangeLog]] for details 290 | 291 | |---------+------------------+-----------------------------------------| 292 | | Version | Date | Description | 293 | |---------+------------------+-----------------------------------------| 294 | | v2.8.0 | 2015-02-20@21:27 | Changed Keymap, and renamed/added hooks | 295 | | v2.7.0 | 2013-07-21@05:21 | Support buffers without headings | 296 | | v2.6.0 | 2012-11-21@02:14 | Support dark color theme | 297 | | v2.5.0 | 2011-12-12@18:16 | Remove auto-play function (TBD) | 298 | | v2.4.0 | 2011-12-08@10:51 | Support TODO pursuit in a slideshow | 299 | | v2.3.0 | 2011-12-07@16:17 | Support displaying a slide number | 300 | | v2.2.0 | 2011-12-07@02:15 | Support minor mode | 301 | | v2.0.0 | 2011-12-01@17:41 | Add profiles and support org 6.33x | 302 | | v1.0.0 | 2011-09-28@20:59 | Release the initial version | 303 | 304 | * 9. Contact 305 | 306 | The author is Takaaki ISHIKAWA (takaxp@ieee.org). 307 | Feel free to email me or use a mention of twitter ([[https://twitter.com/#!/takaxp][@takaxp]]) 308 | 309 | * 10. Videos 310 | 311 | We can watch some videos that kindly introduce =org-tree-slide.el=: 312 | - [[https://www.youtube.com/watch?v=vz9aLmxYJB0][Emacs Tips - How to Give Presentations with Org Mode]] (presented by [[https://www.youtube.com/channel/UCAiiOTio8Yu69c3XnR7nQBQ][System Crafters]]) 313 | - [[https://www.youtube.com/watch?v=uSwJQIGMyPk][Show presentation using Org Mode]] (presented by [[https://www.youtube.com/channel/UC0ds7DW6IIl7mXcyz5vMEHQ][Blackberry Boy]]) 314 | 315 | Thank you! 316 | -------------------------------------------------------------------------------- /org-tree-slide-compt.el: -------------------------------------------------------------------------------- 1 | ;; These functions shall be loaded for Emacs 25.1 or earlier. 2 | ;; outline-show-children <- show-children 3 | ;; outline-show-subtree <- show-subtree 4 | ;; outline-hide-subtree <- hide-subtree 5 | 6 | (defun outline-show-children (&optional level) 7 | "Show all direct subheadings of this heading. 8 | Prefix arg LEVEL is how many levels below the current level should be shown. 9 | Default is enough to cause the following heading to appear." 10 | (interactive "P") 11 | (setq level 12 | (if level (prefix-numeric-value level) 13 | (save-excursion 14 | (outline-back-to-heading) 15 | (let ((start-level (funcall outline-level))) 16 | (outline-next-heading) 17 | (if (eobp) 18 | 1 19 | (max 1 (- (funcall outline-level) start-level))))))) 20 | (let (outline-view-change-hook) 21 | (save-excursion 22 | (outline-back-to-heading) 23 | (setq level (+ level (funcall outline-level))) 24 | (outline-map-region 25 | (lambda () 26 | (if (<= (funcall outline-level) level) 27 | (outline-show-heading))) 28 | (point) 29 | (progn (outline-end-of-subtree) 30 | (if (eobp) (point-max) (1+ (point))))))) 31 | (run-hooks 'outline-view-change-hook)) 32 | 33 | 34 | (defun outline-show-subtree (&optional event) 35 | "Show everything after this heading at deeper levels. 36 | If non-nil, EVENT should be a mouse event." 37 | (interactive (list last-nonmenu-event)) 38 | (save-excursion 39 | (when (mouse-event-p event) 40 | (mouse-set-point event)) 41 | (outline-flag-subtree nil))) 42 | 43 | (defun outline-hide-subtree (&optional event) 44 | "Hide everything after this heading at deeper levels. 45 | If non-nil, EVENT should be a mouse event." 46 | (interactive (list last-nonmenu-event)) 47 | (save-excursion 48 | (when (mouse-event-p event) 49 | (mouse-set-point event)) 50 | (outline-flag-subtree t))) 51 | -------------------------------------------------------------------------------- /org-tree-slide.el: -------------------------------------------------------------------------------- 1 | ;;; org-tree-slide.el --- A presentation tool for org-mode 2 | ;; 3 | ;; Copyright (C) 2011-2023 Takaaki ISHIKAWA 4 | ;; 5 | ;; Author: Takaaki ISHIKAWA 6 | ;; Version: 2.8.22 7 | ;; Package-Requires: ((emacs "25.2")) 8 | ;; Maintainer: Takaaki ISHIKAWA 9 | ;; Twitter: @takaxp 10 | ;; URL: https://github.com/takaxp/org-tree-slide 11 | ;; Keywords: convenience, org-mode, presentation, narrowing 12 | ;; 13 | ;; Committers: Yuuki ARISAWA (@uk-ar) 14 | ;; Eric S Fraga 15 | ;; Eike Kettner 16 | ;; Stefano BENNATI 17 | ;; Matus Goljer 18 | ;; Boruch Baum 19 | ;; 20 | ;; This program is free software: you can redistribute it and/or modify 21 | ;; it under the terms of the GNU General Public License as published by 22 | ;; the Free Software Foundation; either version 3 of the License, or 23 | ;; (at your option) any later version. 24 | ;; 25 | ;; This program is distributed in the hope that it will be useful, 26 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | ;; GNU General Public License for more details. 29 | ;; 30 | ;; You should have received a copy of the GNU General Public License 31 | ;; along with GNU Emacs; see the file COPYING. If not, write to the 32 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 33 | ;; Boston, MA 02110-1301, USA. 34 | ;; 35 | 36 | ;;; Commentary: 37 | 38 | ;; Requirement: 39 | ;; org-mode 6.33x or higher version 40 | ;; The latest version of the org-mode is recommended. 41 | ;; (see https://orgmode.org/) 42 | ;; 43 | ;; Usage: 44 | ;; 1. Put this elisp into your load-path 45 | ;; 2. Add (require 'org-tree-slide) in your .emacs 46 | ;; 3. Open an org-mode file 47 | ;; 4. Toggle org-tree-slide-mode (M-x org-tree-slide-mode) 48 | ;; then Slideshow will start and you can find "TSlide" in mode line. 49 | ;; 5. `C-<'/`C->' will move between slides 50 | ;; 6. `C-x s c' will show CONTENT of the org buffer 51 | ;; Select a heading and type `C-<', then Slideshow will start again. 52 | ;; 7. Toggle org-tree-slide-mode again to exit this minor mode 53 | ;; 54 | ;; Recommended minimum settings: 55 | ;; (global-set-key (kbd "") 'org-tree-slide-mode) 56 | ;; (global-set-key (kbd "S-") 'org-tree-slide-skip-done-toggle) 57 | ;; 58 | ;; and three useful profiles are available. 59 | ;; 60 | ;; 1. Simple use 61 | ;; M-x org-tree-slide-simple-profile 62 | ;; 63 | ;; 2. Presentation use 64 | ;; M-x org-tree-slide-presentation-profile 65 | ;; 66 | ;; 3. TODO Pursuit with narrowing 67 | ;; M-x org-tree-slide-narrowing-control-profile 68 | ;; 69 | ;; Type `C-h f org-tree-slide-mode', you can find more detail. 70 | ;; 71 | ;; Note: 72 | ;; - Make sure key maps below when you introduce this elisp. 73 | ;; - Customize variables, M-x customize-group ENT org-tree-slide ENT 74 | ;; - see also moom.el (https://github.com/takaxp/moom) to control Emacs frame 75 | 76 | ;;; Code: 77 | 78 | (require 'org) 79 | (require 'org-timer) 80 | (require 'face-remap) 81 | 82 | (defconst org-tree-slide "2.8.22" 83 | "The version number of the org-tree-slide.el.") 84 | 85 | (defgroup org-tree-slide nil 86 | "User variables for `org-tree-slide'." 87 | :group 'org-structure) 88 | 89 | (defcustom org-tree-slide-skip-outline-level 0 90 | "Skip slides if a heading level is higher than or equal to this variable. 91 | 92 | `0': never skip at any heading 93 | `1': will skip all slides and be terminated automatically. 94 | Not recommended to use this number. 95 | e.g. set `4', 96 | *** heading A ; display as a slide 97 | entry 98 | **** heading B ; skip! do not display as the next slide 99 | **** heading C ; skip! 100 | *** heading D ; display as the next slide" 101 | :type 'integer 102 | :group 'org-tree-slide) 103 | 104 | (defcustom org-tree-slide-fold-subtrees-skipped t 105 | "If this flag is true, the subtrees in a slide will be displayed in fold. 106 | 107 | When nil, the body of the subtrees will be revealed." 108 | :type 'boolean 109 | :group 'org-tree-slide) 110 | 111 | (defcustom org-tree-slide-header t 112 | "The status of displaying the slide header." 113 | :type 'boolean 114 | :group 'org-tree-slide) 115 | 116 | (defcustom org-tree-slide-content-margin-top 2 117 | "Specify the margin between the slide header and its content." 118 | :type 'integer 119 | :group 'org-tree-slide) 120 | 121 | (defcustom org-tree-slide-slide-in-effect t 122 | "Using a visual effect of slide-in for displaying trees." 123 | :type 'boolean 124 | :group 'org-tree-slide) 125 | 126 | (defcustom org-tree-slide-cursor-init t 127 | "Specify a cursor position at start and exit of the slideshow. 128 | 129 | Non-nil: the cursor will move automatically to the head of buffer. 130 | nil: keep the same position. The slideshow will start from the heading 131 | that has the cursor." 132 | :type 'boolean 133 | :group 'org-tree-slide) 134 | 135 | (defcustom org-tree-slide-slide-in-blank-lines 10 136 | "Specify the number of blank lines, the slide will move from this line." 137 | :type 'integer 138 | :group 'org-tree-slide) 139 | 140 | (defcustom org-tree-slide-slide-in-waiting 0.02 141 | "Specify the duration waiting the next update of overlay." 142 | :type 'float 143 | :group 'org-tree-slide) 144 | 145 | (defcustom org-tree-slide-heading-emphasis nil 146 | "Specify to use a custom face heading, or not." 147 | :type 'boolean 148 | :group 'org-tree-slide) 149 | 150 | (defcustom org-tree-slide-never-touch-face nil 151 | "If t, do NOT touch any face setting." 152 | :type 'boolean 153 | :group 'org-tree-slide) 154 | 155 | (defcustom org-tree-slide-skip-done nil 156 | "Specify to show TODO item only or not." 157 | :type 'boolean 158 | :group 'org-tree-slide) 159 | 160 | (defcustom org-tree-slide-skip-comments t 161 | "Specify to skip COMMENT item or not. 162 | t: skip only the current heading with COMMENT, 163 | child headings without COMMENT will be shown 164 | inherit: skip headings with COMMENT and its child headings 165 | nil: show even if it has COMMENT." 166 | :type '(choice 167 | (const :tag "Skip only headings with COMMENT" t) 168 | (const :tag "Skip headings with COMMENT and its child headings" 169 | inherit) 170 | (const :tag "Show headings even if it has COMMENT" nil)) 171 | :group 'org-tree-slide) 172 | 173 | (defcustom org-tree-slide-activate-message 174 | "Hello! This is org-tree-slide :-)" 175 | "Message in mini buffer when \"org-tree-slide\" is activated." 176 | :type 'string 177 | :group 'org-tree-slide) 178 | 179 | (defcustom org-tree-slide-deactivate-message 180 | "Quit, Bye!" 181 | "Message in mini buffer when \"org-tree-slide\" is deactivated." 182 | :type 'string 183 | :group 'org-tree-slide) 184 | 185 | (defcustom org-tree-slide-modeline-display 'outside 186 | "Specify how to display the slide number in mode line. 187 | 188 | \='lighter: shown in lighter (update info actively, then it's slow) 189 | \='outside: update infomation when moving to the next/previous slide 190 | nil: nothing to be shown" 191 | :type 'symbol 192 | :group 'org-tree-slide) 193 | 194 | (defcustom org-tree-slide-indicator 195 | '(:next " Next >>" :previous "<< Previous" :content "<< CONTENT >>") 196 | "Specify the indication messages for changing slides. 197 | The specified string for NEXT will be used in `org-tree-slide-move-next-tree', 198 | PREVIOUS will be used in `org-tree-slide-move-previous-tree'. 199 | CONTENT will be used in `org-tree-slide-content'. 200 | If you want to show anything, just specify nil." 201 | :type 'plist 202 | :group 'org-tree-slide) 203 | 204 | (defvar org-tree-slide-mode-map 205 | (let ((map (make-sparse-keymap))) 206 | (define-key map (kbd "C-x s c") 'org-tree-slide-content) 207 | ;; (define-key map (kbd "C-x s r") 'org-tree-slide-resume) ;; TODO 208 | (define-key map (kbd "C-<") 'org-tree-slide-move-previous-tree) 209 | (define-key map (kbd "C->") 'org-tree-slide-move-next-tree) 210 | map) 211 | "The keymap for `org-tree-slide'.") 212 | 213 | (defcustom org-tree-slide-heading-level-1 214 | '(outline-1 :height 1.5 bold) 215 | "Level 1." 216 | :type 'list 217 | :group 'org-tree-slide) 218 | 219 | (defcustom org-tree-slide-heading-level-2 220 | '(outline-2 :height 1.4 bold) 221 | "Level 2." 222 | :type 'list 223 | :group 'org-tree-slide) 224 | 225 | (defcustom org-tree-slide-heading-level-3 226 | '(outline-3 :height 1.3 bold) 227 | "Level 3." 228 | :type 'list 229 | :group 'org-tree-slide) 230 | 231 | (defcustom org-tree-slide-heading-level-4 232 | '(outline-4 :height 1.2 bold) 233 | "Level 4." 234 | :type 'list 235 | :group 'org-tree-slide) 236 | 237 | (defvar-local org-tree-slide-heading-level-1-cookie nil) 238 | (defvar-local org-tree-slide-heading-level-2-cookie nil) 239 | (defvar-local org-tree-slide-heading-level-3-cookie nil) 240 | (defvar-local org-tree-slide-heading-level-4-cookie nil) 241 | 242 | (defvar org-tree-slide-mode nil) 243 | (defvar org-tree-slide-play-hook nil 244 | "A hook run when `org-tree-slide--play' is evaluated to start the slideshow.") 245 | (defvar org-tree-slide-stop-hook nil 246 | "A hook run when `org-tree-slide--stop' is evaluated to stop the slideshow.") 247 | (defvar org-tree-slide-before-narrow-hook nil 248 | "A hook run before evaluating `org-tree-slide--display-tree-with-narrow'.") 249 | (defvar org-tree-slide-after-narrow-hook nil 250 | "A hook run after evaluating `org-tree-slide--display-tree-with-narrow'.") 251 | (defvar org-tree-slide-before-move-next-hook nil 252 | "A hook run before moving to the next slide.") 253 | (defvar org-tree-slide-before-move-previous-hook nil 254 | "A hook run before moving to the previous slide.") 255 | (defvar org-tree-slide-before-content-view-hook nil 256 | "A hook run before showing the content.") 257 | 258 | ;;;###autoload 259 | (define-minor-mode org-tree-slide-mode 260 | "A presentation tool for Org Mode. 261 | 262 | Usage: 263 | - Set minimal recommendation settings in .emacs 264 | (global-set-key (kbd \"\") \='org-tree-slide-mode) 265 | (global-set-key (kbd \"S-\") \='org-tree-slide-skip-done-toggle) 266 | - Open an org file 267 | - Type to start org-tree-slide-mode 268 | - Type C-< / C-> to move between trees 269 | - To exit this minor mode, just type again. 270 | 271 | Profiles: 272 | 273 | - [ Simple ] 274 | => \\[command] `org-tree-slide-simple-profile' 275 | 276 | 1. No header display 277 | 2. No slide-in effect 278 | 3. The cursor will move to the head of buffer when exit 279 | 4. No slide number display in mode line 280 | 5. Display every type of tree 281 | 282 | - [ Presentation ] 283 | => \\[command] `org-tree-slide-presentation-profile' 284 | 285 | 1. Display header 286 | 2. Enable slide-in effect 287 | 3. The cursor will move to the head of buffer when exit 288 | 4. Display slide number in mode line 289 | 5. Display every type of tree 290 | 291 | - [ TODO Pursuit with narrowing ] 292 | => \\[command] `org-tree-slide-narrowing-control-profile' 293 | 294 | 1. No header display 295 | 2. No slide-in effect 296 | 3. The cursor will keep the same position when exit 297 | 4. Display slide number in mode line 298 | 5. Display TODO trees only" 299 | :init-value nil 300 | :lighter (:eval (org-tree-slide--update-modeline)) 301 | :keymap org-tree-slide-mode-map 302 | :group 'org-tree-slide 303 | :require 'org 304 | (if org-tree-slide-mode 305 | (org-tree-slide--setup) 306 | (org-tree-slide--abort))) 307 | 308 | ;;;###autoload 309 | (defun org-tree-slide-play-with-timer () 310 | "Start slideshow with setting a count down timer." 311 | (interactive) 312 | (org-timer-set-timer) 313 | (unless (org-tree-slide--active-p) 314 | (org-tree-slide-mode))) 315 | 316 | ;;;###autoload 317 | (defun org-tree-slide-without-init-play () 318 | "Start slideshow without the init play. Just enter \"org-tree-slide-mode\"." 319 | (interactive) 320 | (org-tree-slide-mode) 321 | (widen) 322 | (org-overview) 323 | (goto-char 1)) 324 | 325 | (defvar org-tree-slide-content--pos nil 326 | "Where to return when toggling function `org-tree-slide-content'.") 327 | 328 | ;;;###autoload 329 | (defun org-tree-slide-content () 330 | "Change the display for viewing content of the org file." 331 | (interactive) 332 | (when (org-tree-slide--active-p) 333 | (cond 334 | (org-tree-slide-content--pos 335 | ;; (widen) 336 | (goto-char org-tree-slide-content--pos) 337 | (org-tree-slide--display-tree-with-narrow) 338 | (goto-char org-tree-slide-content--pos) 339 | (setq org-tree-slide-content--pos nil)) 340 | (t 341 | (setq org-tree-slide-content--pos 342 | (max (1+ (point-min)) (point))) 343 | (run-hooks 'org-tree-slide-before-content-view-hook) 344 | (widen) 345 | (org-tree-slide--hide-slide-header) 346 | (org-tree-slide--move-to-the-first-heading) 347 | (org-overview) 348 | (cond ((eq 0 org-tree-slide-skip-outline-level) 349 | (org-content)) 350 | ((< 2 org-tree-slide-skip-outline-level) 351 | (org-content (1- org-tree-slide-skip-outline-level)))) 352 | ;; (goto-char (point-min)) 353 | (redisplay) 354 | (goto-char org-tree-slide-content--pos) 355 | (let ((msg (plist-get org-tree-slide-indicator :content)) 356 | (message-log-max nil)) 357 | (when msg 358 | (message "%s" msg))))))) 359 | 360 | ;;;###autoload 361 | (defun org-tree-slide-move-next-tree () 362 | "Display the next slide." 363 | (interactive) 364 | (when (org-tree-slide--active-p) 365 | (let ((msg (plist-get org-tree-slide-indicator :next)) 366 | (message-log-max nil)) 367 | (when msg 368 | (message "%s" msg))) 369 | (cond 370 | ;; displaying a slide, not the contents 371 | ((and (buffer-narrowed-p) 372 | (org-tree-slide--last-tree-p (point))) 373 | (org-tree-slide-content)) 374 | ((or 375 | (or (and (org-tree-slide--before-first-heading-p) 376 | (not (org-at-heading-p))) 377 | (and (= (point-at-bol) 1) (not (buffer-narrowed-p)))) 378 | (or (org-tree-slide--first-heading-with-narrow-p) 379 | (not (org-at-heading-p)))) 380 | (run-hooks 'org-tree-slide-before-move-next-hook) 381 | (widen) 382 | (org-tree-slide--outline-next-heading) 383 | (org-tree-slide--display-tree-with-narrow)) 384 | ;; stay the same slide (for CONTENT MODE, on the subtrees) 385 | (t (org-tree-slide--display-tree-with-narrow))))) 386 | 387 | ;;;###autoload 388 | (defun org-tree-slide-move-previous-tree () 389 | "Display the previous slide." 390 | (interactive) 391 | (when (org-tree-slide--active-p) 392 | (let ((msg (plist-get org-tree-slide-indicator :previous)) 393 | (message-log-max nil)) 394 | (when msg 395 | (message "%s" msg))) 396 | (org-tree-slide--hide-slide-header) ; for at the first heading 397 | (run-hooks 'org-tree-slide-before-move-previous-hook) 398 | (widen) 399 | (cond 400 | ((org-tree-slide--before-first-heading-p) 401 | (message "before first heading (org-tree-slide)" )) 402 | ((not (org-at-heading-p)) 403 | (org-tree-slide--outline-previous-heading) 404 | (org-tree-slide--outline-previous-heading)) 405 | (t (org-tree-slide--outline-previous-heading))) 406 | (org-tree-slide--display-tree-with-narrow) 407 | ;; To avoid error of missing header in Emacs24 408 | (if (= emacs-major-version 24) 409 | (goto-char (point-min))))) 410 | 411 | ;;;###autoload 412 | (defun org-tree-slide-simple-profile () 413 | "Set variables for simple use. 414 | 415 | `org-tree-slide-header' => nil 416 | `org-tree-slide-slide-in-effect' => nil 417 | `org-tree-slide-heading-emphasis' => nil 418 | `org-tree-slide-cursor-init' => t 419 | `org-tree-slide-modeline-display' => nil 420 | `org-tree-slide-skip-done' => nil 421 | `org-tree-slide-skip-comments' => t" 422 | (interactive) 423 | (setq org-tree-slide-header nil) 424 | (setq org-tree-slide-slide-in-effect nil) 425 | (setq org-tree-slide-heading-emphasis nil) 426 | (setq org-tree-slide-cursor-init t) 427 | (setq org-tree-slide-modeline-display nil) 428 | (setq org-tree-slide-skip-done nil) 429 | (setq org-tree-slide-skip-comments t) 430 | (message "simple profile: ON")) 431 | 432 | ;;;###autoload 433 | (defun org-tree-slide-presentation-profile () 434 | "Set variables for presentation use. 435 | 436 | `org-tree-slide-header' => t 437 | `org-tree-slide-slide-in-effect' => t 438 | `org-tree-slide-heading-emphasis' => nil 439 | `org-tree-slide-cursor-init' => t 440 | `org-tree-slide-modeline-display' => \='outside 441 | `org-tree-slide-skip-done' => nil 442 | `org-tree-slide-skip-comments' => t" 443 | (interactive) 444 | (setq org-tree-slide-header t) 445 | (setq org-tree-slide-slide-in-effect t) 446 | (setq org-tree-slide-heading-emphasis nil) 447 | (setq org-tree-slide-cursor-init t) 448 | (setq org-tree-slide-modeline-display 'outside) 449 | (setq org-tree-slide-skip-done nil) 450 | (setq org-tree-slide-skip-comments t) 451 | (message "presentation profile: ON")) 452 | 453 | ;;;###autoload 454 | (defun org-tree-slide-narrowing-control-profile () 455 | "Set variables for TODO pursuit with narrowing. 456 | 457 | `org-tree-slide-header' => nil 458 | `org-tree-slide-slide-in-effect' => nil 459 | `org-tree-slide-heading-emphasis' => nil 460 | `org-tree-slide-cursor-init' => nil 461 | `org-tree-slide-modeline-display' => \='lighter 462 | `org-tree-slide-skip-done' => t 463 | `org-tree-slide-skip-comments' => t" 464 | (interactive) 465 | (setq org-tree-slide-header nil) 466 | (setq org-tree-slide-slide-in-effect nil) 467 | (setq org-tree-slide-heading-emphasis nil) 468 | (setq org-tree-slide-cursor-init nil) 469 | (setq org-tree-slide-modeline-display 'lighter) 470 | (setq org-tree-slide-skip-done t) 471 | (setq org-tree-slide-skip-comments t) 472 | (message "narrowing control profile: ON")) 473 | 474 | ;;;###autoload 475 | (defun org-tree-slide-display-header-toggle () 476 | "Toggle displaying the slide header." 477 | (interactive) 478 | (setq org-tree-slide-header (not org-tree-slide-header)) 479 | (unless org-tree-slide-header 480 | (org-tree-slide--hide-slide-header)) 481 | (org-tree-slide--display-tree-with-narrow)) 482 | 483 | ;;;###autoload 484 | (defun org-tree-slide-slide-in-effect-toggle () 485 | "Toggle using slide-in effect." 486 | (interactive) 487 | (setq org-tree-slide-slide-in-effect (not org-tree-slide-slide-in-effect)) 488 | (org-tree-slide--display-tree-with-narrow)) 489 | 490 | ;;;###autoload 491 | (defun org-tree-slide-heading-emphasis-toggle () 492 | "Toggle applying emphasis to heading." 493 | (interactive) 494 | (setq org-tree-slide-heading-emphasis (not org-tree-slide-heading-emphasis)) 495 | (org-tree-slide--apply-custom-heading-face org-tree-slide-heading-emphasis)) 496 | 497 | (defvar org-tree-slide--previous-line 0) 498 | 499 | ;;;###autoload 500 | (defun org-tree-slide-skip-done-toggle () 501 | "Toggle show TODO item only or not." 502 | (interactive) 503 | (setq org-tree-slide-skip-done (not org-tree-slide-skip-done)) 504 | (setq org-tree-slide--previous-line -1) ; to update modeline intentionally 505 | (when org-tree-slide-header 506 | (org-tree-slide--show-slide-header)) 507 | (if org-tree-slide-skip-done 508 | (message "TODO Pursuit: ON") (message "TODO Pursuit: OFF"))) 509 | 510 | ;;;###autoload 511 | (defun org-tree-slide-skip-comments-toggle () 512 | "Toggle show COMMENT item or not. 513 | If `org-tree-slide-skip-comments' is specified as `inherit', 514 | then toggle between `inherit' and nil. Otherwise, between t and nil. 515 | See also `org-tree-slide-skip-comments'." 516 | (interactive) 517 | ;; Sync 518 | (if (eq org-tree-slide-skip-comments 'inherit) 519 | (setq org-tree-slide--skip-comments-mode 'inherit) 520 | (when (eq org-tree-slide-skip-comments t) 521 | (setq org-tree-slide--skip-comments-mode t))) 522 | ;; Toggle 523 | (if (eq org-tree-slide--skip-comments-mode 'inherit) 524 | (if (eq org-tree-slide-skip-comments 'inherit) 525 | (setq org-tree-slide-skip-comments nil) 526 | (setq org-tree-slide-skip-comments 'inherit)) 527 | (setq org-tree-slide-skip-comments (not org-tree-slide-skip-comments))) 528 | ;; Feedback 529 | (cond ((eq org-tree-slide-skip-comments nil) 530 | (message "COMMENT: Show headings even if it has COMMENT")) 531 | ((eq org-tree-slide-skip-comments t) 532 | (message "COMMENT: Skip only headings with COMMENT")) 533 | ((eq org-tree-slide-skip-comments 'inherit) 534 | (message 535 | "COMMENT: Skip headings with COMMENT and its child headings"))) 536 | (when (org-tree-slide--active-p) 537 | (setq org-tree-slide--slide-number 538 | (format " %s" (org-tree-slide--count-slide (point)))))) 539 | 540 | ;;; Internal functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 541 | (defvar org-tree-slide--slide-number nil) 542 | (make-variable-buffer-local 'org-tree-slide--slide-number) 543 | 544 | (defvar org-tree-slide--lighter " TSlide" 545 | "Lighter for `org-tree-slide'. 546 | This is displayed by default if `org-tree-slide-modeline-display' is nil.") 547 | 548 | (defun org-tree-slide--line-number-at-pos () 549 | "Return the line number when widen." 550 | (save-excursion 551 | (save-restriction 552 | (widen) 553 | (line-number-at-pos)))) 554 | 555 | (defun org-tree-slide--update-modeline () 556 | "Update mode line." 557 | (when (org-tree-slide--active-p) 558 | (cond 559 | ((equal org-tree-slide-modeline-display 'lighter) 560 | (setq org-tree-slide--slide-number 561 | (format " %s" (org-tree-slide--count-slide (point)))) 562 | (setq org-tree-slide--previous-line (org-tree-slide--line-number-at-pos)) 563 | org-tree-slide--slide-number) 564 | ;; just return the current org-tree-slide--slide-number quickly. 565 | ((equal org-tree-slide-modeline-display 'outside) 566 | org-tree-slide--slide-number) 567 | (t 568 | org-tree-slide--lighter)))) 569 | 570 | (defvar org-tree-slide--header-overlay nil 571 | "Flag to check the status of overlay for a slide header.") 572 | 573 | (defvar org-tree-slide--header-face-autoconfig nil) 574 | (defvar org-tree-slide--skip-comments-mode nil) 575 | (defun org-tree-slide--setup () 576 | "Setup." 577 | (when (org-tree-slide--active-p) 578 | (org-tree-slide--play))) 579 | 580 | (defun org-tree-slide--abort () 581 | "Abort." 582 | (when (equal major-mode 'org-mode) 583 | (org-tree-slide--stop))) 584 | 585 | (defun org-tree-slide--play () 586 | "Start slide view with the first tree of the org mode buffer." 587 | (run-hooks 'org-tree-slide-play-hook) 588 | (if (org-tree-slide--all-skip-p) 589 | (let ((org-tree-slide-deactivate-message 590 | "[notice] Terminated. Skipped all slides.")) 591 | (org-tree-slide--stop)) 592 | (org-tree-slide--apply-local-header-to-slide-header) 593 | (when org-tree-slide-heading-emphasis 594 | (org-tree-slide--apply-custom-heading-face t)) 595 | (when (or org-tree-slide-cursor-init 596 | (org-tree-slide--before-first-heading-p)) 597 | (org-tree-slide--move-to-the-first-heading)) 598 | (org-tree-slide--beginning-of-tree) 599 | (when (org-tree-slide--heading-skip-p) 600 | (org-tree-slide--outline-next-heading)) 601 | (org-tree-slide--display-tree-with-narrow) 602 | (when org-tree-slide-activate-message 603 | (message "%s" org-tree-slide-activate-message)))) 604 | 605 | (defvar org-tree-slide-startup "overview" 606 | "If you have \"#+startup:\" line in your org buffer, the org buffer will be shown with corresponding status \(content, showall, overview:default\).") 607 | 608 | (defun org-tree-slide--stop () 609 | "Stop the slide view, and redraw the orgmode buffer with #+STARTUP:." 610 | (widen) 611 | (org-show-siblings) 612 | (when (or org-tree-slide-cursor-init (org-tree-slide--before-first-heading-p)) 613 | (goto-char (point-min)) 614 | (org-overview) 615 | (cond ((equal "content" org-tree-slide-startup) 616 | (message "CONTENT: %s" org-tree-slide-startup) 617 | (org-content)) 618 | ((equal "showall" org-tree-slide-startup) 619 | (message "SHOW ALL: %s" org-tree-slide-startup) 620 | (org-cycle '(64))) 621 | (t nil))) 622 | (org-tree-slide--hide-slide-header) 623 | (when org-timer-start-time 624 | (org-timer-stop)) 625 | (when org-tree-slide-heading-emphasis 626 | (org-tree-slide--apply-custom-heading-face nil)) 627 | (run-hooks 'org-tree-slide-stop-hook) 628 | (when org-tree-slide-deactivate-message 629 | (message "%s" org-tree-slide-deactivate-message))) 630 | 631 | (defun org-tree-slide--display-tree-with-narrow () 632 | "Show a tree with narrowing and also set a header at the head of slide." 633 | (run-hooks 'org-tree-slide-before-narrow-hook) 634 | (when (equal org-tree-slide-modeline-display 'outside) 635 | (setq org-tree-slide--slide-number 636 | (format " %s" (org-tree-slide--count-slide (point)))) 637 | (setq org-tree-slide--previous-line (org-tree-slide--line-number-at-pos))) 638 | (goto-char (point-at-bol)) 639 | (unless (org-tree-slide--before-first-heading-p) 640 | (outline-hide-subtree) ; support CONTENT (subtrees are shown) 641 | (org-show-entry) 642 | ;; If this is the last level to be displayed, show the full content 643 | (if (and (not org-tree-slide-fold-subtrees-skipped) 644 | (org-tree-slide--heading-level-skip-p (1+ (org-outline-level)))) 645 | (org-tree-slide--show-subtree) 646 | (outline-show-children)) 647 | ;; (org-cycle-hide-drawers 'all) ; disabled due to performance reduction 648 | (org-narrow-to-subtree)) 649 | (when org-tree-slide-slide-in-effect 650 | (org-tree-slide--slide-in org-tree-slide-slide-in-blank-lines)) 651 | (when org-tree-slide-header 652 | (org-tree-slide--show-slide-header)) 653 | (run-hooks 'org-tree-slide-after-narrow-hook)) 654 | 655 | (defun org-tree-slide--show-subtree () 656 | "Show everything after this heading at deeper levels except COMMENT items." 657 | (save-excursion 658 | (outline-back-to-heading) 659 | (outline-map-region 660 | (lambda () 661 | (if (org-tree-slide--heading-skip-comment-p) 662 | (outline-hide-subtree) 663 | (outline-show-subtree) 664 | (org-cycle-hide-drawers 'all))) 665 | (point) 666 | (progn (outline-end-of-subtree) 667 | (if (eobp) (point-max) (1+ (point))))))) 668 | 669 | (defun org-tree-slide--outline-next-heading () 670 | "Go to the next heading." 671 | (org-tree-slide--outline-select-method 672 | (if (outline-next-heading) 673 | (if (org-tree-slide--heading-skip-p) 674 | 'skip 675 | nil) 676 | 'last) 677 | 'next)) 678 | 679 | (defun org-tree-slide--outline-previous-heading () 680 | "Go to the previous heading." 681 | (org-tree-slide--outline-select-method 682 | (if (outline-previous-heading) 683 | (if (org-tree-slide--heading-skip-p) 684 | 'skip 685 | nil) 686 | 'first) 687 | 'previous)) 688 | 689 | (defun org-tree-slide--outline-select-method (action direction) 690 | "Control heading selection with ACTION and DIRECTION." 691 | (cond ((and (equal action 'last) 692 | (equal direction 'next)) 693 | (when (org-tree-slide--heading-skip-p) 694 | (org-tree-slide-content))) ;; would be not reached here. 695 | ((and (equal action 'first) 696 | (equal direction 'previous)) 697 | (org-tree-slide--outline-next-heading)) ;; find the first non-skip 698 | ((and (equal action 'skip) 699 | (equal direction 'next)) 700 | (org-tree-slide--outline-next-heading)) ;; find next again 701 | ((and (equal action 'skip) 702 | (equal direction 'previous)) 703 | (org-tree-slide--outline-previous-heading)) ;; find previous again 704 | (t 705 | nil))) 706 | 707 | (defun org-tree-slide--heading-skip-p () 708 | "This method assume the cursor exist at the heading. 709 | ** COMMENT ; t 710 | hoge ; nil 711 | hoge ; nil 712 | *** hoge ; nil" 713 | (or (org-tree-slide--heading-done-skip-p) 714 | (org-tree-slide--heading-level-skip-p) 715 | (org-tree-slide--heading-skip-comment-p))) 716 | 717 | (defun org-tree-slide--heading-level-skip-p (&optional heading-level) 718 | "Check the current heading should be skipped or not based on outline level. 719 | If HEADING-LEVEL is non-nil, the provided outline level is checked." 720 | (and (> org-tree-slide-skip-outline-level 0) 721 | (<= org-tree-slide-skip-outline-level 722 | (or heading-level (org-outline-level))))) 723 | 724 | (defun org-tree-slide--heading-done-skip-p () 725 | "Return t, if the current heading is already done." 726 | (and org-tree-slide-skip-done 727 | (not 728 | (looking-at 729 | ;; 6.33x does NOT support org-outline-regexp-bol 730 | (concat "^\\*+ " org-not-done-regexp))))) 731 | 732 | (defun org-tree-slide--heading-skip-comment-p () 733 | "Return t, if the current heading is commented. 734 | If `org-tree-slide-skip-comments' is specified as `inherit' and 735 | parent heading is commented, then also return t. Otherwise, return nil." 736 | (cond ((eq org-tree-slide-skip-comments 'inherit) 737 | (when (org-tree-slide--parent-commented-p) t)) 738 | (t (and org-tree-slide-skip-comments 739 | (looking-at (concat "^\\*+ " org-comment-string)))))) 740 | 741 | (defun org-tree-slide--parent-commented-p () 742 | "Return nil, when no parent heading is commented." 743 | (memq 0 (mapcar 744 | (lambda (x) 745 | (string-match (concat "^" org-comment-string) x)) 746 | (org-get-outline-path t)))) 747 | 748 | (defun org-tree-slide--slide-in (blank-lines) 749 | "Apply slide in. The slide will be moved from BLANK-LINES below to top." 750 | (let ((min-line -1)) 751 | (when org-tree-slide-header 752 | (setq min-line org-tree-slide-content-margin-top)) 753 | (while (< min-line blank-lines) 754 | (org-tree-slide--set-slide-header blank-lines) 755 | (sit-for org-tree-slide-slide-in-waiting) 756 | (setq blank-lines (1- blank-lines))))) 757 | 758 | (defvar org-tree-slide-title nil 759 | "Presentation title. 760 | If you have \"#+title:\" line in your org buffer, it wil be used as a title 761 | of the slide. If the buffer has no \"#+title:\" line, the name of 762 | current buffer will be displayed.") 763 | 764 | (defvar org-tree-slide-email nil 765 | "Email address. 766 | If you have \"#+email:\" line in your org buffer, 767 | it will be used as an address of the slide.") 768 | 769 | (defvar org-tree-slide-author nil 770 | "Author name. 771 | If you have \"#+author:\" line in your org buffer, 772 | it will be used as a name of the slide author.") 773 | 774 | (defvar org-tree-slide-date nil 775 | "Date. 776 | If you have \"#+date:\" line in your org buffer, it will be used as the date.") 777 | 778 | (defcustom org-tree-slide-breadcrumbs " > " 779 | "Display breadcrumbs in the slide header. 780 | 781 | If non-nil, it should be a string used as a delimiter used to 782 | concat the headers." 783 | :type '(choice (const :tag "Don't display breadcrumbs" nil) 784 | (string :tag "Delimiter")) 785 | :group 'org-tree-slide) 786 | 787 | (defcustom org-tree-slide-breadcrumbs-hide-todo-state t 788 | "If non-nil, hide TODO states in the breadcrumbs." 789 | :type 'boolean 790 | :group 'org-tree-slide) 791 | 792 | (defun org-tree-slide--apply-local-header-to-slide-header () 793 | "Form the header." 794 | (save-excursion 795 | (org-tree-slide--move-to-the-first-heading) 796 | (let ((limit (point))) 797 | (org-tree-slide--set-header-var-by-regxep 798 | 'org-tree-slide-title "#\\+TITLE:[ \t]*\\(.*\\)$" limit) 799 | (org-tree-slide--set-header-var-by-regxep 800 | 'org-tree-slide-author "#\\+AUTHOR:[ \t]*\\(.*\\)$" limit) 801 | (org-tree-slide--set-header-var-by-regxep 802 | 'org-tree-slide-email "#\\+EMAIL:[ \t]*\\(.*\\)$" limit) 803 | 804 | ; Use the date header or the current date if there isn't one 805 | (setq org-tree-slide-date nil) 806 | (org-tree-slide--set-header-var-by-regxep 807 | 'org-tree-slide-date "#\\+DATE:[ \t]*\\(.*\\)$" limit) 808 | (if (not org-tree-slide-date) 809 | (setq org-tree-slide-date 810 | (format-time-string "%Y-%m-%d"))) 811 | 812 | (org-tree-slide--set-header-var-by-regxep 813 | 'org-tree-slide-startup "#\\+STARTUP:[ \t]*\\(.*\\)$" limit)))) 814 | 815 | (defun org-tree-slide--set-header-var-by-regxep (header-variable regexp limit) 816 | "Set HEADER-VARIABLE using REGEXP. LIMIT is used to change searching bound." 817 | (goto-char 1) 818 | (set header-variable 819 | (if (re-search-forward regexp limit t) (match-string 1) nil))) 820 | 821 | (defface org-tree-slide-header-overlay-face '((t :inherit default)) 822 | "Face for `org-tree-slide--header-overlay'." 823 | :group 'org-tree-slide) 824 | 825 | (defun org-tree-slide--get-parents (&optional delim) 826 | "Get parent headings and concat them with DELIM." 827 | (setq delim (or delim " > ")) 828 | (save-excursion 829 | (save-restriction 830 | (widen) 831 | (let ((parents nil)) 832 | (while (org-up-heading-safe) 833 | (push (org-get-heading 834 | 'no-tags 835 | org-tree-slide-breadcrumbs-hide-todo-state) 836 | parents)) 837 | (mapconcat 'identity parents delim))))) 838 | 839 | (defun org-tree-slide--set-slide-header (blank-lines) 840 | "Set the header with overlay. 841 | Some number of BLANK-LINES will be shown below the header." 842 | (org-tree-slide--hide-slide-header) 843 | (setq org-tree-slide--header-overlay 844 | (make-overlay (point-min) (+ 1 (point-min)))) 845 | (overlay-put org-tree-slide--header-overlay 'after-string " ") 846 | (overlay-put org-tree-slide--header-overlay 847 | 'face 848 | 'org-tree-slide-header-overlay-face) 849 | (if org-tree-slide-header 850 | (overlay-put org-tree-slide--header-overlay 'display 851 | (concat (if org-tree-slide-title org-tree-slide-title 852 | (buffer-name)) 853 | "\n" 854 | org-tree-slide-date " " 855 | (when org-tree-slide-author 856 | (concat org-tree-slide-author " ")) 857 | (when org-tree-slide-email 858 | (concat "<" org-tree-slide-email ">")) 859 | (when org-tree-slide-breadcrumbs 860 | (concat "\n" (org-tree-slide--get-parents 861 | org-tree-slide-breadcrumbs))) 862 | (org-tree-slide--get-blank-lines blank-lines))) 863 | (overlay-put org-tree-slide--header-overlay 'display 864 | (org-tree-slide--get-blank-lines blank-lines)))) 865 | 866 | (defun org-tree-slide--get-blank-lines (lines) 867 | "Return breaks by LINES." 868 | (let ((breaks "")) 869 | (while (< 0 lines) 870 | (setq lines (1- lines)) 871 | (setq breaks (concat breaks "\n"))) 872 | breaks)) 873 | 874 | (defun org-tree-slide--show-slide-header (&optional lines) 875 | "Show header. When LINES is nil, the default value is 2." 876 | (org-tree-slide--set-slide-header 877 | (or lines org-tree-slide-content-margin-top))) 878 | 879 | (defun org-tree-slide--hide-slide-header () 880 | "Hide header." 881 | (when org-tree-slide--header-overlay 882 | (delete-overlay org-tree-slide--header-overlay))) 883 | 884 | (defun org-tree-slide--move-to-the-first-heading () 885 | "Go to the first heading. Narrowing will be canceled. 886 | If no heading in the buffer, return nil and stay top of the buffer. 887 | Otherwise, return the point. This doesn't check whether skipping or not." 888 | (widen) 889 | (goto-char 1) 890 | (if (looking-at "^\\*+ ") 891 | (progn 892 | (beginning-of-line) 893 | (point)) 894 | (outline-next-heading))) 895 | 896 | (defun org-tree-slide--apply-custom-heading-face (status) 897 | "Change status of heading face. If STATUS is nil, apply the default values." 898 | (unless org-tree-slide-never-touch-face 899 | (cond 900 | (status 901 | (setq 902 | org-tree-slide-heading-level-1-cookie 903 | (face-remap-add-relative 'org-level-1 org-tree-slide-heading-level-1) 904 | org-tree-slide-heading-level-2-cookie 905 | (face-remap-add-relative 'org-level-2 org-tree-slide-heading-level-2) 906 | org-tree-slide-heading-level-3-cookie 907 | (face-remap-add-relative 'org-level-3 org-tree-slide-heading-level-3) 908 | org-tree-slide-heading-level-4-cookie 909 | (face-remap-add-relative 'org-level-4 org-tree-slide-heading-level-4))) 910 | (t 911 | (face-remap-remove-relative org-tree-slide-heading-level-1-cookie) 912 | (face-remap-remove-relative org-tree-slide-heading-level-2-cookie) 913 | (face-remap-remove-relative org-tree-slide-heading-level-3-cookie) 914 | (face-remap-remove-relative org-tree-slide-heading-level-4-cookie))))) 915 | 916 | (defun org-tree-slide--count-slide (&optional pos) 917 | "Return formatted the slide number. If POS is nil, `point' will be used." 918 | (save-excursion 919 | (save-restriction 920 | (widen) 921 | (goto-char (point-min)) 922 | (let ((count 0) 923 | (current-slide 0) 924 | (current-point (or pos (point)))) 925 | (when (and (looking-at "^\\*+ ") (not (org-tree-slide--heading-skip-p))) 926 | (setq count 1) 927 | (setq current-slide 1)) 928 | (while (outline-next-heading) 929 | (when (not (org-tree-slide--heading-skip-p)) 930 | (setq count (1+ count)) 931 | (when (>= current-point (point)) 932 | (setq current-slide (1+ current-slide))))) 933 | (cond 934 | ((= count 0) "[-/-]") ; no headings 935 | ((= current-slide 0) (format "[-/%d]" count)) ; before first heading 936 | (t 937 | (format "[%d/%d]" current-slide count))))))) 938 | 939 | (defun org-tree-slide--last-point-at-bot () 940 | "Return nil, if no heading is the last tree. Otherwise, return the point. 941 | Searching the last point will start from the current cursor position. 942 | Move point to an appropriate position before searching by call this function." 943 | (save-excursion 944 | (save-restriction 945 | (widen) 946 | (unless (org-tree-slide--before-first-heading-p) 947 | (org-tree-slide--beginning-of-tree) 948 | (if (org-tree-slide--heading-skip-p) 949 | (when (outline-previous-heading) 950 | (org-tree-slide--last-point-at-bot)) 951 | (point)))))) 952 | 953 | (defun org-tree-slide--beginning-of-tree () 954 | "Move point to beginning of tree. 955 | If the cursor exist before first heading, do nothing." 956 | (unless (org-tree-slide--before-first-heading-p) 957 | (beginning-of-line) 958 | (unless (org-at-heading-p) 959 | (org-tree-slide--outline-previous-heading)))) 960 | 961 | (defun org-tree-slide--active-p () 962 | "Return nil, if the current `major-mode' is not `org-mode'." 963 | (and org-tree-slide-mode (equal major-mode 'org-mode))) 964 | 965 | (defun org-tree-slide--before-first-heading-p () 966 | "Extension of `org-before-first-heading-p' to support org 6.33x. 967 | #+TITLE: title ; t 968 | #+STARTUP: content ; t 969 | * first ; t 970 | hoge ; nil 971 | ** second ; nil 972 | ** third ; nil" 973 | (and (org-before-first-heading-p) (not (buffer-narrowed-p)))) 974 | 975 | (defun org-tree-slide--first-heading-with-narrow-p () 976 | "Check the current point is on the first heading with narrowing. 977 | ** first ; t 978 | hoge ; nil 979 | hoge ; nil 980 | *** second ; nil 981 | hoge ; nil 982 | *** third ; nil" 983 | (and (buffer-narrowed-p) (= (point-at-bol) (point-min)))) 984 | 985 | (defun org-tree-slide--all-skip-p () 986 | "Check the buffer has at least one slide to be shown." 987 | (save-excursion 988 | (save-restriction 989 | (widen) 990 | (goto-char (1+ (buffer-size))) 991 | (unless (org-tree-slide--last-point-at-bot) 992 | t)))) 993 | 994 | (defun org-tree-slide--last-tree-p (target) 995 | "Check if the TARGET point is in the last heading or it's body. 996 | If every heading is specified as skip, return nil. 997 | ** n-1 ; nil 998 | ** n ; t 999 | hoge ; t" 1000 | (save-excursion 1001 | (save-restriction 1002 | (widen) 1003 | (goto-char target) 1004 | (org-tree-slide--beginning-of-tree) 1005 | (let ((p (point)) 1006 | (v (goto-char (1+ (buffer-size)))) 1007 | (l (org-tree-slide--last-point-at-bot))) 1008 | (if l 1009 | (= p l) 1010 | nil))))) 1011 | 1012 | (provide 'org-tree-slide) 1013 | 1014 | ;;; org-tree-slide.el ends here 1015 | --------------------------------------------------------------------------------