From: Carsten Dominik <dominik@science.uva.nl>
To: Michael Ekstrand <michael@elehack.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Feature request: skip blocked lines in agenda view grid
Date: Tue, 21 Oct 2008 23:43:28 +0200 [thread overview]
Message-ID: <655E2456-CC29-424E-87CE-20BB4593A3C3@uva.nl> (raw)
In-Reply-To: <87od1exevv.fsf@elehack.net>
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
prev parent reply other threads:[~2008-10-21 21:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=655E2456-CC29-424E-87CE-20BB4593A3C3@uva.nl \
--to=dominik@science.uva.nl \
--cc=emacs-orgmode@gnu.org \
--cc=michael@elehack.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.