Re: [Orgmode] jump to iso-week in agenda
On Mar 15, 2008, at 5:00 PM, Thomas Baumann wrote: Hi, I really like the most advanced (pure magic working ...) and easy way of entering dates in org mode. When answering a phone call it's only a few keystrokes to jump to the date and settle the appointment. However there are some people thinking in weeks (iso-week). So when those friends call it get's much more complicated. Currently when I would like to jump to say week 46, I might find an old paper calendar or M-x calendar-goto-iso-week. 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. (b) include magic jump to a certain week eg. *46 to jump to week 46 I have just pushed the necessary changes into the git repo. Here is the user interface: Suport for ISO week dates (ISO 8601) Dates in the agenda now show the ISO week and day specification, in the form `W08 2', meaning Tuesday of week 2. The keys `d', `w', `m', and `y' in the agenda view now accept prefix arguments. Remember that in the agenda, you can directly type a prefix argument by typing a number, no need to press `C-u' first. The prefix argument may be used to jump directly to a specific day of the year, ISO week, month, or year, respectively. For example, `32 d' jumps to February 1st, `9 w' to ISO week number 9. When setting day, week, or month view, a year may be encoded in the prefix argument as well. For example, `200712 w' will jump to week 12 in 2007. If such a year specification has only one or two digits, it will be mapped to the interval 1938-2037. When entering a date at the date prompt, you may now also specify an ISO week. For example w4 Monday of week 4 fri w4 Friday of week 4 w4-5Same as above 2012 w4 fri Friday of week 4 in 2012. 2012-W04-5 Same as above So far I have not activated the effect of `org-read-date-prefer-future' on this functionality, because it seemed too unpredictable for me (as I usually do not know which week I am in). I'd appreciate comments on this issue: Should `org-read-date-prefer-future' also push dates into the next year if the week you are entering has already passed in the current year? For consistency I guess this should be the case, but I cannot quite wrap my head around it. I hope but am not entirely convinced that this will behave sanely also during the first/last week of a year. Please test extensively and report back. Enjoy! - Carsten ___ 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
Re: [Orgmode] jump to iso-week in agenda
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 Freitag7 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 ___ 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
Re: [Orgmode] jump to iso-week in agenda
Hi Thomas, On Mar 20, 2008, at 9:55 AM, Thomas Baumann wrote: 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. Performance is not an issue, certainly not in comparison with the other stuff that is going on to compute the agenda. Yes, it is a bit crowded. I'll try to shift this to the heading. The alternative would be to list the week number only on Mondays. BTW:(format %-9s %2d %s %4d %s dayname day monthname year weekstring))) doesn't work as expected for German locale In what way does it not work? I have just pushed the necessary changes into the git repo. Here is the user interface: There seem's to be a problem with '.': Fixed, thanks. 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. I think I have fixed this as well, please try again. Thanks for the quick feedback. - Carsten ___ 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
Re: [Orgmode] jump to iso-week in agenda
Hi Carsten, the view is much clearer now, thanks. Personally, I don't need the Week on Mondays but this is a matter of taste (or customize). Performance is not an issue, certainly not in comparison with the other stuff that is going on to compute the agenda. Yes, I already moved most old stuff to archives which are included only on my desktop. BTW:(format %-9s %2d %s %4d %s dayname day monthname year weekstring))) doesn't work as expected for German locale In what way does it not work? just an cosmetic issue, Donnerstag has 10 letters and does not fit into %-9s. Ciao Thomas ___ 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
Re: [Orgmode] jump to iso-week in agenda
On Mar 20, 2008, at 11:36 AM, Thomas Baumann wrote: Hi Carsten, the view is much clearer now, thanks. Personally, I don't need the Week on Mondays but this is a matter of taste (or customize). Performance is not an issue, certainly not in comparison with the other stuff that is going on to compute the agenda. Yes, I already moved most old stuff to archives which are included only on my desktop. BTW:(format %-9s %2d %s %4d %s dayname day monthname year weekstring))) doesn't work as expected for German locale In what way does it not work? just an cosmetic issue, Donnerstag has 10 letters and does not fit into %-9s. Ah. Hm. I hate locale stuf :-) - Carsten ___ 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
Re: [Orgmode] jump to iso-week in agenda
OK, I will put that in. - Carsten On Mar 15, 2008, at 5:00 PM, Thomas Baumann wrote: Hi, I really like the most advanced (pure magic working ...) and easy way of entering dates in org mode. When answering a phone call it's only a few keystrokes to jump to the date and settle the appointment. However there are some people thinking in weeks (iso-week). So when those friends call it get's much more complicated. Currently when I would like to jump to say week 46, I might find an old paper calendar or M-x calendar-goto-iso-week. How difficult would it be to (a) add the current iso-week into the headline of the Week-View (b) include magic jump to a certain week eg. *46 to jump to week 46 Thomas ___ 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 ___ 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
[Orgmode] jump to iso-week in agenda
Hi, I really like the most advanced (pure magic working ...) and easy way of entering dates in org mode. When answering a phone call it's only a few keystrokes to jump to the date and settle the appointment. However there are some people thinking in weeks (iso-week). So when those friends call it get's much more complicated. Currently when I would like to jump to say week 46, I might find an old paper calendar or M-x calendar-goto-iso-week. How difficult would it be to (a) add the current iso-week into the headline of the Week-View (b) include magic jump to a certain week eg. *46 to jump to week 46 Thomas ___ 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