branch: elpa/org-tree-slide
commit 3b020a663bc19428fc43b7604c0dc1eb58e1d335
Author: Takaaki ISHIKAWA <tak...@ieee.org>
Commit: Takaaki ISHIKAWA <tak...@ieee.org>

    'COMMENT'-subtree will be hidden (by Stefano)
---
 ChangeLog         |  7 +++++++
 README.org        |  5 +++--
 org-tree-slide.el | 19 +++++++++++++++++--
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 75537834ef..19e98fc877 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-08-14  Takaaki ISHIKAWA  <tak...@ieee.org>
+
+       * org-tree-slide.el: 'COMMENT'-subtree will be hidden (by Stefano)
+       - org-tree-slide--show-subtree is added
+       - Subtrees that start with 'COMMENT' will be hidden during presentation 
even though org-tree-slide-fold-subtrees-skipped is nil
+       Thanks to Stefano BENNATI
+
 2015-08-09  Takaaki ISHIKAWA  <tak...@ieee.org>
 
        * org-tree-slide.el: Added a flag to reveal subtrees to be skipped
diff --git a/README.org b/README.org
index f3187d86a2..0c32b3a67d 100644
--- a/README.org
+++ b/README.org
@@ -1,8 +1,8 @@
 #+TITLE:       README for Org Tree Slide
 #+AUTHOR:      Takaaki Ishikawa
 #+EMAIL:       tak...@ieee.org
-#+DATE:                2015-08-09
-#+UPDATE:      01:19:10
+#+DATE:                2015-08-14
+#+UPDATE:      08:35:49
 #+STARTUP:     content
 
 * 1. What's this?
@@ -229,6 +229,7 @@ see also ChangeLog
 
|---------+------------------+-------------------------------------------------|
 | Version | Date             | Description                                     
|
 
|---------+------------------+-------------------------------------------------|
+| v2.8.4  | 2015-08-12@21:35 | 'COMMENT'-subtree will be hidden (by Stefano)   
|
 | v2.8.3  | 2015-08-09@01:04 | Added a flag to reveal subtrees to be skipped   
|
 | v2.8.1  | 2015-02-27@10:42 | Hide org-clock related code                     
|
 | v2.8.0  | 2015-02-20@21:27 | Changed Keymap, and renamed/added hooks         
|
diff --git a/org-tree-slide.el b/org-tree-slide.el
index 78fa7d63ab..c9004930c7 100644
--- a/org-tree-slide.el
+++ b/org-tree-slide.el
@@ -11,6 +11,7 @@
 ;; Committers: Yuuki ARISAWA (@uk-ar)
 ;;             Eric S Fraga
 ;;             Eike Kettner
+;;             Stefano BENNATI
 ;;
 ;; This program is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -68,7 +69,7 @@
 (require 'org-timer)
 ;;(require 'org-clock)                 ; org-clock-in, -out, -clocking-p
 
-(defconst org-tree-slide "2.8.3"
+(defconst org-tree-slide "2.8.4"
   "The version number of the org-tree-slide.el")
 
 (defgroup org-tree-slide nil
@@ -539,7 +540,7 @@ Profiles:
     ;; If this is the last level to be displayed, show the full content
     (if (and (not org-tree-slide-fold-subtrees-skipped)
              (org-tree-slide--heading-level-skip-p (1+ (org-outline-level))))
-        (org-show-subtree)
+        (org-tree-slide--show-subtree)
       (show-children))
     ;;    (org-cycle-hide-drawers 'all) ; disabled due to performance reduction
     (org-narrow-to-subtree))
@@ -550,6 +551,20 @@ Profiles:
   (run-hooks 'org-tree-slide-after-narrow-hook)
   (run-hooks 'org-tree-slide-mode-after-narrow-hook))
 
+(defun org-tree-slide--show-subtree ()
+  "Show everything after this heading at deeper levels except COMMENT items."
+  (save-excursion
+    (outline-back-to-heading)
+    (outline-map-region
+     (lambda ()
+       (if (org-tree-slide--heading-skip-comment-p)
+           (hide-subtree)
+         (show-subtree)
+         (org-cycle-hide-drawers 'all)))
+     (point)
+     (progn (outline-end-of-subtree)
+            (if (eobp) (point-max) (1+ (point)))))))
+
 (defun org-tree-slide--outline-next-heading ()
   (org-tree-slide--outline-select-method
    (org-tree-slide--outline-skip-type

Reply via email to