emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Feature request: skip blocked lines in agenda view grid
@ 2008-10-18 14:59 Michael Ekstrand
  2008-10-20 10:56 ` Carsten Dominik
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michael Ekstrand @ 2008-10-18 14:59 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1096 bytes --]

I'd find it quite helpful in reviewing my agenda if there was an option
to skip displaying grid lines which happen in the middle of timed
appointments.  Right now, I see the following:

Saturday   18 October 2008
               8:00...... ----------------
              10:00...... ----------------
              12:00...... ----------------
              14:00...... ----------------
              16:00...... ----------------
  Church:     17:30-19:00 Saturday service
              18:00...... ----------------
  master:     19:00...... People over for supper
              20:00...... ----------------

If it could optionally and intelligently drop the 18:00 grid line
because there is a previous timed appointment overlapping it, the
resulting display would show me more clearly that I don't have time
between it and the next event.

Thanks,
- Michael

-- 
mouse, n: A device for pointing at the xterm in which you want to type.
Confused by the strange files?  I cryptographically sign my messages.
For more information see <http://www.elehack.net/resources/gpg>.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 196 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Feature request: skip blocked lines in agenda view grid
  2008-10-18 14:59 Feature request: skip blocked lines in agenda view grid Michael Ekstrand
@ 2008-10-20 10:56 ` Carsten Dominik
  2008-10-20 13:37 ` Chris McMahan
  2008-10-21  2:24 ` Michael Ekstrand
  2 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2008-10-20 10:56 UTC (permalink / raw)
  To: Michael Ekstrand; +Cc: emacs-orgmode

Hi Michael,

more in general, a more graphic representation would be nice, but  
difficult.   I don't have time for this, I am afraid.

- Carsten

On Oct 18, 2008, at 4:59 PM, Michael Ekstrand wrote:

> I'd find it quite helpful in reviewing my agenda if there was an  
> option
> to skip displaying grid lines which happen in the middle of timed
> appointments.  Right now, I see the following:
>
> Saturday   18 October 2008
>               8:00...... ----------------
>              10:00...... ----------------
>              12:00...... ----------------
>              14:00...... ----------------
>              16:00...... ----------------
>  Church:     17:30-19:00 Saturday service
>              18:00...... ----------------
>  master:     19:00...... People over for supper
>              20:00...... ----------------
>
> If it could optionally and intelligently drop the 18:00 grid line
> because there is a previous timed appointment overlapping it, the
> resulting display would show me more clearly that I don't have time
> between it and the next event.
>
> Thanks,
> - Michael
>
> -- 
> mouse, n: A device for pointing at the xterm in which you want to  
> type.
> Confused by the strange files?  I cryptographically sign my messages.
> For more information see <http://www.elehack.net/resources/gpg>.
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Feature request: skip blocked lines in agenda view grid
  2008-10-18 14:59 Feature request: skip blocked lines in agenda view grid Michael Ekstrand
  2008-10-20 10:56 ` Carsten Dominik
@ 2008-10-20 13:37 ` Chris McMahan
  2008-10-20 21:14   ` Wes Hardaker
  2008-10-20 21:19   ` Wes Hardaker
  2008-10-21  2:24 ` Michael Ekstrand
  2 siblings, 2 replies; 9+ messages in thread
From: Chris McMahan @ 2008-10-20 13:37 UTC (permalink / raw)
  To: Michael Ekstrand; +Cc: emacs-orgmode

Might I suggest a format similar to the one that the Cal-desk package
generates..
http://www.emacswiki.org/emacs/cal-desk-calendar.el

I don't have the lisp skill to take this on, but I would certainly
like to see this functionality in the agenda view!

A modified version of your appointments might then look like this:

Saturday, October 18, 2008
==========================
             8:00
             9:00
            10:00
            11:00
            12:00
            13:00
            14:00
            15:00
            16:00
            17:00
  Church:     :30 | Saturday service
            18:00 |
  master:   19:00 | People over for supper

- Chris

Michael Ekstrand writes:
>I'd find it quite helpful in reviewing my agenda if there was an option
>to skip displaying grid lines which happen in the middle of timed
>appointments.  Right now, I see the following:
>
>Saturday   18 October 2008
>               8:00...... ----------------
>              10:00...... ----------------
>              12:00...... ----------------
>              14:00...... ----------------
>              16:00...... ----------------
>  Church:     17:30-19:00 Saturday service
>              18:00...... ----------------
>  master:     19:00...... People over for supper
>              20:00...... ----------------
>
>If it could optionally and intelligently drop the 18:00 grid line
>because there is a previous timed appointment overlapping it, the
>resulting display would show me more clearly that I don't have time
>between it and the next event.
>
>Thanks,
>- Michael
>
>-- 
>mouse, n: A device for pointing at the xterm in which you want to type.
>Confused by the strange files?  I cryptographically sign my messages.
>For more information see <http://www.elehack.net/resources/gpg>.
>_______________________________________________
>Emacs-orgmode mailing list
>Remember: use `Reply All' to send replies to the list.
>Emacs-orgmode@gnu.org
>http://lists.gnu.org/mailman/listinfo/emacs-orgmode

-- 
================================
Chris McMahan | cmcmahan@one.net
================================

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

* Re: Feature request: skip blocked lines in agenda view grid
  2008-10-20 13:37 ` Chris McMahan
@ 2008-10-20 21:14   ` Wes Hardaker
  2008-10-20 21:19   ` Wes Hardaker
  1 sibling, 0 replies; 9+ messages in thread
From: Wes Hardaker @ 2008-10-20 21:14 UTC (permalink / raw)
  To: Chris McMahan; +Cc: emacs-orgmode, Michael Ekstrand


Hey, as long as we're shooting for the stars how about.  No, I don't
have the time to code it either...  But I like to dream!

  Saturday, October 18, 2008
  ==========================
               8:00
               9:00
              10:00
              11:00
    Work:     12:00 / Working at office
              13:00 |
    Work:     14:00 | / Meeting with client
              15:00 | \
              16:00 \
              17:00
    Church:     :30 / Saturday service
                :45 | < I give a sermon on org mode
              18:00 \
    master:   19:00 < People over for supper

-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett

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

* Re: Feature request: skip blocked lines in agenda view grid
  2008-10-20 13:37 ` Chris McMahan
  2008-10-20 21:14   ` Wes Hardaker
@ 2008-10-20 21:19   ` Wes Hardaker
  1 sibling, 0 replies; 9+ messages in thread
From: Wes Hardaker @ 2008-10-20 21:19 UTC (permalink / raw)
  To: Chris McMahan; +Cc: emacs-orgmode, Michael Ekstrand


Hey, as long as we're shooting for the stars how about.  No, I don't
have the time to code it either...  But I like to dream!

  Saturday, October 18, 2008
  ==========================
               8:00
               9:00
              10:00
              11:00
    Work:     12:00 / Working at office
              13:00 |
    Work:     14:00 | / Meeting with client
              15:00 | \
              16:00 \
              17:00
    Church:     :30 / Saturday service
                :45 | < I give a sermon on org mode
              18:00 \
    master:   19:00 < People over for supper

-- 
"In the bathtub of history the truth is harder to hold than the soap,
 and much more difficult to find."  -- Terry Pratchett

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

* Re: Feature request: skip blocked lines in agenda view grid
  2008-10-18 14:59 Feature request: skip blocked lines in agenda view grid Michael Ekstrand
  2008-10-20 10:56 ` Carsten Dominik
  2008-10-20 13:37 ` Chris McMahan
@ 2008-10-21  2:24 ` Michael Ekstrand
  2008-10-21  6:31   ` Carsten Dominik
  2 siblings, 1 reply; 9+ messages in thread
From: Michael Ekstrand @ 2008-10-21  2:24 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 3371 bytes --]

Michael Ekstrand <michael@elehack.net> writes:
> I'd find it quite helpful in reviewing my agenda if there was an option
> to skip displaying grid lines which happen in the middle of timed
> appointments.  Right now, I see the following:
>
> Saturday   18 October 2008
>                8:00...... ----------------
>               10:00...... ----------------
>               12:00...... ----------------
>               14:00...... ----------------
>               16:00...... ----------------
>   Church:     17:30-19:00 Saturday service
>               18:00...... ----------------
>   master:     19:00...... People over for supper
>               20:00...... ----------------
>
> If it could optionally and intelligently drop the 18:00 grid line
> because there is a previous timed appointment overlapping it, the
> resulting display would show me more clearly that I don't have time
> between it and the next event.

After doing some poking around in the org-mode sources, I found out that
the particular behavior described above isn't overly difficult to
implement; in fact, half the work is already done (at least in the
org-mode in Emacs CVS).  The first element of the `org-agenda-time-grid'
variable (the time grid options) supports an undocumented option
`remove-match' which causes `org-agenda-add-time-grid-maybe' to remove
grid lines which exactly correspond to the start time of an event.  It
is rather trivial to extend this logic to also remove grid lines
occluded by the duration of an event.

I have implemented this as a defadvice for
`org-agenda-add-time-grid-maybe' (I like to implement my org-mode logic
changes as defadvice so that they work on top of pristine org-mode and I
don't have to keep patches in sync or installed).  Code follows, if
anyone wants to throw it in their .emacs:

(defadvice org-agenda-add-time-grid-maybe (around mde-org-agenda-grid-tweakify
                                                  (list ndays todayp))
  (if (member 'remove-match (car org-agenda-time-grid))
      (flet ((extract-window
              (line)
              (let ((start (get-text-property 1 'time-of-day line))
                    (dur (get-text-property 1 'duration line)))
                (cond
                 ((and start dur) (cons start dur))
                 (start start)
                 (t nil)))))
        (let* ((windows (delq nil (mapcar 'extract-window list)))
               (org-agenda-time-grid
                (list (car org-agenda-time-grid)
                      (cadr org-agenda-time-grid)
                      (remove-if
                       (lambda (time)
                         (find-if (lambda (w)
                                    (if (numberp w)
                                        (equal w time)
                                      (and (>= time (car w))
                                           (< time (+ (car w) (cdr w))))))
                                  windows))
                       (caddr org-agenda-time-grid)))))
          ad-do-it))
    ad-do-it))
(ad-activate 'org-agenda-add-time-grid-maybe)

- Michael

-- 
mouse, n: A device for pointing at the xterm in which you want to type.
Confused by the strange files?  I cryptographically sign my messages.
For more information see <http://www.elehack.net/resources/gpg>.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 196 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Feature request: skip blocked lines in agenda view grid
  2008-10-21  2:24 ` Michael Ekstrand
@ 2008-10-21  6:31   ` Carsten Dominik
  2008-10-21 13:21     ` Michael Ekstrand
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2008-10-21  6:31 UTC (permalink / raw)
  To: Michael Ekstrand; +Cc: emacs-orgmode

Hey Michael,

you have just catapulted yourself onto the list of possible successors  
when I will quit as maintainer of Org...  :-)

Good work - I don't think it works completely yet, though.

When I have

* new one
   <2008-10-21 Tue 08:01-11:55>

* new two
   <2008-10-21 Tue 13:59-14:55>

Then I get this agenda:

Day-agenda (W43):
Tuesday    21 October 2008
                8:00......  ----------------
   past:        8:01-11:55  new one
               11:00......  ----------------
               12:00......  ----------------
               13:00......  ----------------
   past:       13:59-14:55  new two
               15:00......  ----------------
               16:00......  ----------------
               17:00......  ----------------
               18:00......  ----------------
               20:00......  ----------------

The line at 11:00 should be gone as well.

- Carsten

On Oct 21, 2008, at 4:24 AM, Michael Ekstrand wrote:

> Michael Ekstrand <michael@elehack.net> writes:
>> I'd find it quite helpful in reviewing my agenda if there was an  
>> option
>> to skip displaying grid lines which happen in the middle of timed
>> appointments.  Right now, I see the following:
>>
>> Saturday   18 October 2008
>>               8:00...... ----------------
>>              10:00...... ----------------
>>              12:00...... ----------------
>>              14:00...... ----------------
>>              16:00...... ----------------
>>  Church:     17:30-19:00 Saturday service
>>              18:00...... ----------------
>>  master:     19:00...... People over for supper
>>              20:00...... ----------------
>>
>> If it could optionally and intelligently drop the 18:00 grid line
>> because there is a previous timed appointment overlapping it, the
>> resulting display would show me more clearly that I don't have time
>> between it and the next event.
>
> After doing some poking around in the org-mode sources, I found out  
> that
> the particular behavior described above isn't overly difficult to
> implement; in fact, half the work is already done (at least in the
> org-mode in Emacs CVS).  The first element of the `org-agenda-time- 
> grid'
> variable (the time grid options) supports an undocumented option
> `remove-match' which causes `org-agenda-add-time-grid-maybe' to remove
> grid lines which exactly correspond to the start time of an event.  It
> is rather trivial to extend this logic to also remove grid lines
> occluded by the duration of an event.
>
> I have implemented this as a defadvice for
> `org-agenda-add-time-grid-maybe' (I like to implement my org-mode  
> logic
> changes as defadvice so that they work on top of pristine org-mode  
> and I
> don't have to keep patches in sync or installed).  Code follows, if
> anyone wants to throw it in their .emacs:
>
> (defadvice org-agenda-add-time-grid-maybe (around mde-org-agenda- 
> grid-tweakify
>                                                  (list ndays todayp))
>  (if (member 'remove-match (car org-agenda-time-grid))
>      (flet ((extract-window
>              (line)
>              (let ((start (get-text-property 1 'time-of-day line))
>                    (dur (get-text-property 1 'duration line)))
>                (cond
>                 ((and start dur) (cons start dur))
>                 (start start)
>                 (t nil)))))
>        (let* ((windows (delq nil (mapcar 'extract-window list)))
>               (org-agenda-time-grid
>                (list (car org-agenda-time-grid)
>                      (cadr org-agenda-time-grid)
>                      (remove-if
>                       (lambda (time)
>                         (find-if (lambda (w)
>                                    (if (numberp w)
>                                        (equal w time)
>                                      (and (>= time (car w))
>                                           (< time (+ (car w) (cdr  
> w))))))
>                                  windows))
>                       (caddr org-agenda-time-grid)))))
>          ad-do-it))
>    ad-do-it))
> (ad-activate 'org-agenda-add-time-grid-maybe)
>
> - Michael
>
> -- 
> mouse, n: A device for pointing at the xterm in which you want to  
> type.
> Confused by the strange files?  I cryptographically sign my messages.
> For more information see <http://www.elehack.net/resources/gpg>.
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Feature request: skip blocked lines in agenda view grid
  2008-10-21  6:31   ` Carsten Dominik
@ 2008-10-21 13:21     ` Michael Ekstrand
  2008-10-21 21:43       ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Ekstrand @ 2008-10-21 13:21 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2887 bytes --]

Carsten Dominik <dominik@uva.nl> writes:
> you have just catapulted yourself onto the list of possible successors
> when I will quit as maintainer of Org...  :-)
>
> Good work - I don't think it works completely yet, though.

Thanks :)

> When I have
>
> * new one
>   <2008-10-21 Tue 08:01-11:55>
>
> * new two
>   <2008-10-21 Tue 13:59-14:55>
>
> Then I get this agenda:
>
> Day-agenda (W43):
> Tuesday    21 October 2008
>                8:00......  ----------------
>   past:        8:01-11:55  new one
>               11:00......  ----------------
>               12:00......  ----------------
>               13:00......  ----------------
>   past:       13:59-14:55  new two
>               15:00......  ----------------
>               16:00......  ----------------
>               17:00......  ----------------
>               18:00......  ----------------
>               20:00......  ----------------
>
> The line at 11:00 should be gone as well.

I think I've found the problem.  I was computing the end time by adding
minutes to start time, which doesn't quite work for obvious reasons.
I've fixed it in the following code.

(defadvice org-agenda-add-time-grid-maybe (around mde-org-agenda-grid-tweakify
                                                  (list ndays todayp))
  (if (member 'remove-match (car org-agenda-time-grid))
      (flet ((extract-window
              (line)
              (let ((start (get-text-property 1 'time-of-day line))
                    (dur (get-text-property 1 'duration line)))
                (cond
                 ((and start dur) (cons start dur))
                 (start start)
                 (t nil))))
             (duration-add
              (time duration)
              (+ time (* 100 (/ duration 60)) (% duration 60))))
        (let* ((windows (delq nil (mapcar 'extract-window list)))
               (org-agenda-time-grid
                (list (car org-agenda-time-grid)
                      (cadr org-agenda-time-grid)
                      (remove-if
                       (lambda (time)
                         (find-if (lambda (w)
                                    (if (numberp w)
                                        (equal w time)
                                      (and (>= time (car w))
                                           (< time (duration-add
                                                    (car w) (cdr w))))))
                                  windows))
                       (caddr org-agenda-time-grid)))))
          ad-do-it))
    ad-do-it))
(ad-activate 'org-agenda-add-time-grid-maybe)

- Michael

-- 
mouse, n: A device for pointing at the xterm in which you want to type.
Confused by the strange files?  I cryptographically sign my messages.
For more information see <http://www.elehack.net/resources/gpg>.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 196 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Feature request: skip blocked lines in agenda view grid
  2008-10-21 13:21     ` Michael Ekstrand
@ 2008-10-21 21:43       ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2008-10-21 21:43 UTC (permalink / raw)
  To: Michael Ekstrand; +Cc: emacs-orgmode

Hi Micheal,

this looks good, thanks.

I have added this code to Worg, and will consider to move it onto Org.

- Carsten

On Oct 21, 2008, at 3:21 PM, Michael Ekstrand wrote:

> Carsten Dominik <dominik@uva.nl> writes:
>> you have just catapulted yourself onto the list of possible  
>> successors
>> when I will quit as maintainer of Org...  :-)
>>
>> Good work - I don't think it works completely yet, though.
>
> Thanks :)
>
>> When I have
>>
>> * new one
>>  <2008-10-21 Tue 08:01-11:55>
>>
>> * new two
>>  <2008-10-21 Tue 13:59-14:55>
>>
>> Then I get this agenda:
>>
>> Day-agenda (W43):
>> Tuesday    21 October 2008
>>               8:00......  ----------------
>>  past:        8:01-11:55  new one
>>              11:00......  ----------------
>>              12:00......  ----------------
>>              13:00......  ----------------
>>  past:       13:59-14:55  new two
>>              15:00......  ----------------
>>              16:00......  ----------------
>>              17:00......  ----------------
>>              18:00......  ----------------
>>              20:00......  ----------------
>>
>> The line at 11:00 should be gone as well.
>
> I think I've found the problem.  I was computing the end time by  
> adding
> minutes to start time, which doesn't quite work for obvious reasons.
> I've fixed it in the following code.
>
> (defadvice org-agenda-add-time-grid-maybe (around mde-org-agenda- 
> grid-tweakify
>                                                  (list ndays todayp))
>  (if (member 'remove-match (car org-agenda-time-grid))
>      (flet ((extract-window
>              (line)
>              (let ((start (get-text-property 1 'time-of-day line))
>                    (dur (get-text-property 1 'duration line)))
>                (cond
>                 ((and start dur) (cons start dur))
>                 (start start)
>                 (t nil))))
>             (duration-add
>              (time duration)
>              (+ time (* 100 (/ duration 60)) (% duration 60))))
>        (let* ((windows (delq nil (mapcar 'extract-window list)))
>               (org-agenda-time-grid
>                (list (car org-agenda-time-grid)
>                      (cadr org-agenda-time-grid)
>                      (remove-if
>                       (lambda (time)
>                         (find-if (lambda (w)
>                                    (if (numberp w)
>                                        (equal w time)
>                                      (and (>= time (car w))
>                                           (< time (duration-add
>                                                    (car w) (cdr  
> w))))))
>                                  windows))
>                       (caddr org-agenda-time-grid)))))
>          ad-do-it))
>    ad-do-it))
> (ad-activate 'org-agenda-add-time-grid-maybe)
>
> - Michael
>
> -- 
> mouse, n: A device for pointing at the xterm in which you want to  
> type.
> Confused by the strange files?  I cryptographically sign my messages.
> For more information see <http://www.elehack.net/resources/gpg>.
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2008-10-21 21:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-18 14:59 Feature request: skip blocked lines in agenda view grid Michael Ekstrand
2008-10-20 10:56 ` Carsten Dominik
2008-10-20 13:37 ` Chris McMahan
2008-10-20 21:14   ` Wes Hardaker
2008-10-20 21:19   ` Wes Hardaker
2008-10-21  2:24 ` Michael Ekstrand
2008-10-21  6:31   ` Carsten Dominik
2008-10-21 13:21     ` Michael Ekstrand
2008-10-21 21:43       ` Carsten Dominik

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).