From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ekstrand Subject: Re: Feature request: skip blocked lines in agenda view grid Date: Tue, 21 Oct 2008 08:21:40 -0500 Message-ID: <87od1exevv.fsf@elehack.net> References: <873aiuosow.fsf@elehack.net> <87wsg2y9an.fsf@elehack.net> <37C80D01-A50E-4D29-898F-1F2B3E4E50C8@uva.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0210168553==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KsHmk-0008Eq-Av for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 10:00:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KsHme-0008CV-0V for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 10:00:33 -0400 Received: from [199.232.76.173] (port=41864 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsHmd-0008CN-IR for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 10:00:27 -0400 Received: from main.gmane.org ([80.91.229.2]:39630 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KsHmb-0005Jk-Hq for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 10:00:27 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KsHmT-0004EH-ST for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 14:00:18 +0000 Received: from elehack.net ([216.243.177.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Oct 2008 14:00:17 +0000 Received: from michael by elehack.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Oct 2008 14:00:17 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0210168553== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable Carsten Dominik 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-tweak= ify (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 (>=3D 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) =2D Michael =2D-=20 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 . --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkj912UACgkQJMBfXHjb5YXkcQCfQcADGe+FRkQodJa85req7ysm pWQAn3PKtOyEsSkl1rz91gGCovxKzSKG =9Fo8 -----END PGP SIGNATURE----- --=-=-=-- --===============0210168553== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0210168553==--