all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* agenda question about representing items
@ 2013-01-23  3:57 Arun Persaud
  2013-01-23  4:38 ` Nick Dokos
  2013-01-23 14:04 ` Karl Voit
  0 siblings, 2 replies; 5+ messages in thread
From: Arun Persaud @ 2013-01-23  3:57 UTC (permalink / raw)
  To: Org Mode Mailing List

Hi

many of my projects have the following form:

* project name
** subtask
*** TODO item1
  SCHEDULED: <timestamp>

sometimes it looks like

* project name
** subtask
*** TODO item2 [1/3]
  - [X] task1
  - [ ] task2
  - [ ] task3
  SCHEDULED: <timestamp>

currently my agenda view shows something like

<filename>: <time> TODO <text next to TODO item in file> <tags>

e.g.
home: Scheduled: TODO look into customize agenda views

I'm wondering if it is possible to customize this, so that it will
display something like the following:

<filename>: <time> projectname->subtask->TODO look into customize agenda
views

that is adding some breadcrumbs in front of the item to make it clearer
what the context of the TODO item is.

For the second kind of items it would be nice to see something like this
in the agenda:

<filename>: <time> projectname->subtask->TODO item2 -> task2

e.g. also add the next item in the list that needs to be done.

Any ideas?

Thanks

Arun

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

* Re: agenda question about representing items
  2013-01-23  3:57 agenda question about representing items Arun Persaud
@ 2013-01-23  4:38 ` Nick Dokos
  2013-01-23 14:04 ` Karl Voit
  1 sibling, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2013-01-23  4:38 UTC (permalink / raw)
  To: Arun Persaud; +Cc: Org Mode Mailing List

Arun Persaud <apersaud@lbl.gov> wrote:

> Hi
> 
> many of my projects have the following form:
> 
> * project name
> ** subtask
> *** TODO item1
>   SCHEDULED: <timestamp>
> 
> sometimes it looks like
> 
> * project name
> ** subtask
> *** TODO item2 [1/3]
>   - [X] task1
>   - [ ] task2
>   - [ ] task3
>   SCHEDULED: <timestamp>
> 
> currently my agenda view shows something like
> 
> <filename>: <time> TODO <text next to TODO item in file> <tags>
> 
> e.g.
> home: Scheduled: TODO look into customize agenda views
> 
> I'm wondering if it is possible to customize this, so that it will
> display something like the following:
> 
> <filename>: <time> projectname->subtask->TODO look into customize agenda
> views
> 
> that is adding some breadcrumbs in front of the item to make it clearer
> what the context of the TODO item is.
> 

org-agenda-prefix-format can probably be adjusted to do some of this.
In particular, %t can deal with the timestamp and %(expression) can
evaluate a lisp expression: all you need to do is write a function to
get the pieces you want.

> For the second kind of items it would be nice to see something like this
> in the agenda:
> 
> <filename>: <time> projectname->subtask->TODO item2 -> task2
> 
> e.g. also add the next item in the list that needs to be done.
> 
> Any ideas?
> 

I don't know how to do this or even if it is possible without mucking
around with the code. But if history is any guide, it's probably
possible :-)

Nick

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

* Re: agenda question about representing items
  2013-01-23  3:57 agenda question about representing items Arun Persaud
  2013-01-23  4:38 ` Nick Dokos
@ 2013-01-23 14:04 ` Karl Voit
  2013-01-23 23:28   ` agenda question about representing items [PATCH] Arun Persaud
  1 sibling, 1 reply; 5+ messages in thread
From: Karl Voit @ 2013-01-23 14:04 UTC (permalink / raw)
  To: emacs-orgmode

Hi!

* Arun Persaud <apersaud@lbl.gov> wrote:
>
> I'm wondering if it is possible to customize this, so that it will
> display something like the following:
>
> <filename>: <time> projectname->subtask->TODO look into customize agenda
> views
>
> that is adding some breadcrumbs in front of the item to make it clearer
> what the context of the TODO item is.

Note: When you set your cursor to the entry in the agenda, you'll
notice those breadcrumbs being displayed at the echo area (bottom
line).


When I do face similar requirements, I tend to add tags to the
headings such, that the inherited tags give me some clue about the
breadcrumbs.

This way, I sometimes end up with headings like this:

*** Task this or that      :TaskThisOrThat:

Not quite perfect for a guy that loves de-duplication (I agree) but
it works.

-- 
Karl Voit

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

* Re: agenda question about representing items [PATCH]
  2013-01-23 14:04 ` Karl Voit
@ 2013-01-23 23:28   ` Arun Persaud
  2013-01-24 15:46     ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Persaud @ 2013-01-23 23:28 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi

thanks everyone for the feedback! With it I managed to use the
%(expression) in org-agenda-prefix-format to show the breadcrumbs. In
case that's useful for other people too, I attached a patch that adds a
%b option to org-agenda-prefix-format to does the same. Would be great,
if this could be included.

Thanks

Arun

[-- Attachment #2: 0001-added-option-b-to-dispaly-breadcrumbs-in-agenda.patch --]
[-- Type: text/x-patch, Size: 4348 bytes --]

From 2b22b753485bbb522f1f08902bd37c673b241637 Mon Sep 17 00:00:00 2001
From: Arun Persaud <apersaud@lbl.gov>
Date: Wed, 23 Jan 2013 15:21:31 -0800
Subject: [PATCH] added option %b to dispaly breadcrumbs in agenda

if org file has the structure

* project
** task1
*** TODO item1

then when using %b in org-agenda-prefix-format will display
project->taks1->TODO item1
---
 lisp/org-agenda.el | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f48ff6f..9716345 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1522,6 +1522,7 @@ This format works similar to a printf format, with the following meaning:
   %T   the last tag of the item (ignore inherited tags, which come first)
   %t   the HH:MM time-of-day specification if one applies to the entry
   %s   Scheduling/Deadline information, a short string
+  %b   show breadcrumbs, i.e., the names of the higher levels
   %(expression) Eval EXPRESSION and replace the control string
                 by the result
 
@@ -6301,6 +6302,9 @@ The flag is set if the currently compiled format contains a `%T'.")
 (defvar org-prefix-has-effort nil
   "A flag, set by `org-compile-prefix-format'.
 The flag is set if the currently compiled format contains a `%e'.")
+(defvar org-prefix-has-breadcrumbs nil
+  "A flag, set by `org-compile-prefix-format'.
+The flag is set if the currently compiled format contains a `%b'.")
 (defvar org-prefix-category-length nil
   "Used by `org-compile-prefix-format' to remember the category field width.")
 (defvar org-prefix-category-max-length nil
@@ -6448,6 +6452,10 @@ Any match of REMOVE-RE will be removed from TXT."
 				"......")))
 			 (t ""))
 	      extra (or (and (not habitp) extra) "")
+	      breadcrumbs (let ((m (org-get-at-bol 'org-marker)))
+			     (org-with-point-at m
+			       (let ((s (org-display-outline-path nil nil "->" t)))
+				 (concat s "->"))))
 	      category (if (symbolp category) (symbol-name category) category)
 	      thecategory (copy-sequence category)
 	      level (or level ""))
@@ -6478,6 +6486,7 @@ Any match of REMOVE-RE will be removed from TXT."
 	  'duration duration
 	  'effort effort
 	  'effort-minutes neffort
+	  'breadcrumbs breadcrumbs
 	  'txt txt
 	  'level level
 	  'time time
@@ -6577,7 +6586,8 @@ and stored in the variable `org-prefix-format-compiled'."
   (setq org-prefix-has-time nil
 	org-prefix-has-tag nil
 	org-prefix-category-length nil
-	org-prefix-has-effort nil)
+	org-prefix-has-effort nil
+	org-prefix-has-breadcrumbs nil)
   (let ((s (cond
 	    ((stringp org-agenda-prefix-format)
 	     org-agenda-prefix-format)
@@ -6586,11 +6596,11 @@ and stored in the variable `org-prefix-format-compiled'."
 	    (t "  %-12:c%?-12t% s")))
 	(start 0)
 	varform vars var e c f opt)
-    (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cltsei]\\|(.+)\\)"
+    (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cltseib]\\|(.+)\\)"
 			 s start)
       (setq var (or (cdr (assoc (match-string 4 s)
 				'(("c" . category) ("t" . time) ("l" . level) ("s" . extra)
-				  ("i" . category-icon) ("T" . tag) ("e" . effort))))
+				  ("i" . category-icon) ("T" . tag) ("e" . effort) ("b" . breadcrumbs))))
 		    'eval)
 	    c (or (match-string 3 s) "")
 	    opt (match-beginning 1)
@@ -6598,6 +6608,7 @@ and stored in the variable `org-prefix-format-compiled'."
       (if (equal var 'time) (setq org-prefix-has-time t))
       (if (equal var 'tag)  (setq org-prefix-has-tag  t))
       (if (equal var 'effort) (setq org-prefix-has-effort t))
+      (if (equal var 'breadcrumbs) (setq org-prefix-has-breadcumbs t))
       (setq f (concat "%" (match-string 2 s) "s"))
       (when (equal var 'category)
 	(setq org-prefix-category-length
@@ -6624,7 +6635,8 @@ and stored in the variable `org-prefix-format-compiled'."
 	     `((org-prefix-has-time ,org-prefix-has-time)
 	       (org-prefix-has-tag ,org-prefix-has-tag)
 	       (org-prefix-category-length ,org-prefix-category-length)
-	       (org-prefix-has-effort ,org-prefix-has-effort))
+	       (org-prefix-has-effort ,org-prefix-has-effort)
+	       (org-prefix-has-has-breadcrumbs ,org-prefix-has-breadcrumbs))
 	     `(format ,s ,@vars))))))
 
 (defun org-set-sorting-strategy (key)
-- 
1.8.1.1


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

* Re: agenda question about representing items [PATCH]
  2013-01-23 23:28   ` agenda question about representing items [PATCH] Arun Persaud
@ 2013-01-24 15:46     ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2013-01-24 15:46 UTC (permalink / raw)
  To: Arun Persaud; +Cc: emacs-orgmode

Hi Arun,

Arun Persaud <apersaud@lbl.gov> writes:

> thanks everyone for the feedback! With it I managed to use the
> %(expression) in org-agenda-prefix-format to show the breadcrumbs. In
> case that's useful for other people too, I attached a patch that adds a
> %b option to org-agenda-prefix-format to does the same. Would be great,
> if this could be included.

Thanks for the patch -- can you sign the FSF copyright assignment?
http://orgmode.org/cgit.cgi/org-mode.git/plain/request-assign-future.txt

Otherwise I won't be able to apply it.

Thanks!

-- 
 Bastien

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

end of thread, other threads:[~2013-01-24 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23  3:57 agenda question about representing items Arun Persaud
2013-01-23  4:38 ` Nick Dokos
2013-01-23 14:04 ` Karl Voit
2013-01-23 23:28   ` agenda question about representing items [PATCH] Arun Persaud
2013-01-24 15:46     ` Bastien

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.