emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-orgmode] org-archive-done


From: Carsten Dominik
Subject: Re: [Emacs-orgmode] org-archive-done
Date: Sun, 18 Jun 2006 09:05:53 +0200

Hi Daniel,

thanks for taking the time to discuss this through.

On Jun 17, 2006, at 22:47, Daniel J. Sinder wrote:

OK, so now we've come full circle -- this is very nearly the current behavior, except instead of archiving the whole subtree, it would only archive DONE entries from within the subtree. I think this is perhaps the best solution (and easiest to implement, right?).

Yes it is, and I think this is what I will implement.

However,..

I have just one final thought....and it's just a thought because I don't understand how org-mode is implemented.... What if, instead of archiving *moving* subtrees, it left them in place but *hid* them in a semi-permanent way. By that I mean, they'd be hidden just like the collapsing org-mode normally does, but they would never expand, unless a special show-archived-subtrees variable was non-nil.

this is a very interesting and original idea! I really like it. It would mean that subitems that are done remain in place, but don't use space on the screen. I am not sure if I like the term "archiving" for this. "Locking" seems to be better.

The implementation could for example be TAG based: All subtrees with a TAG :LOCKED: will never open when attacked with TAB (visibility cycling). This can be done using org-cycle-hook.

Proof of concept:

(defvar org-locked-subtrees t
  "Non-nil means, allow locked subtrees.")

(defun org-hide-locked-subtrees (state)
  "Re-hide all locked subtrees after a visibility state change."
  (interactive)
  (when (and org-locked-subtrees
             (not (memq state '(overview folded))))
    (save-excursion
      (let* ((globalp (memq state '(contents all)))
             (beg (if globalp (point-min) (point)))
(end (if globalp (point-max) (org-end-of-subtree) (point))))
        (goto-char beg)
        (while (re-search-forward ":LOCKED:" nil t)
          (and (org-on-heading-p) (hide-subtree))
          (org-end-of-subtree))))))

(add-hook 'org-cycle-hook 'org-hide-locked-subtrees 'append)

Then all that is needed is

- an easy way to toggle org-locked-subtrees (to allow looking at
  locked trees occasionally)
- and easy way to toggle the LOCKED tag
- An automatic locker that goes through the subitems of a given
  level N heading, locking all subtrees that do not have any
  open TODO items.

This is great.  I'll do something like this.  Thanks.

- Carsten

P.S. Thank you very much for org mode. I find I'm using it more and more: README files, task lists, etc. I've recently even impressed my technical leader at work (Qualcomm, San Diego) with how organized I am, mostly due to org-mode.

You're welcome.  I am glad it is so useful.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]