Implemented new archiving mechanism: The Attic Sibling.

Archiving to the attic sibling means to move the entry to
become a child of a sibling with heading "Attic", that is also
marked with the ARCHIVE tag.
This commit is contained in:
Carsten Dominik 2008-04-08 12:29:28 +02:00
parent a40a2cfe5e
commit 15534acef0
32 changed files with 5996 additions and 53 deletions

View File

@ -1,3 +1,14 @@
2008-04-08 Carsten Dominik <dominik@science.uva.nl>
* lisp/org-agenda.el (org-agenda-archive-to-attic-sibling): New
command.
* doc/org.texi (Moving subtrees): Document archiving to the attic
sibling.
* lisp/org.el (org-attic-heading): New option.
(org-archive-to-attic-sibling): New function.
2008-04-07 Carsten Dominik <dominik@science.uva.nl>
* lisp/org-mew.el: File added, moved here from contrib/lisp.

View File

@ -9,6 +9,19 @@
** Details
*** New archiving mechanism: The Attic Sibling
There is a new method to archive entries in the current file:
By moving it to a sibling called the Attic Sibling. That
sibling has the heading "Attic" and also carries the ARCHIVE
tag. It seems to me that this is a great way to do archiving
inside a project, to get parts of the project out of the way
and to wait with archiving the entire project until it is
truly done. The key binding for the is "C-c C-x A", and
from the agenda buffer you can simply use "A".
Thanks to Ilya Shlyakhter for this brilliant idea.
*** Support for Sebastian Rose's Javasript org-info.js.
This fascinating program allows and Org file (exported to
HTML) to be viewed different ways. There is an Info-like

View File

@ -22,9 +22,9 @@ messages, BBDB entries, and any files related to the projects. For
printing and sharing of notes, an Org-mode file can be exported as a
structured ASCII file, HTML, and LaTeX.
* Current Version (6.00pre-3) and Compatibility
* Current Version (6.00pre-4) and Compatibility
The current version is 6.00pre-3. To see what has changed in recent
The current version is 6.00pre-4. To see what has changed in recent
releases, check this [[file:Changes.html][list of user-visible changes]]. These descriptions
are extensive, to avoid that people will be printing the manual after
each incremental release. If you have an older version of the manual,

View File

@ -1,7 +1,7 @@
The is a distribution of Org, a plain text notes and project planning
tool for Emacs.
The version of this release is: 6.00pre-3
The version of this release is: 6.00pre-4
The homepage of Org is at http://orgmode.org

49
doc/auto/orgcard.el Normal file
View File

@ -0,0 +1,49 @@
(TeX-add-style-hook "orgcard"
(lambda ()
(TeX-add-symbols
"endexample"
"endindentedkeys"
"columnsperpage"
"letterpaper"
"intercolumnskip"
"titlefont"
"headingfont"
"smallfont"
"smallsy"
"eightrm"
"eightbf"
"eightit"
"eighttt"
"eightmi"
"eightsy"
"keyindent"
"metaxwidth"
"orgversionnumber"
"versionyear"
"year"
"shortcopyrightnotice"
"copyrightnotice"
"ncolumns"
"scaledmag"
"rm"
"bf"
"it"
"tt"
"makefootline"
"maxcolumn"
"abc"
"multicolumnformat"
"columnbox"
"bye"
"small"
"newcolumn"
"title"
"section"
"beginindentedkeys"
"paralign"
"kbd"
"beginexample"
"key"
"metax"
"threecol")))

View File

@ -3,7 +3,7 @@
@setfilename ../../info/org
@settitle The Org Manual
@set VERSION 6.00pre-3
@set VERSION 6.00pre-4
@set DATE April 2008
@dircategory Emacs
@ -969,13 +969,13 @@ is. Configure the details using the variable
The following commands help managing the ARCHIVE tag:
@table @kbd
@kindex C-c C-x C-a
@item C-c C-x C-a
@kindex C-c C-x a
@item C-c C-x a
Toggle the ARCHIVE tag for the current headline. When the tag is set,
the headline changes to a shadowed face, and the subtree below it is
hidden.
@kindex C-u C-c C-x C-a
@item C-u C-c C-x C-a
@kindex C-u C-c C-x a
@item C-u C-c C-x a
Check if any direct children of the current headline should be archived.
To do this, each subtree is checked for open TODO entries. If none are
found, the command offers to set the ARCHIVE tag for the child. If the
@ -990,11 +990,18 @@ Cycle a tree even if it is tagged with ARCHIVE.
@subsection Moving subtrees
@cindex external archiving
Once an entire project is finished, you may want to move it to a
different location, either in the current file, or even in a different
file, the archive file.
Once an entire project is finished, you may want to move it to a different
location. Org can move it to an @emph{Attic Sibling} in the same tree, to a
different tree in the current file, or to a different file, the archive file.
@table @kbd
@kindex C-c C-x A
@item C-c C-x A
Move the curent entry to the @emph{Attic Sibling}. This is a sibling of the
entry with the heading @samp{Attic} and the tag @samp{ARCHIVE}
(@pxref{ARCHIVE tag}). The entry becomes a child of that sibling and in this
way retains a lot of its original context, including inherited tags and
approximate position in the outline.
@kindex C-c C-x C-s
@item C-c C-x C-s
Archive the subtree starting at the cursor position to the location
@ -5599,9 +5606,20 @@ to it in the original Org file. If the text to be deleted remotely
is longer than one line, the kill needs to be confirmed by the user. See
variable @code{org-agenda-confirm-kill}.
@c
@kindex a
@item a
Toggle the ARCHIVE tag for the current headline.
@c
@kindex A
@item A
Move the subtree correspoding to the current entry to its @emph{Attic
Sibling}.
@c
@kindex $
@item $
Archive the subtree corresponding to the current headline.
Archive the subtree corresponding to the current headline. This means the
entry will be moved to the configured archive locatin, most likely a
different file.
@c
@kindex T
@item T
@ -5613,10 +5631,6 @@ inheritance, this may be more than the tags listed in the line itself.
Set tags for the current headline. If there is an active region in the
agenda, change a tag for all headings in the region.
@c
@kindex a
@item a
Toggle the ARCHIVE tag for the current headline.
@c
@kindex ,
@item ,
Set the priority for the current item. Org mode prompts for the
@ -8842,6 +8856,8 @@ other things.
Linking to VM/BBDB/Gnus was inspired by @i{Tom Shannon}'s
@file{organizer-mode.el}.
@item
@i{Ilya Shlyakhter} proposed the Attic Sibling.
@item
@i{Daniel Sinder} came up with the idea of internal archiving by locking
subtrees.
@item

2882
doc/orgcard.ps Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
% Reference Card for Org Mode
\def\orgversionnumber{6.00pre-3}
\def\orgversionnumber{6.00pre-4}
\def\versionyear{2008} % latest update
\def\year{2008} % latest copyright year
@ -325,9 +325,10 @@ are preserved on all copies.
\section{Archiving}
\key{toggle ARCHIVE tag}{C-c C-x C-a}
%\metax{mark fully done children}{C-u C-c C-x C-a}
\key{toggle ARCHIVE tag}{C-c C-x a}
\key{force cycling of an ARCHIVEd tree}{C-TAB}
\key{move to Attic Sibling}{C-c C-x A}
%\metax{mark fully done children}{C-u C-c C-x C-a}
\key{move subtree to archive file}{C-c C-x C-s}
%\metax{move all fully done children}{C-u C-c C-x C-s}
%To set archive location for current file, add a line like$^2$:
@ -648,7 +649,7 @@ after ``{\tt :}'', and dictionary words elsewhere.
\key{digit argument}{0-9}
\key{change state of current TODO item}{t}
\key{kill item and source}{C-k}
\key{archive the subtree}{\$}
\key{archive the subtree}{\$ / a / A}
\key{show tags of current headline}{T}
\key{set tags for current headline/region}{:}
\key{toggle ARCHIVE tag}{a}

2884
doc/orgcard_letter.ps Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;
@ -1003,6 +1003,7 @@ The following commands are available:
(org-defkey org-agenda-mode-map "\C-c$" 'org-agenda-archive)
(org-defkey org-agenda-mode-map "\C-c\C-x\C-s" 'org-agenda-archive)
(org-defkey org-agenda-mode-map "$" 'org-agenda-archive)
(org-defkey org-agenda-mode-map "A" 'org-agenda-archive-to-attic-sibling)
(org-defkey org-agenda-mode-map "\C-c\C-o" 'org-agenda-open-link)
(org-defkey org-agenda-mode-map " " 'org-agenda-show)
(org-defkey org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo)
@ -1107,7 +1108,10 @@ The following commands are available:
["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t]
"--"
["Cycle TODO" org-agenda-todo t]
["Archive subtree" org-agenda-archive t]
("Archive"
["Toggle ARCHIVE tag" org-agenda-toggle-archive-tag t]
["Move to attic sibling" org-agenda-archive-to-attic-sibling t]
["Archive subtree" org-agenda-archive t])
["Delete subtree" org-agenda-kill t]
["Add note" org-agenda-add-note t]
"--"
@ -4274,7 +4278,7 @@ Point is in the buffer where the item originated.")
(message "Agenda item and source killed"))))
(defun org-agenda-archive ()
"Kill the entry or subtree belonging to the current agenda entry."
"Archive the entry or subtree belonging to the current agenda entry."
(interactive)
(or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
(let* ((marker (or (get-text-property (point) 'org-marker)
@ -4291,6 +4295,24 @@ Point is in the buffer where the item originated.")
(org-archive-subtree))
(error "Archiving works only in Org-mode files"))))))
(defun org-agenda-archive-to-attic-sibling ()
"Move the entry to the attic sibling."
(interactive)
(or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
(let* ((marker (or (get-text-property (point) 'org-marker)
(org-agenda-error)))
(buffer (marker-buffer marker))
(pos (marker-position marker)))
(org-with-remote-undo buffer
(with-current-buffer buffer
(if (org-mode-p)
(save-excursion
(goto-char pos)
(org-remove-subtree-entries-from-agenda)
(org-back-to-heading t)
(org-archive-to-attic-sibling))
(error "Archiving works only in Org-mode files"))))))
(defun org-remove-subtree-entries-from-agenda (&optional buf beg end)
"Remove all lines in the agenda that correspond to a given subtree.
The subtree is the one in buffer BUF, starting at BEG and ending at END.

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Bastien Guerry <bzg at altern dot org>
;; Carsten Dominik <carsten dot dominik at gmail dot com>
;; Keywords: org, wp, remember
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -4,7 +4,7 @@
;;
;; Emacs Lisp Archive Entry
;; Filename: org-export-latex.el
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;; Author: Bastien Guerry <bzg AT altern DOT org>
;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
;; Keywords: org, wp, tex

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -4,7 +4,7 @@
;;
;; Author: Philip Jackson <emacs@shellarchive.co.uk>
;; Keywords: erc, irc, link, org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -3,7 +3,7 @@
;; Copyright (C) 2008 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;; Keywords: outlines, hypermedia, calendar, wp
;; This file is part of GNU Emacs.

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -4,7 +4,7 @@
;;
;; Emacs Lisp Archive Entry
;; Filename: org-mew.el
;; Version: 0.1
;; Version: 6.00pre-4
;; Author: Bastien Guerry <bzg AT altern DOT org>
;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
;; Keywords: org, mail, Mew

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -4,7 +4,7 @@
;;
;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -4,7 +4,7 @@
;; Author: David O'Toole <dto@gnu.org>
;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
;; Keywords: hypermedia, outlines, wp
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;

View File

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.00pre-3
;; Version: 6.00pre-4
;;
;; This file is part of GNU Emacs.
;;
@ -92,7 +92,7 @@
;;; Version
(defconst org-version "6.00pre-3"
(defconst org-version "6.00pre-4"
"The version number of the file org.el.")
(defun org-version (&optional here)
@ -753,6 +753,13 @@ get the proper fontification."
:group 'org-keywords
:type 'string)
(defcustom org-attic-heading "Attic"
"Name of the local attic sibling that is used to archive entries locally.
Locally means: in the tree, under a sibling.
See `org-archive-to-attic-sibling' for more information."
:group 'org-archive
:type 'string)
(defcustom org-agenda-skip-archived-trees t
"Non-nil means, the agenda will skip any items located in archived trees.
An archived tree is a tree marked with the tag ARCHIVE."
@ -779,7 +786,9 @@ collapsed state."
(defcustom org-archive-location "%s_archive::"
"The location where subtrees should be archived.
This string consists of two parts, separated by a double-colon.
Otherwise, the value of this variable is a string, consisting of two
parts, separated by a double-colon.
The first part is a file name - when omitted, archiving happens in the same
file. %s will be replaced by the current file name (without directory part).
@ -809,7 +818,11 @@ Here are a few examples:
You may set this option on a per-file basis by adding to the buffer a
line like
#+ARCHIVE: basement::** Finished Tasks"
#+ARCHIVE: basement::** Finished Tasks
You may also define it locally for a subtree by setting an ARCHIVE property
in the entry. If such a property is found in an entry, or anywhere up
the hierarchy, it will be used."
:group 'org-archive
:type 'string)
@ -6380,7 +6393,7 @@ this heading."
(if (string-match "\\(.*\\)::\\(.*\\)" org-archive-location)
(progn
(setq afile (format (match-string 1 org-archive-location)
(file-name-nondirectory buffer-file-name))
(file-name-nondirectory buffer-file-name))
heading (match-string 2 org-archive-location)))
(error "Invalid `org-archive-location'"))
(if (> (length afile) 0)
@ -6400,7 +6413,8 @@ this heading."
(setq category (org-get-category)
todo (and (looking-at org-todo-line-regexp)
(match-string 2))
priority (org-get-priority (if (match-end 3) (match-string 3) ""))
priority (org-get-priority
(if (match-end 3) (match-string 3) ""))
ltags (org-get-tags)
itags (org-delete-all ltags (org-get-tags-at)))
(setq ltags (mapconcat 'identity ltags " ")
@ -6455,7 +6469,7 @@ this heading."
(goto-char (point-max)) (insert "\n"))
;; Paste
(org-paste-subtree (org-get-valid-level level 1))
;; Mark the entry as done
(when (and org-archive-mark-done
(looking-at org-todo-line-regexp)
@ -6465,7 +6479,7 @@ this heading."
(org-todo
(car (or (member org-archive-mark-done org-done-keywords)
org-done-keywords)))))
;; Add the context info
(when org-archive-save-context-info
(let ((l org-archive-save-context-info) e n v)
@ -6474,7 +6488,7 @@ this heading."
(stringp v) (string-match "\\S-" v))
(setq n (concat "ARCHIVE_" (upcase (symbol-name e))))
(org-entry-put (point) n v)))))
;; Save and kill the buffer, if it is not the same buffer.
(if (not (eq this-buffer buffer))
(progn (save-buffer) (kill-buffer buffer)))))
@ -6487,6 +6501,55 @@ this heading."
(concat "under heading: " heading)
(concat "in file: " (abbreviate-file-name afile)))))))
(defun org-archive-to-attic-sibling ()
"Archive the current heading by moving it under the attic sibling.
The attic sibling is a sibling of the heading with the heading name
`org-attic-heading and an `org-archive-tag' tag. If this sibling does
not exist, it will be created at the end of the subtree."
(interactive)
(save-restriction
(widen)
(let (b e pos leader level)
(org-back-to-heading t)
(looking-at outline-regexp)
(setq leader (match-string 0)
level (funcall outline-level))
(setq pos (point))
(condition-case nil
(outline-up-heading 1 t)
(error (goto-char (point-min))))
(setq b (point))
(condition-case nil
(org-end-of-subtree t t)
(error (goto-char (point-max))))
(setq e (point))
(goto-char b)
(unless (re-search-forward
(concat "^" (regexp-quote leader)
"[ \t]*"
org-attic-heading
"[ \t]*:"
org-archive-tag ":") e t)
(goto-char e)
(or (bolp) (newline))
(insert leader org-attic-heading "\n")
(beginning-of-line 0)
(org-toggle-tag org-archive-tag 'on))
(beginning-of-line 1)
(org-end-of-subtree t t)
(save-excursion
(goto-char pos)
(org-cut-subtree))
(org-paste-subtree (org-get-valid-level level 1))
(org-set-property
"ARCHIVE_TIME"
(format-time-string
(substring (cdr org-time-stamp-formats) 1 -1)
(current-time)))
(outline-up-heading 1 t)
(hide-subtree)
(goto-char pos))))
(defun org-get-category (&optional pos)
"Get the category applying to position POS."
(get-text-property (or pos (point)) 'org-category))
@ -13251,6 +13314,8 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
(org-defkey org-mode-map "\C-c$" 'org-archive-subtree)
(org-defkey org-mode-map "\C-c\C-x\C-s" 'org-advertized-archive-subtree)
(org-defkey org-mode-map "\C-c\C-x\C-a" 'org-toggle-archive-tag)
(org-defkey org-mode-map "\C-c\C-xa" 'org-toggle-archive-tag)
(org-defkey org-mode-map "\C-c\C-xA" 'org-archive-to-attic-sibling)
(org-defkey org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer)
(org-defkey org-mode-map "\C-c\C-j" 'org-goto)
(org-defkey org-mode-map "\C-c\C-t" 'org-todo)