emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Hide timestamps for several days time range in agenda
@ 2010-07-12  8:17 Julien Barnier
  2010-07-12  9:50 ` Rémi Vanicat
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Barnier @ 2010-07-12  8:17 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I'm currently trying to use the agenda a bit more, but there is one thing I
didn't manage :

If i've got a several days timerange entry, such as the following :

*** <2010-07-22 jeu.>--<2010-07-23 ven.> Paris

The result in my current agenda view is :

Jeudi      22 Juillet 2010
   -- <2010-07-22 jeu.>--<2010-07-23 ven.> Paris
Vendredi   23 Juillet 2010
   -- <2010-07-22 jeu.>--<2010-07-23 ven.> Paris


My question is : how do I hide the timestamps in these entries ? What I'd like
to obtain would be simply :

Jeudi      22 Juillet 2010
   -- Paris
Vendredi   23 Juillet 2010
   -- Paris


Thanks in advance for any idea,

Julien

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

* Re: Hide timestamps for several days time range in agenda
  2010-07-12  8:17 Hide timestamps for several days time range in agenda Julien Barnier
@ 2010-07-12  9:50 ` Rémi Vanicat
  2010-07-12 10:12   ` Julien Barnier
  0 siblings, 1 reply; 5+ messages in thread
From: Rémi Vanicat @ 2010-07-12  9:50 UTC (permalink / raw)
  To: emacs-orgmode

Julien Barnier <julien@no-log.org> writes:

> Hi,
>
> I'm currently trying to use the agenda a bit more, but there is one thing I
> didn't manage :
>
> If i've got a several days timerange entry, such as the following :
>
> *** <2010-07-22 jeu.>--<2010-07-23 ven.> Paris
>

[...]

>
> My question is : how do I hide the timestamps in these entries ? What I'd like
> to obtain would be simply :

What appear on the agenda is the title of entry, that is what is on ***
line. Just put the timestamp on another line: 

*** Paris
  <2010-07-22 jeu.>--<2010-07-23 ven.> 

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

* Re: Hide timestamps for several days time range in agenda
  2010-07-12  9:50 ` Rémi Vanicat
@ 2010-07-12 10:12   ` Julien Barnier
  2010-07-12 11:40     ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Barnier @ 2010-07-12 10:12 UTC (permalink / raw)
  To: emacs-orgmode

Rémi Vanicat <vanicat <at> debian.org> writes:

> What appear on the agenda is the title of entry, that is what is on ***
> line. Just put the timestamp on another line: 
> 
> *** Paris
>   <2010-07-22 jeu.>--<2010-07-23 ven.> 

Yes, this workaround works, thanks !

However, I've noticed that if I only put a single timestamp for an event, it is
dropped in the agenda view, unlike time ranges. For example :

*** <2010-08-01 dim.> Paris

will give :

Dimanche    1 Août 2010
    Paris

That's why I wondered if there is an option to keep the same behavior with time
ranges.

Thanks,

Julien

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

* Re: Re: Hide timestamps for several days time range in agenda
  2010-07-12 10:12   ` Julien Barnier
@ 2010-07-12 11:40     ` Carsten Dominik
  2010-07-12 13:57       ` [PATCH] Add the ability to remove time ranges specifications for agenda items that span on several days Julien Barnier
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2010-07-12 11:40 UTC (permalink / raw)
  To: Julien Barnier; +Cc: emacs-orgmode


On Jul 12, 2010, at 12:12 PM, Julien Barnier wrote:

> Rémi Vanicat <vanicat <at> debian.org> writes:
>
>> What appear on the agenda is the title of entry, that is what is on  
>> ***
>> line. Just put the timestamp on another line:
>>
>> *** Paris
>>  <2010-07-22 jeu.>--<2010-07-23 ven.>
>
> Yes, this workaround works, thanks !
>
> However, I've noticed that if I only put a single timestamp for an  
> event, it is
> dropped in the agenda view, unlike time ranges. For example :
>
> *** <2010-08-01 dim.> Paris
>
> will give :
>
> Dimanche    1 Août 2010
>    Paris
>
> That's why I wondered if there is an option to keep the same  
> behavior with time
> ranges.

No, there is currently not.

- Carsten

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

* [PATCH] Add the ability to remove time ranges specifications for agenda items that span on several days
  2010-07-12 11:40     ` Carsten Dominik
@ 2010-07-12 13:57       ` Julien Barnier
  0 siblings, 0 replies; 5+ messages in thread
From: Julien Barnier @ 2010-07-12 13:57 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik <at> gmail.com> writes:

> No, there is currently not.

I just coded a small patch that seems to work. It introduces a new custom
variable to org-agenda, called "org-agenda-remove-timeranges-from-blocks" (there
could be a better name !) which, when non-nil, removes the time ranges
specifications from agenda lines.

Short example with the following entry :

*** <2010-07-16 lun.>--<2010-07-17 mer.> Test entry

If the variable is set to nil :

Vendredi   16 Juillet 2010
   -- <2010-07-16 lun.>--<2010-07-17 mer.> Test entry
Samedi     17 Juillet 2010
   -- <2010-07-16 lun.>--<2010-07-17 mer.> Test entry

If the variable is non-nil :

Vendredi   16 Juillet 2010
   --  Test entry
Samedi     17 Juillet 2010
   --  Test entry


Feel free to modify the patch or to find it quite unuseful :-)

Sincerely,

Julien

---
 lisp/org-agenda.el |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 191ee52..7a10375 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1336,6 +1336,11 @@ the headline/diary entry."
 	  (const :tag "Never" nil)
 	  (const :tag "When at beginning of entry" beg)))
 
+(defcustom org-agenda-remove-timeranges-from-blocks nil
+  "Non-nil means remove time ranges specifications in agenda
+items that span on several days."
+  :group 'org-agenda-line-format
+  :type 'boolean)
 
 (defcustom org-agenda-default-appointment-duration nil
   "Default duration for appointments that only have a starting time.
@@ -4790,13 +4795,20 @@ FRACTION is what fraction of the head-warning time has
passed."
 		(setq tags (org-get-tags-at))
 		(looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
 		(setq head (match-string 1))
+		(setq remove-re
+		      (if org-agenda-remove-timeranges-from-blocks
+			  (concat
+			   "<" (regexp-quote s1) ".*?>"
+			   "--"
+			   "<" (regexp-quote s2) ".*?>")
+			nil))
 		(setq txt (org-format-agenda-item
 			   (format
 			    (nth (if (= d1 d2) 0 1)
 				 org-agenda-timerange-leaders)
 			    (1+ (- d0 d1)) (1+ (- d2 d1)))
 			   head category tags
-			   timestr)))
+			   timestr nil remove-re)))
 	      (org-add-props txt props
 		'org-marker marker 'org-hd-marker hdmarker
 		'type "block" 'date date
-- 
1.7.1

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

end of thread, other threads:[~2010-07-12 14:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-12  8:17 Hide timestamps for several days time range in agenda Julien Barnier
2010-07-12  9:50 ` Rémi Vanicat
2010-07-12 10:12   ` Julien Barnier
2010-07-12 11:40     ` Carsten Dominik
2010-07-12 13:57       ` [PATCH] Add the ability to remove time ranges specifications for agenda items that span on several days Julien Barnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).