Browse Source

Allow to only display logging information in the agenda.

Jurgen Defume asked for a way to display only logging information in
the agenda.  This patch implements such a possibility.  It works by
calling `org-agenda-log-mode' (bound to `l' in the agenda) with a
double prefix arg.  This sets the variable `org-agenda-show-log' to a
special value `only' which is then interpreted by the agenda-creating
functions.
Carsten Dominik 16 years ago
parent
commit
fb92308d22
5 changed files with 35 additions and 11 deletions
  1. 4 1
      ORGWEBPAGE/Changes.org
  2. 4 0
      doc/ChangeLog
  3. 2 1
      doc/org.texi
  4. 6 0
      lisp/ChangeLog
  5. 19 9
      lisp/org-agenda.el

+ 4 - 1
ORGWEBPAGE/Changes.org

@@ -70,9 +70,12 @@
     much for normal applications, you can also temporarily
     request the inclusion of state changes by pressing =C-u l= in
     the agenda.
-    
+
     This was a request by Hsiu-Khuern Tang.
 
+    You can also press `C-u C-u l' to get *only* log items in the
+    agenda, withour any timestamps/deadlines etc.
+
 *** Footnote in HTML export are now collected at the end of the document
     Previously, footnotes would be left in the document where
     they are defined, now they are all collected and put into a

+ 4 - 0
doc/ChangeLog

@@ -1,3 +1,7 @@
+2008-11-09  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.texi (Agenda commands): Document the double-prefix version
+	of the `l' command in the agenda.
 
 2008-11-05  Carsten Dominik  <dominik@science.uva.nl>
 

+ 2 - 1
doc/org.texi

@@ -5937,7 +5937,8 @@ logging was on (variable @code{org-log-done}) are shown in the agenda, as are
 entries that have been clocked on that day.  You can configure the entry
 types that should be included in log mode using the variable
 @code{org-agenda-log-mode-items}.  When called with a @kbd{C-u} prefix, show
-all possible logbook entries, including state changes.
+all possible logbook entries, including state changes.  When called with two
+prefix args @kbd{C-u C-u}, show only logging information, nothing else.
 @c
 @kindex v
 @item v

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2008-11-09  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-agenda.el (org-agenda-list): Handle the value `only' of
+	org-agenda-show-log'.
+	(org-agenda-log-mode): Interpret a double prefix arg.
+
 2008-11-08  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-exp.el (org-export-html-footnotes-section): New variable.

+ 19 - 9
lisp/org-agenda.el

@@ -2426,13 +2426,18 @@ given in `org-agenda-start-on-weekday'."
       (while (setq file (pop files))
 	(catch 'nextfile
 	  (org-check-agenda-file file)
-	  (if org-agenda-show-log
-	      (setq rtn (org-agenda-get-day-entries
-			 file date
-			 :deadline :scheduled :timestamp :sexp :closed))
+	  (cond
+	   ((eq org-agenda-show-log 'only)
+	    (setq rtn (org-agenda-get-day-entries
+		       file date :closed)))
+	   (org-agenda-show-log
 	    (setq rtn (org-agenda-get-day-entries
 		       file date
-		       :deadline :scheduled :sexp :timestamp)))
+		       :deadline :scheduled :timestamp :sexp :closed)))
+	   (t
+	    (setq rtn (org-agenda-get-day-entries
+		       file date
+		       :deadline :scheduled :sexp :timestamp))))
 	  (setq rtnall (append rtnall rtn))))
       (if org-agenda-include-diary
 	  (progn
@@ -4628,13 +4633,18 @@ so that the date SD will be in that range."
   (message "Clocktable mode is %s"
 	   (if org-agenda-clockreport-mode "on" "off")))
 
-(defun org-agenda-log-mode (&optional with-states)
-  "Toggle log mode in an agenda buffer."
+(defun org-agenda-log-mode (&optional special)
+  "Toggle log mode in an agenda buffer.
+With argument SPECIAL, show all possible log items, not only the ones
+configured in `org-agenda-log-mode-items'.
+With a double `C-u' prefix arg, show *only* log items, nothing else."
   (interactive "P")
   (org-agenda-check-type t 'agenda 'timeline)
   (setq org-agenda-show-log
-	(if with-states '(closed clock state)
-	  (not org-agenda-show-log)))
+	(if (equal special '(16))
+	    'only
+	  (if special '(closed clock state)
+	    (not org-agenda-show-log))))
   (org-agenda-set-mode-name)
   (org-agenda-redo)
   (message "Log mode is %s"