From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Baumann Subject: Re: jump to iso-week in agenda Date: Thu, 20 Mar 2008 09:55:42 +0100 Message-ID: <26699.1206003342@norvel.baumann-gauting.site> References: Reply-To: dtbaumann@yahoo.de Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JcGYv-0001nV-J4 for emacs-orgmode@gnu.org; Thu, 20 Mar 2008 04:55:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JcGYt-0001m5-VI for emacs-orgmode@gnu.org; Thu, 20 Mar 2008 04:55:48 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JcGYt-0001lp-Nq for emacs-orgmode@gnu.org; Thu, 20 Mar 2008 04:55:47 -0400 Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JcGYs-0006Xp-Qb for emacs-orgmode@gnu.org; Thu, 20 Mar 2008 04:55:47 -0400 In-reply-to: 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: Carsten Dominik Cc: Thomas Baumann , emacs-orgmode@gnu.org Hi Carsten, thanks you so much for adding the week features, which sometimes are necessary even inside universities :-) > > How difficult would it be to > > (a) add the current iso-week into the headline of the Week-View > > That does not work, because the week view may or may not start > on a Monday, so it may contain days from two different weeks. > For now I am adding the ISO week number to every date in the > agenda, if this seems too cluttered we need to think of a > different solution. Hmmh, the view get a little busy, and I don't know about performance issues when iso weekdays are calculated for each day (speed is an issue on my N810). There's a lot of redundant information now. Donnerstag 6 Dezember 2007 W49 4 Freitag 7 Dezember 2007 W49 5 BTW: (format "%-9s %2d %s %4d %s" dayname day monthname year weekstring))) doesn't work as expected for German locale What about Week-agenda (W01-02): if the view does not start on weekday one. Similarly the day/month view could show: Day-Agenda (W01): Month-agenda (W01-05): I don't think we need weeks for the year view :-) > I have just pushed the necessary changes into the git repo. Here is the > user interface: > There seem's to be a problem with '.': Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (sd span n) "Compute starting date and number of days for agenda. SPAN may be `day', `week', `month', `year'. The return value is a cons cell with the starting date and the number of days, so that the date SD will be in that range." (let* ((greg (calendar-gregorian-from-absolute sd)) (dg (nth 1 greg)) (mg (car greg)) (yg (nth 2 greg)) nd w1 y1 m1 thisweek) (cond ((eq span (quote day)) (when n (setq sd (+ (calendar-absolute-from-gregorian (list mg 1 yg)) n -1))) (setq nd 1)) ((eq span (quote week)) (let* ((nt (calendar-day-of-week (calendar-gregorian-from-absolute sd))) (d (if org-agenda-start-on-weekday (- nt org-agenda-start-on-weekday) 0))) (setq sd (- sd (+ (if (< d 0) 7 0) d))) (when n (require (quote cal-iso)) (setq thisweek (car (calendar-iso-from-absolute sd))) (when (> n 99) (setq y1 (org-small-year-to-year (/ n 100)) n (mod n 100))) (setq sd (calendar-absolute-from-iso (list n 1 (or y1 (nth 2 (calendar-iso-from-absolute sd))))))) (setq nd 7))) ((eq span (quote month )) (when (and n (> n 99)) (setq y1 (org-small-year-to-year (/ n 100)) n (mod n 100))) (setq sd (calendar-absolute-from-gregorian (list (or n mg) 1 (or y1 yg))) nd (- (calendar-absolute-from- gregorian (list (1+ (or n mg)) 1 (or y1 yg))) sd))) ((eq span (quote year)) (setq sd (calendar-absolute-from-gregorian (list 1 1 (or n yg))) nd (- (calendar-absolute-from-gregorian (list 1 1 (1+ (or n yg)))) sd)))) (cons sd nd))) 2) org-agenda-compute-time-span(733121 day) (let* ((sd ...) (comp ...) (org-agenda-overriding-arguments org-agenda-last-arguments)) (setf (nth 1 org-agenda-overriding-arguments) (car comp)) (setf (nth 2 org-agenda-overriding-arguments) (cdr comp)) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda)) (cond (tdpos (goto-char tdpos)) ((eq org-agenda-type ...) (let* ... ... ... ... ...)) (t (error "Cannot find today"))) (let ((tdpos ...)) (cond (tdpos ...) (... ...) (t ...))) org-agenda-goto-today() call-interactively(org-agenda-goto-today nil nil) And there's a general problem with emacs23 (which seems to be rather unstable at the moment): Due to some changes in calendar, calendar-absolute-from-iso is _not_ autoloaded. (require 'cal-iso) does the trick. > Enjoy! Definitely, thanks again Thomas