From 157a29d052a4ed3e653bfa5ebff3e1e08535a00b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 15 Apr 2008 09:15:01 +0200 Subject: [PATCH 1/2] Cleaned up the todo.org file. --- ORGWEBPAGE/todo.org | 451 +------------------------------------------- 1 file changed, 5 insertions(+), 446 deletions(-) diff --git a/ORGWEBPAGE/todo.org b/ORGWEBPAGE/todo.org index f2bee19cd..f72bd20a0 100644 --- a/ORGWEBPAGE/todo.org +++ b/ORGWEBPAGE/todo.org @@ -42,27 +42,14 @@ something. ** Structure *** TODO Definition lists, like in Muse *** TODO Get rid of all the \r instances, which were used only for XEmacs. -*** IDEA Should we allow #+TODO as an alias for #+SEQ_TODO? *** TODO proper visibility cycling for items Make them not hide the text after the final list item. This is not trivial, we cannot usenormal outline stuff, needs a separate implementaiton. -*** IDEA allow different colors for different TODO keywords/tags. -*** TODO Use an indirect buffer for org-goto. - Is there a problem with the overriding map? - *** WISH Inline TODO entries A way to put a TODO entry without starting a new section. -*** TODO Speedbar support for agenda. - ** Agenda issues -*** QUESTION COLUMN View - is this safe, or could things be messed up with this? -*** TODO Make S-right and S-left change TODO keywords - Right now they change the time stamps. This could be - M-left/right, but this could also cause inconsistencies, because - when on a time stamp, the same keys do exactly this. *** WISH Make more modes changeable from the agenda These could be made available for toggling, just like follow-mode. Examples: @@ -74,20 +61,9 @@ something. However, I could also have a TODO keyword criterion that could be used in the day entries, as one of the minor criteria. -*** DECLINED Allow separators in the Tag-sorted agenda view - This feature is not going to come, because block agendas can - achieve the same thing. - - ** Links -*** WISH When editing links, give access to stored links. - Not sure why this is needed. - Idea from William Henney. *** WISH Variable of standard links for completion with C-c C-l Or something like that, to make standard links fast. -*** WISH Make brackets in links possible - Would require a display property also for the label part of - links. *** IDEA Find all links to a specific file *** IDEA Make info HTML links work for links to Info files Info links of course only work inside Emacs. However, many info @@ -108,75 +84,32 @@ something. mechanism for this into org-publish.el. The discussion about this was started by [[http://thread.gmane.org/gmane.emacs.orgmode/281][Austin Frank]] -*** DECLINED Agenda collections, based on #+COLLECTION lines. - [[http://thread.gmane.org/gmane.emacs.orgmode/139][Tim Callaghan]] started the discussion on this one. - Declined because this would depend on local variables and the - agenda commands are global. Also, this can actually be done by - specifying the file list in a custom agenda command. - -*** DECLINED Make CamelCase words link to corresponding org-mode files. - Files in the same directory. Or some other way to easy do that. - Would be useful for publishing projects. This would be an - incompatible change, but I don't think anyone is using CamelCase - anyway? - This is marked declined, because link abbreviations now provide an - easy way to make links to other files. - *** TODO Document the character protection in links I don't think this is really covered anywhere. Maybe we also should protect characters in the visible part, to make sure thing will never be on two lines...? + *** WISH Radio targets across files I guess each org file could write a .orgtargets.filename file, if it has any radio targets. - -** DECLINED Fast update for external editing - Could I use a dynamic block for this? - - ** Tables + *** WISH Row formulas @4=..... + *** TODO Write a tutorial Demonstrate running averages. *** WISH Make a variable that current line should be recomputed always in each table, skipping headers of course. -*** TODO Allow a table to locally change the unit system - This is for using constants.el. - Well, it is now possible to do this for the file, is this enough??? -*** QUESTION Does inserting hlines change references correctly? *** WISH Interactive way to get a converted table? + *** BUG When computing in a narrowed column, this may go wrong. Computing changes fields and does not yet see correctly if the column width has changed, in the case of a narrowed column. -*** DECLINED Alternative for the implementation of orgtbl-minor-mode: - I could use post-command-hook to set the variable orgtbl-mode. - I will not do this now and only consider it if problems show up. - -*** DECLINED Table info lines are not necessarily comments in orgtbl-mode - Should I generalize this? No, because the table itself will not be - in the correct syntax for whatever mode. - -*** DECLINED S-cursor motion to select part of a table, with proper highlighting. - Similar to CUA - - -** Properties and Column View -*** TODO Mouse support for selecting values - This could/should be part of org-mouse.el. - - [ ] tags - - [ ] todo - - [ ] priority - - [ ] allowed values - - [ ] deadline - - [ ] scheduled. -*** BUG We have no clear view on what to do with properties upon export. - - ** Compatibility issues *** Emacs 21 compatibility This is being phased out. Almost everything works under Emacs 21, @@ -209,47 +142,13 @@ something. ** Exporting *** IDEA Convert links to footnotes for ASCII export. -*** DECLINED Store LaTeX code as HTML comments - Declined because I don't really see the need for this. -*** IDEA Microformats - Nic Ferrier has been pushing this agenda for a long time, for - example with [[http://thread.gmane.org/gmane.emacs.orgmode/140/][this email]]. I am not deep enough into the semantic - web that I could do this myself. Maybe we can do this by - modifying the html exporter step-by-step? + *** INCONSISTENCY Find a better place for formatting checkboxes Right now this is being done as part of `org-html-expand', which does not seem logically correct. -*** DECLINED Can I make the exporter more efficient? - The line-by-line processing may not be the fastest way to do - this. It certainly uses more resources. Right now the exporters - do work though, so it is unlikely that I am going to change this. - -*** DECLINED CSV import/export of tables? - I remember this coming up several times, for example in emails - from [[http://thread.gmane.org/gmane.emacs.orgmode/156][Niels Giesen]] and [[http://thread.gmane.org/gmane.emacs.orgmode/139][Tim Callaghan]]. Org-mode does have - Tab-separated export of tables, so right now I don't really see - the benefit of adding CSV export. Are there applications that do - not understand tab-separated files, but do understand - comma-separated ones? - -*** DECLINED In HTML export, make links from the time stamps - Time stamps have their own class now which allows to highlight - them etc. But I was wondering if something more useful could be - done with them, like a link to some kind of calendar... - - ** Miscellaneous Stuff -*** TODO reinstating a repeated item: keyword for logging. *** BUG Comments cannot be filled -*** IDEA New uses for C-c C-c - - Compute time interval on time range - - Update CLOCK interval -*** QUESTION Fix more beginning-of-line commands - Org-mode re-binds C-a to make this command go to the beginning of - a visible line. There are other keys which might invoke C-a. - Should these keys be changed as well? one could use - `substitute-key-definition' on the global map to find them all. *** QUESTION Inlining of images in Org-mode files *** TODO Fixup outline-magic.el, so that it can be used. *** TODO Use the new argument of bibtex-url @@ -259,16 +158,6 @@ something. clever way. Currently I am not using this, because too many people use an old Emacs version which does not have this. however, eventually I will implement this. -*** WISH Get people to write articles about how to do GTD with Org-mode. - There is now one by Charles Cave, read it [[http://members.optusnet.com.au/~charles57/GTD/orgmode.html][here]] - -*** IDEA Tree statistics - A key that can be applied to a tree, showing statistics: - - how many headlines - - how many TODO - - how many DONE - - Checkboxes - - etc.... *** QUESTION Do we need a 43 folders implementation? That could easily be done in an org-mode file. But then, maybe @@ -307,341 +196,11 @@ something. I am actually not sure, I might have addressed this already, but my memory is failing me. Needs some checking. -*** DECLINED HAVE a TIME 3:55 line collecting CLOCK results - The CLOCK lines could be there in addition, or could even be - removed, so that only one line is kept. -*** DECLINED Think about Piotr's idea of treating TODO like a TAG. - The answer is probably NO because the simple part of TODO must - still be there and I like the keyword at the beginning of the line, - just like a checkbox. Of course you can make a TODO tag yourself - at any time. - *** DECLINED Inlining of external files -*** DECLINED Should TAB on TODO keyword rotate its state? - Problem: If the keyword disappears, it will suddenly start to fold.... - So my feeling right now is that the answer should be NO. - - No, because S-left/right does this already pretty well - -*** DECLINED Create a DONE counter in the mode line - That counter shows what faction of entries has been marked DONE. I - am not yet sure how useful such a thing would be, because of the - huge number of entries that can be in a file, and the different - weight of such entries. - Declined because we do now have counters for checkboxes, and the - feeling is that this is not so useful for TODOs. - - * Archive ** Archived Tasks -*** DONE(<2006-06-01 Thu 09:15>) Commands to move through an item list - next item, previous item. What should happen at the boundaries of - the current list? - -*** DONE(<2006-06-01 Thu 09:16>) Force relative links, would this be useful? - - -*** DONE(<2006-06-01 Thu 09:16>) Fix empty search string. - -*** DONE(<2006-06-01 Thu 09:16>) STARTUP options for logging - -*** DONE(<2006-06-01 Thu 09:16>) Make a variable for Pete, to have SCHEDULED at point - -*** DONE(<2006-06-01 Thu 09:16>) Fix ASCII export of narrowed columns - -*** DONE(<2006-06-01 Thu 09:16>) org-file-apps should allow regular expressions - -*** DONE(<2006-06-01 Thu 09:16>) fix problem with w32- versus mswindows-.... - -*** DONE(<2006-06-01 Thu 09:17>) Document that font-lock-mode is needed - -*** DONE(<2006-06-01 Thu 09:17>) Add keyboard access and menu commands for org-project.el - C-c C-x C-p or something like that. - In the menu, it goes under export, or even its own group. - -*** DONE(<2006-06-01 Thu 09:17>) Document those new keys in orgcard.tex - C-c C-x C-p or something like that. - In the menu, it goes under export, or even its own group. - -*** DONE(<2006-06-01 Thu 09:17>) Remove SCHEDULED keyword when marking it done. - in particular when adding a CLOSED timestamp. - Only problem is that when unclosing it, it should be scheduled - again - -*** DONE(<2006-06-01 Thu 09:17>) Don't show tasks already scheduled for the future, only stuff which - is not yet scheduled. - -*** DONE(<2006-06-01 Thu 09:17>) Put title and tags in separate classes - -*** DONE(<2006-06-01 Thu 09:17>) Option to leave out TAGS from export - -*** DONE(<2006-06-01 Thu 09:17>) Option to leave out Timestamps from export - -*** DONE(<2006-06-01 Thu 09:17>) Checkable items like Frank Ruell's proposal - -*** DONE(<2006-06-01 Thu 09:17>) Classify Keywords and time stamps - SCHEDULED: timestamp goes here
- -*** DONE(<2006-06-01 Thu 09:17>) Change default for include-all-todo to nil - -*** DONE(<2006-06-01 Thu 09:17>) Specify TAGS in a special line instead of collecting them dynamically - The could help to avoid typos and could be faster for very large files. - -*** DONE(<2006-06-01 Thu 09:17>) Some much faster interface for setting tags. - Basically, use single keys to add/remove tags from the list. Also - for this the idea to define tags in a special line would be good, - in order to have a way to define the shortcuts. - -*** DONE(<2006-06-01 Thu 09:17>) Remove date stamps from headline if they are not needed. - Bug report from Scott. - - -*** DONE(<2006-06-01 Thu 09:17>) : Maybe s-up/down should change priorities only in headlines - Right now this works wherever the cursor is. If this is changed, - should S-up or S-down do something else? - -*** DONE(<2006-06-01 Thu 09:21>) Need a command to remove tabulators from a line. - Use this in ASCII export, to make sure we get the indentation - right. - -*** DONE(<2006-06-01 Thu 09:24>) Improve tab in org-cycle: - - there is a bug when the setting is 'white: It requires a - non-empty white line! - - There should be another setting to have tab be the tabulator in - the white space at the beginning of the line. - - Finally, when TAB closes an entry, maybe it should go beck to the - beginning of the entry??? On the other hand, it is good to be - able to go back to the old place with just another tab. - -*** DONE(<2006-06-01 Thu 11:48>) Include TAGS into sorting. - But what strategy should be used when there are several tags? - -*** DONE(<2006-06-06 Tue 10:15>) Archiving an entry in current buffer goes to end of file - Should go to end of subtree. - This is done now, and I also control the amount of empty lines - created by the archiving process in general. - -*** DONE(<2006-06-06 Tue 10:16>) Narrowing agenda to current files does not work as advertized. - C-c a 1 t should make the TODO list for the current file, but does - not. - -*** DONE(<2006-06-06 Tue 10:17>) Radio TAGS for the fast tag interface. - Make lists of tags that are mutually exclusive. So when I turn on - @HOME, @WORK would be turned off automagically. A good syntax for - defining these groups in the #+TAGS line would be: - : #+TAGS: [@WORK(w) @HOME(h) @CLUB(c)] Laptop(l) PC(p) Car(r) - This could indicate that @WORK, @HOME, @CLUB are mutually exclusive. - - If I do this, I will also need a syntax for the global alist to - indicate the same thing. - - It seems to me that with such grouping of tags, sorting would be - useful as it would improve the overview over the current tags. I - might even be able to support mutually exclusive tags with - fontification in the interface. Or arrange things such that the - mutually exclusive ones are all in the same row or column, to - optimize the visual feedback. - - For the internal format, I think best would be something like - - : '( (:startgroup) ("@work") ("@home") ("@club") (:endgroup) - : ("Laptop") ("PC") ("Car")) - This setup makes sure that assoc and rassoc still do work as - expected. - -*** DONE(<2006-06-06 Tue 10:17>) Should tags be sorted in a certain way? - Right now, you can either set the tag sequence yourself through - the completion interface. If you use the fast tag selection - interface, the tag sequence depends on the order in which tags are - selected and deselected. maybe a specific roder would be useful - for example the same order as the one given in the configuration? - -*** DONE(<2006-06-06 Tue 10:17>) Remove narrowing cookies for export - Exported tables should not show narrowing cookies. In fact, if a - table line does contain nothing but narrowing cookies, the entire - line should be removed. - -*** DONE(<2006-06-11 Sun 07:32>) Track working times similar to time-clock.el - This was proposed by David O'Toole in an - [[http://thread.gmane.org/gmane.emacs.orgmode/387][email to emacs-orgmode@gnu.org]]. He wants to be able to know the - times when he worked at a particular project. Some reporting - possibility would be needed to make this useful. Maybe sparse - trees with broken-down working times? - -*** DONE(<2006-06-15 Thu 13:35>) Make org-store-link do better in image-mode buffers - Just link to the file. - -*** DONE(<2006-06-15 Thu 13:35>) Use a ported version of noutline.el - Programming the old outline-mode is really a nightmare - the new - outline mode that uses invisibility properties instead of - selective display works really much much better. There is now - an [[http://thread.gmane.org/gmane.emacs.orgmode/214/focus=218][experimental port]] by Greg Chernov, so when I find time I will - try if this works well. If yes, this port should become part of - XEmacs. Once that happens, I could remove a large amount of - ballast from org.el - -*** DONE(<2006-06-15 Thu 13:35>) Verify links during export - -*** DONE(<2006-09-25 Mon 16:11>) Allow counting checkboxes - Then some statistics should be displayed. One idea is for - checkboxes, to use a special box [%] which will be updated with - percent of done. I could have an alternative [/] that will be - updated with something like [19/25] to show progress, and when the - two numbers are equal, I could highlight then in DONE face, just - like [100%]. All smaller numbers could be highlighted even in - TODO face if I wanted. Hmmm, I am beginning to like this. - - Then: how to update this? Each time a checkbox is added or - toggled, go up and update all the counts, right up to something - which is not an item, or up to the previous header line. - - Maybe I should also make an option for turning this on, to avoid - slowdown. I guess for long lists this could be slow. - - Also would need a command for global update. - - An maybe plain list and checkboxes should get their own chapter? - In Structure they seem to be a bit hidden..... - - Also a menu sublist... - -*** DONE(<2006-09-25 Mon 16:11>) Allow stacking calls to org-occur - This was a proposal from Piotr. It is now possible, the second - and subsequent calls to org-occur need a prefix argument to keep - the previous highlights. - -*** DONE(<2006-09-25 Mon 16:12>) Create a hook to be run after an agenda buffer has been finalized. - -*** DONE(<2006-09-25 Mon 16:12>) Include TAGS into sorting. - But what strategy should be used when there are several tags? - -*** DONE(<2006-09-25 Mon 16:12>) Fixup tag display in agenda buffer. - The tabs mess up everything. Either remove the tabs, or realign - the tags to some useful column. - -*** DONE(<2006-09-25 Mon 16:12>) Blocks in agenda: - Make a single agenda buffer that contains several sets of items, - like the TODO list, a tags list, and a day view. Not a bad idea. - This was [[http://thread.gmane.org/gmane.emacs.orgmode/167/focus=168][Piotr's idea]]. - -*** DONE(<2006-09-25 Mon 16:12>) Make org-store-link do the right thing in dired-mode - -*** DONE([2006-11-02 Thu 10:24]) Control over windows being used for agenda and related buffers :NEW: - -*** DONE([2007-01-24 Wed 12:59]) Extend access to table fields - Find a general way to get any rectangular region into a calc - vector - -*** DONE([2007-01-24 Wed 12:59]) Allow links to remote images to be inlined. - -*** DONE([2007-01-24 Wed 12:59]) M-TAB on an already complete tag should add the ":" - -*** DONE([2007-01-24 Wed 13:07]) Need a command to do show hierarchy after isearch. - Maybe automatically, using isearch-mode-end-hook. But this does - not seem to work, because to is called before the overlays are - re-installed. I can create a new hook, isearch-exit-hook, run in - `isearch-exit'. - -*** DONE([2007-02-18 Sun 07:16]) hook for users to do their own agenda lists - New function dumping headline into the agenda buffer, based on regexp - and callback, to allow general stuff. For the special tags, we can - search for one and check for the others using the callback. - -*** DONE([2007-02-18 Sun 07:37]) Make C-c C-l also work on a plain link, converting it into bracket. - -*** DONE([2007-02-18 Sun 07:37]) GNUS gnus:mail.general#123 stuff should be "Email from:..." - -*** DONE([2007-02-18 Sun 07:38]) Email/message context: What format? - I can think of two good formats for this: - : Email from John Smith (if I an the receiver) - : Email to John Smith (if I am the author) - or - : John Smith on: Some subject (this is the current Org-mode default.) - The first format requires better parsing of the messages (to get - both author and receiver names), and also - some way to detect if I am the author of this email or not. - -*** DONE([2007-02-21 Wed 12:04]) Allow internal links to match inside *other* link - Only the link itself that actually triggered the search. - -*** DONE([2007-02-21 Wed 12:07]) Allow fully protected HTML code that will be exported as is - Currently, @<...> works only for simple tags, and I think we - should have something better. Idea: Text between - and , mark it with a text property and then exclude - each match in the run preparing the export. - I guess I could require these at the beginning of the line, like - -#+PROTECT - -#+ENDPROECT - - or something like that....... - -*** DONE([2007-03-13 Tue 05:19]) Make it possible to set TOC levels independently of headline levels - The easiest way to do this would obviously be to allow a number - setting for the tco switch, not only a simple t/nil switch. This - can be nice for webpages: One could have only top-level or level - 1 and 2 in the toc at the beginning of the page, and then still a - more complex structure below. - -*** DONE([2007-03-13 Tue 05:20]) Filling is not done in a compatible way. - The current setup used the Emacs variables and machine to get the - filling of plain lists and everything lese right. XEmacs uses the - filladapt package, which has different ways to do the same - things. org.el should be smart about this and setup filling under - XEmacs correctly. - -*** DONE([2007-06-06 Wed 17:44]) Repeating Schedules? - [[http://thread.gmane.org/gmane.emacs.orgmode/149][Dieter Grollman]] requested this feature, but for now I have decided - not to do anything about it. I don't see a good way to implement - this, and I believe that cyclic diary entries are good enough for - such tasks. - -*** DONE([2007-06-14 Thu 13:16]) improve item indentation when promoting and demoting - -*** DONE([2007-06-14 Thu 13:17]) The TODO buffer lists possible TODO keywords - These are taken from the current buffer, so when multiple buffers - are involved, this list may not be correct..... - -*** DONE([2007-06-14 Thu 13:20]) Conflict between bold emphasis and headlines - At the beginning of a line, Org-mode does not know if *bold* is a - headline or an emphasis. This will not be easy to fix. The way - to do ii is to require a space after the star in headlines. This - requires to change outline-regexp, outline-level, the many many - times when outline regexp is used in the program, and also the - countless times when I am simply matching th stars directly. - -*** DONE C-c - for cycling bullet types. - ARCHIVED: <2007-07-02 Mon> - -*** DONE improve what TAB does with new item - ARCHIVED: <2007-07-02 Mon> - same or additional indentation???? - -*** DONE Make it easier to do monthly agendas, and agendas for ranges - ARCHIVED: <2007-07-02 Mon> - -*** DONE Introduce a LOCATION keyword - ARCHIVED: <2007-07-02 Mon> - similar to DEADLINE and SCHEDULED - Idea from Bastien - This could be done now using properties, I don't think we need a - special thing for this anymore. - -*** DONE Times/date not always removed in agenda lines - ARCHIVED: <2007-07-02 Mon> - Even when org-agenda-remove-times-when-in-prefix is set, there - seem to be cases where this does not work. I forgot what the - example was - does anyone remember? - -*** DONE Links are still highlighted in fixed-width environments. - ARCHIVED: <2007-07-02 Mon> - This ties in with the problem that there is no way to have - protected HTML code in the file. - * COMMENT HTML style specifications # Local Variables: From b0ba02839429e64bdd96502e92909a242f825357 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 15 Apr 2008 11:02:10 +0200 Subject: [PATCH 2/2] Implement Summaries for Column View in agenda. --- ChangeLog | 9 ++++ doc/org.texi | 58 ++++++++++++++++++++++- lisp/org-agenda.el | 59 ++++++++++++++++++------ lisp/org-colview.el | 110 ++++++++++++++++++++++++++++++++++++++++---- lisp/org.el | 1 + 5 files changed, 214 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcf3be109..9ae71a991 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-04-15 Carsten Dominik + * lisp/org-agenda.el (org-agenda-columns-show-summaries) + (org-agenda-columns-compute-summary-properties): New options. + + * lisp/org-colview.el (org-agenda-colview-summarize) + (org-agenda-colview-compute): New functions. + (org-agenda-columns): Call `org-agenda-colview-summarize'. + + * doc/org.texi (Agenda column view): New section. + * lisp/org.el (org-tbl-menu): Protect the use of variables that are only available when org-table.el gets loaded. (org-read-agenda-file-list): Error if `org-agenda-files' is a diff --git a/doc/org.texi b/doc/org.texi index 4fd1d8950..444d9d269 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -238,6 +238,7 @@ Agenda Views * Presentation and sorting:: How agenda items are prepared for display * Agenda commands:: Remote editing of Org trees * Custom agenda views:: Defining special searches and views +* Agenda column view:: Using column view for collected entries The built-in agenda views @@ -4896,6 +4897,7 @@ window configuration is restored when the agenda exits: * Presentation and sorting:: How agenda items are prepared for display * Agenda commands:: Remote editing of Org trees * Custom agenda views:: Defining special searches and views +* Agenda column view:: Using column view for collected entries @end menu @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views @@ -5780,7 +5782,7 @@ visit org files will not be removed. @end table -@node Custom agenda views, , Agenda commands, Agenda Views +@node Custom agenda views, Agenda column view, Agenda commands, Agenda Views @section Custom agenda views @cindex custom agenda views @cindex agenda views, custom @@ -6203,6 +6205,60 @@ foreach $line (split(/\n/,$agenda)) @{ @end group @end example +@node Agenda column view, , Custom agenda views, Agenda Views +@section Using column view in the agenda +@cindex column view, in agenda +@cindex agenda, column view + +Column view (@pxref{Column view}) is normally used to view and edit +properties embedded in the hierarchical structure of an Org file. It can be +quite useful to use column view also from the agenda, where entries are +collected by certain criteria. + +@table @kbd +@kindex C-c C-x C-c +@item C-c C-x C-c +Turn on column view in the agenda. +@end table + +To understand how to use this properly, it is important to realize that the +entries in the agenda are no longer in their proper outline environment. +This causes the following issues: + +@enumerate +@item +Org needs to make a decision which @code{COLUMNS} format to use. Since the +entries in the agenda are collected from different files, and different files +may have different @code{COLUMNS} formats, this is a non-trivial problem. +Org first checks if the variable @code{org-overriding-columns-format} is +currently set, and if yes takes the format from there. Otherwise it takes +the format associated with the first item in the agenda, or, if that item +does not have a specific format (defined in a property, or in it's file), it +uses @code{org-columns-default-format}. +@item +If any of the columns has a summary type defined (@pxref{Column attributes}), +turning on column view in the agenda will visit all relevant agenda files and +make sure that the computations of this property are up to date. This is +also true for the special @code{CLOCKSUM} property. Org will then sum the +values displayed in the agenda. In the daily/weekly agenda, the sums will +cover a single day, in all other views they cover the entire block. It is +vital to realize that the agenda may show the same entry @emph{twice} (for +example as scheduled and as a deadline), and it may show two entries from the +same hierarchy (for example a @emph{parent} and it's @emph{child}). In these +cases, the summation in the agenda will lead to incorrect results because +some values will count double. +@item +When the column view in the agenda shows the @code{CLOCKSUM}, that is always +the entire clocked time for this item. So even in the daily/weekly agenda, +the clocksum listed in column view may originate from times outside the +current view. This has the advantage that you can compare these values with +a column listing the planned total effort for a task - one of the major +applications for column view in the agenda. If you want information about +clocked time in the displayed period use clock table mode (press @kbd{R} in +the agenda). +@end enumerate + + @node Embedded LaTeX, Exporting, Agenda Views, Top @chapter Embedded LaTeX @cindex @TeX{} interpretation diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 2cbf93287..8c8c0921e 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -927,6 +927,28 @@ a names face, or a list like `(:background \"Red\")'." (sexp :tag "face"))))) +(defgroup org-agenda-column-view nil + "Options concerning column view in the agenda." + :tag "Org Agenda Column View" + :group 'org-agenda) + +(defcustom org-agenda-columns-show-summaries t + "Non-nil means, show summaries for columns displayed in the agenda view." + :group 'org-agenda-column-view + :type 'boolean) + +(defcustom org-agenda-columns-compute-summary-properties t + "Non-nil means, recompute all summary properties before column view. +When column view in the agenda is listing properties that have a summary +operator, it can go to all relevant buffers and recompute the summaries +there. This can mean overhead for the agenda column view, but is necessary +to have thing up to date. +As a special case, a CLOCKSUM property also makes sure that the clock +computations are current." + :group 'org-agenda-column-view + :type 'boolean) + + (eval-when-compile (require 'cl)) (require 'org) @@ -1858,6 +1880,7 @@ higher priority settings." (defvar org-agenda-multi nil) ; dynammically scoped (defvar org-agenda-buffer-name "*Org Agenda*") (defvar org-pre-agenda-window-conf nil) +(defvar org-agenda-columns-active nil) (defvar org-agenda-name nil) (defun org-prepare-agenda (&optional name) (setq org-todo-keywords-for-agenda nil) @@ -1870,6 +1893,8 @@ higher priority settings." (insert "\n" (make-string (window-width) ?=) "\n")) (narrow-to-region (point) (point-max))) (org-agenda-reset-markers) + (setq org-agenda-contributing-files nil) + (setq org-agenda-columns-active nil) (org-prepare-agenda-buffers (org-agenda-files)) (setq org-todo-keywords-for-agenda (org-uniquify org-todo-keywords-for-agenda)) @@ -1891,7 +1916,7 @@ higher priority settings." (delete-other-windows) (org-switch-to-buffer-other-window abuf)))) (setq buffer-read-only nil) - (erase-buffer) + (let ((inhibit-read-only t)) (erase-buffer)) (org-agenda-mode) (and name (not org-agenda-name) (org-set-local 'org-agenda-name name))) @@ -3503,6 +3528,8 @@ Any match of REMOVE-RE will be removed from TXT." (ts (if dotime (concat (if (stringp dotime) dotime "") txt))) (time-of-day (and dotime (org-get-time-of-day ts))) stamp plain s0 s1 s2 rtn srp) + (and (org-mode-p) buffer-file-name + (add-to-list 'org-agenda-contributing-files buffer-file-name)) (when (and dotime time-of-day org-prefix-has-time) ;; Extract starting and ending time and move them to prefix (when (or (setq stamp (string-match org-stamp-time-of-day-regexp ts)) @@ -3854,17 +3881,21 @@ If ERROR is non-nil, throw an error, otherwise just return nil." (defun org-agenda-quit () "Exit agenda by removing the window or the buffer." (interactive) - (let ((buf (current-buffer))) - (if (not (one-window-p)) (delete-window)) - (kill-buffer buf) - (org-agenda-reset-markers) - (org-columns-remove-overlays)) - ;; Maybe restore the pre-agenda window configuration. - (and org-agenda-restore-windows-after-quit - (not (eq org-agenda-window-setup 'other-frame)) - org-pre-agenda-window-conf - (set-window-configuration org-pre-agenda-window-conf))) - + (if org-agenda-columns-active + (progn + (setq org-agenda-columns-active nil) + (org-columns-quit)) + (let ((buf (current-buffer))) + (if (not (one-window-p)) (delete-window)) + (kill-buffer buf) + (org-agenda-reset-markers) + (org-columns-remove-overlays)) + ;; Maybe restore the pre-agenda window configuration. + (and org-agenda-restore-windows-after-quit + (not (eq org-agenda-window-setup 'other-frame)) + org-pre-agenda-window-conf + (set-window-configuration org-pre-agenda-window-conf)))) + (defun org-agenda-exit () "Exit agenda by removing the window or the buffer. Also kill all Org-mode buffers which have been loaded by `org-agenda'. @@ -3893,14 +3924,17 @@ So this is just a shortcut for `\\[org-agenda]', available in the agenda." When this is the global TODO list, a prefix argument will be interpreted." (interactive) (let* ((org-agenda-keep-modes t) + (cols org-agenda-columns-active) (line (org-current-line)) (window-line (- line (org-current-line (window-start)))) (lprops (get 'org-agenda-redo-command 'org-lprops))) + (and cols (org-columns-quit)) (message "Rebuilding agenda buffer...") (org-let lprops '(eval org-agenda-redo-command)) (setq org-agenda-undo-list nil org-agenda-pending-undo-list nil) (message "Rebuilding agenda buffer...done") + (and cols (interactive-p) (org-agenda-columns)) (goto-line line) (recenter window-line))) @@ -4965,7 +4999,6 @@ This is a command that has to be installed in `calendar-mode-map'." (if (fboundp 'fit-window-to-buffer) (fit-window-to-buffer (get-buffer-window "*Dates*"))))) - ;;; Appointment reminders (defvar appt-time-msg-list) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index bc54ead1d..bdcc228da 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -41,13 +41,17 @@ (defvar org-columns-current-fmt nil "Local variable, holds the currently active column format.") +(make-variable-buffer-local 'org-columns-current-fmt) (defvar org-columns-current-fmt-compiled nil "Local variable, holds the currently active column format. This is the compiled version of the format.") +(make-variable-buffer-local 'org-columns-current-fmt-compiled) (defvar org-columns-current-widths nil "Loval variable, holds the currently widths of fields.") +(make-variable-buffer-local 'org-columns-current-widths) (defvar org-columns-current-maxwidths nil "Loval variable, holds the currently active maximum column widths.") +(make-variable-buffer-local 'org-columns-current-maxwidths) (defvar org-columns-begin-marker (make-marker) "Points to the position where last a column creation command was called.") (defvar org-columns-top-level-marker (make-marker) @@ -132,8 +136,13 @@ This is the compiled version of the format.") (and (looking-at "\\(\\**\\)\\(\\* \\)") (org-get-level-face 2)))) (color (list :foreground - (face-attribute (or level-face 'default) :foreground))) - props pom property ass width f string ov column val modval) + (face-attribute + (or level-face + (and (eq major-mode 'org-agenda-mode) + (get-text-property (point-at-bol) 'face)) + 'default) :foreground))) + (face (list color 'org-column)) + pom property ass width f string ov column val modval) ;; Check if the entry is in another buffer. (unless props (if (eq major-mode 'org-agenda-mode) @@ -162,9 +171,7 @@ This is the compiled version of the format.") string (format f (or modval val))) ;; Create the overlay (org-unmodified - (setq ov (org-columns-new-overlay - beg (setq beg (1+ beg)) string - (list color 'org-column))) + (setq ov (org-columns-new-overlay beg (setq beg (1+ beg)) string face)) (org-overlay-put ov 'keymap org-columns-map) (org-overlay-put ov 'org-columns-key property) (org-overlay-put ov 'org-columns-value (cdr ass)) @@ -397,17 +404,22 @@ Where possible, use the standard interface for changing this line." (defun org-columns-edit-allowed () "Edit the list of allowed values for the current property." (interactive) - (let* ((key (get-char-property (point) 'org-columns-key)) + (let* ((pom (or (get-text-property (point-at-bol) 'org-marker) + (get-text-property (point-at-bol) 'org-hd-marker) + (point))) + (key (get-char-property (point) 'org-columns-key)) (key1 (concat key "_ALL")) - (allowed (org-entry-get (point) key1 t)) + (allowed (org-entry-get pom key1 t)) nval) ;; FIXME: Cover editing TODO, TAGS etc in-buffer settings.???? + ;; FIXME: Write back to #+PROPERTY setting if that is needed. (setq nval (read-string "Allowed: " allowed)) (org-entry-put (cond ((marker-position org-entry-property-inherited-from) org-entry-property-inherited-from) ((marker-position org-columns-top-level-marker) - org-columns-top-level-marker)) + org-columns-top-level-marker) + (t pom)) key1 nval))) (defun org-columns-eval (form) @@ -658,6 +670,7 @@ display, or in the #+COLUMNS line of the current buffer." (defvar org-agenda-view-columns-initially nil "When set, switch to columns view immediately after creating the agenda.") +(defvar org-agenda-columns-show-summaries) ; defined in org-agenda.el (defun org-agenda-columns () "Turn on column view in the agenda." (interactive) @@ -685,6 +698,7 @@ display, or in the #+COLUMNS line of the current buffer." (setq fmt (or fmt org-columns-default-format)) (org-set-local 'org-columns-current-fmt fmt) (org-columns-compile-format fmt) + (org-agenda-colview-compute org-columns-current-fmt-compiled) (save-excursion ;; Get and cache the properties (goto-char (point-min)) @@ -700,7 +714,84 @@ display, or in the #+COLUMNS line of the current buffer." (mapc (lambda (x) (goto-line (car x)) (org-columns-display-here (cdr x))) - cache))))) + cache) + (when org-agenda-columns-show-summaries + (org-agenda-colview-summarize cache)))))) + +(defun org-agenda-colview-summarize (cache) + "Summarize the summarizable columns in column view in the agenda. +This will add overlays to the date lines, to show the summary for each day." + (let* ((fmt (mapcar (lambda (x) + (list (car x) (if (equal (car x) "CLOCKSUM") + 'add_times (nth 4 x)))) + org-columns-current-fmt-compiled)) + line c c1 stype props lsum entries prop v) + (when (delq nil (mapcar 'cadr fmt)) + ;; OK, at least one summation column, it makes sense to try this + (goto-char (point-max)) + (while (not (bobp)) + (if (not (or (get-text-property (point) 'org-date-line) + (eq (get-text-property (point) 'face) + 'org-agenda-structure))) + (beginning-of-line 0) + ;; OK, this is a date line + (setq line (org-current-line)) + (setq entries nil c cache cache nil) + (while (setq c1 (pop c)) + (if (> (car c1) line) + (push c1 entries) + (push c1 cache))) + ;; now ENTRIES are the ones we want to use, CACHE is the rest + ;; Compute the summaries for the properties we want, + ;; set nil properties for the rest. + (when (setq entries (mapcar 'cdr entries)) + (setq props + (mapcar + (lambda (f) + (setq prop (car f) stype (nth 1 f)) + (cond + ((equal prop "ITEM") + (cons prop (buffer-substring (point-at-bol) + (point-at-eol)))) + ((not stype) (cons prop "")) + (t + ;; do the summary + (setq lsum 0) + (mapc (lambda (x) + (setq v (cdr (assoc prop x))) + (if v (setq lsum (+ lsum + (org-column-string-to-number + v stype))))) + entries) + (cons prop (org-columns-number-to-string lsum stype))))) + fmt)) + (org-columns-display-here props) + (org-set-local 'org-agenda-columns-active t)) + (beginning-of-line 0)))))) + +(defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el +(defun org-agenda-colview-compute (fmt) + "Compute the relevant columns in the contributing source buffers." + (when org-agenda-columns-compute-summary-properties + (let ((files org-agenda-contributing-files) + (org-columns-begin-marker (make-marker)) + (org-columns-top-level-marker (make-marker)) + f fm a b) + (while (setq f (pop files)) + (setq b (find-buffer-visiting f)) + (with-current-buffer (or (buffer-base-buffer b) b) + (save-excursion + (save-restriction + (goto-char (point-min)) + (org-columns-get-format-and-top-level) + (while (setq fm (pop fmt)) + (if (equal (car fm) "CLOCKSUM") + (org-clock-sum) + (when (and (nth 4 fm) + (setq a (assoc (car fm) + org-columns-current-fmt-compiled)) + (equal (nth 4 a) (nth 4 fm))) + (org-columns-compute (car fm)))))))))))) (defun org-columns-get-autowidth-alist (s cache) "Derive the maximum column widths from the format and the cache." @@ -1056,3 +1147,4 @@ and tailing newline characters." (provide 'org-colview) ;;; org-colview.el ends here + diff --git a/lisp/org.el b/lisp/org.el index 729eae8da..77895a862 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1324,6 +1324,7 @@ taken from the (otherwise obsolete) variable `org-todo-interpretation'." (make-variable-buffer-local 'org-todo-keywords-1) (defvar org-todo-keywords-for-agenda nil) (defvar org-done-keywords-for-agenda nil) +(defvar org-agenda-contributing-files nil) (defvar org-not-done-keywords nil) (make-variable-buffer-local 'org-not-done-keywords) (defvar org-done-keywords nil)