From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Feature request: skip blocked lines in agenda view grid Date: Tue, 21 Oct 2008 23:43:28 +0200 Message-ID: <655E2456-CC29-424E-87CE-20BB4593A3C3@uva.nl> References: <873aiuosow.fsf@elehack.net> <87wsg2y9an.fsf@elehack.net> <37C80D01-A50E-4D29-898F-1F2B3E4E50C8@uva.nl> <87od1exevv.fsf@elehack.net> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KsP12-0000kd-15 for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 17:43:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KsP10-0000hw-5k for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 17:43:47 -0400 Received: from [199.232.76.173] (port=40239 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsP0z-0000ha-Sh for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 17:43:45 -0400 Received: from mx20.gnu.org ([199.232.41.8]:53529) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KsP0z-00012O-25 for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 17:43:45 -0400 Received: from ey-out-1920.google.com ([74.125.78.147]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KsP0x-0003CA-1z for emacs-orgmode@gnu.org; Tue, 21 Oct 2008 17:43:43 -0400 Received: by ey-out-1920.google.com with SMTP id 4so842160eyg.24 for ; Tue, 21 Oct 2008 14:43:31 -0700 (PDT) In-Reply-To: <87od1exevv.fsf@elehack.net> 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: Michael Ekstrand Cc: emacs-orgmode@gnu.org 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 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 . > _______________________________________________ > 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