emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: coroa@online.de (Jonas Hörsch)
To: emacs-orgmode@gnu.org
Subject: [PATCH] hide inline-tasks in 'children visibility state
Date: Wed, 30 Oct 2013 16:38:30 +0100	[thread overview]
Message-ID: <87r4b23h1l.fsf@kafka.loc> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 236 bytes --]

hej,

one more patch, which takes care of re-hiding inline-tasks
properly. finally it is possible to work with longer inline tasks
without them getting always in the way.

just bump me, if anything is not to your liking

cheers,
jonas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-org-inlinetask-hide-inline-tasks-in-children-visibil.patch --]
[-- Type: text/x-patch, Size: 1561 bytes --]

From 447d528263728ea56f390ae8dfdfa99880d6ccb4 Mon Sep 17 00:00:00 2001
From: Jonas Hoersch <coroa@online.de>
Date: Wed, 30 Oct 2013 15:39:33 +0100
Subject: [PATCH] org-inlinetask: hide inline tasks in 'children visibility
 state

* lisp/org.el (org-cycle-hide-inline-tasks): re-hide inline tasks when
  switching to 'children visibility state.

TINYCHANGE
---
 lisp/org.el | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 4f3bf4b..b93f3f4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7074,11 +7074,19 @@ open and agenda-wise Org files."
 	  (org-flag-drawer t))))))
 
 (defun org-cycle-hide-inline-tasks (state)
-  "Re-hide inline task when switching to 'contents visibility state."
-  (when (and (eq state 'contents)
-	     (boundp 'org-inlinetask-min-level)
-	     org-inlinetask-min-level)
-    (hide-sublevels (1- org-inlinetask-min-level))))
+  "Re-hide inline tasks when switching to 'contents or 'children
+visibility state."
+  (cond ((eq state 'contents)
+	 (when (and (boundp 'org-inlinetask-min-level)
+		    org-inlinetask-min-level)
+	   (hide-sublevels (1- org-inlinetask-min-level))))
+	((eq state 'children)
+	 (when (featurep 'org-inlinetask)
+	   (save-excursion
+	     (while (and (outline-next-heading)
+			 (org-inlinetask-at-task-p))
+	       (org-inlinetask-toggle-visibility)
+	       (org-inlinetask-goto-end)))))))
 
 (defun org-flag-drawer (flag)
   "When FLAG is non-nil, hide the drawer we are within.
-- 
1.8.4


[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

             reply	other threads:[~2013-10-30 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 15:38 Jonas Hörsch [this message]
2013-10-31 10:11 ` [PATCH] hide inline-tasks in 'children visibility state Nicolas Goaziou
2013-11-04  8:52   ` Jonas Hörsch
2013-11-05 21:29     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4b23h1l.fsf@kafka.loc \
    --to=coroa@online.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).