emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: fold only DONE items at #+STARTUP
       [not found] <slrnleie94.b57.pisajew@lnb.localnet>
@ 2014-01-29 17:49 ` Bastien
       [not found]   ` <slrnleli47.76c.pisajew@lnb.localnet>
  2014-01-31 12:19 ` John Kitchin
  1 sibling, 1 reply; 3+ messages in thread
From: Bastien @ 2014-01-29 17:49 UTC (permalink / raw)
  To: Piotr Isajew; +Cc: emacs-orgmode

Hi Piotr,

Piotr Isajew <pisajew@yahoo.com> writes:

> For example, when I open .org file I would like to have subtrees
> marked as DONE folded, but the others should be opened as with
> #+STARTUP: content setting. Can it be done?

No.  But you can archive the DONE subtrees with C-c C-x C-a for
example.  See "Archiving" in Org's manual.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fold only DONE items at #+STARTUP
       [not found]   ` <slrnleli47.76c.pisajew@lnb.localnet>
@ 2014-01-30 23:22     ` Nick Dokos
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2014-01-30 23:22 UTC (permalink / raw)
  To: emacs-orgmode

Piotr Isajew <pisajew@yahoo.com> writes:

> Hi Bastien,
>
> Dnia 29.01.2014 Bastien <bzg@gnu.org> napisał/a:
>
>> Piotr Isajew <pisajew@yahoo.com> writes:
>>
>>> For example, when I open .org file I would like to have subtrees
>>> marked as DONE folded, but the others should be opened as with
>>> #+STARTUP: content setting. Can it be done?
>>
>> No.  But you can archive the DONE subtrees with C-c C-x C-a for
>> example.  See "Archiving" in Org's manual.
>
> I haven't thought about archiving so thanks for pointing me to
> this.  In general that could be the solution, but for this case it
> seems too drastic. It would mean excluding DONE subtrees from
> searches and clock reports which I don't want to happen before I
> finish entire project. What I want is just to initially get DONE
> subtrees out of my sight.
>
> I was able to achieve more or less what I wanted by setting
> VISIBILITY property with a hook:
>
> (defun set-visibility-to-folded-when-done()
>   "Change default subtree VISIBILITY to folded when state is changed to DONE"
>   ( when (string= org-state "DONE")
>     (org-set-property "VISIBILITY" "folded"))
> )
> (add-hook 'org-after-todo-state-change-hook
>           'set-visibility-to-folded-when-done)
>

You might want to augment your function slightly with a call to
org-set-startup-visibility:

--8<---------------cut here---------------start------------->8---
(defun set-visibility-to-folded-when-done()
  "Change default subtree VISIBILITY to folded when state is changed to DONE"
  (when (string= org-state "DONE")
    (org-set-property "VISIBILITY" "folded")
    (org-set-startup-visibility)))
--8<---------------cut here---------------end--------------->8---

That will fold the item immediately.

-- 
Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fold only DONE items at #+STARTUP
       [not found] <slrnleie94.b57.pisajew@lnb.localnet>
  2014-01-29 17:49 ` fold only DONE items at #+STARTUP Bastien
@ 2014-01-31 12:19 ` John Kitchin
  1 sibling, 0 replies; 3+ messages in thread
From: John Kitchin @ 2014-01-31 12:19 UTC (permalink / raw)
  To: Piotr Isajew; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

you can set a VISIBILITY property to folded in the DONE subtrees. then it
seems like those trees stay folded even if startup opens the rest of them.

If it is that important maybe you can get changing the status to also
change the visibility property with some emacs-lisp.

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Wed, Jan 29, 2014 at 12:23 PM, Piotr Isajew <pisajew@yahoo.com> wrote:

>
> Hi,
>
> I wonder if it's possible to have different #+STARTUP settings
> for DONE subtrees than for the rest of the document?
>
> For example, when I open .org file I would like to have subtrees
> marked as DONE folded, but the others should be opened as with
> #+STARTUP: content setting. Can it be done?
>
>
>

[-- Attachment #2: Type: text/html, Size: 1383 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-31 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <slrnleie94.b57.pisajew@lnb.localnet>
2014-01-29 17:49 ` fold only DONE items at #+STARTUP Bastien
     [not found]   ` <slrnleli47.76c.pisajew@lnb.localnet>
2014-01-30 23:22     ` Nick Dokos
2014-01-31 12:19 ` John Kitchin

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).