Timothy Hobbs <[EMAIL PROTECTED]> writes:

> Right now, I am happy with planner-tasks-overview, though it is a bit slow on 
> my
> system(an XO), aprox 1.7 seconds.  I have written a little script to cycle 
> through
> different task views:
> It cycles between a plain day page,
> a day page under an insinuated calendar,
> a weekly overview,
> and a monthly one.
> See attached.
>
> In case you where wondering if I was funny in the head, I'm not actually
> pressing C-f8 to do this cycling, I have it bound to the enter key which is
> rather big and out of the way on the XO.
>
> Timothy

Hello, for cycling between day pages, the best is planner-zoom.
It is a little tricky to use at first because we wait for populated pages
and it's not the purpose of this package (look in planner mailing-lists 
archives,
you will find how to use it).

To cycle with the calendar, your code is not needed, you just have to:

(planner-insinuate-calendar)

Open calendar and move in your planner pages.

But moving in planner-tasks-overview is a good idea,
i write a code , that provide a planner-tasks-overview in n days,
where n is positive or negative.
You can write in a planner-page:
[[lisp:planner-tasks-overview-n-days][Tasks-overview]]
to be linked to this function.
Thats save a keybinding.
To have it always in your day pages you can store it with

http://www.emacswiki.org/cgi-bin/emacs/planner-favoris.el

Three functions are needed, they are here:
i reuse your code: thank you ;)
(substring (int-to-string (/ (float month) 100)) 2)

--8<---------------cut here---------------start------------->8---
;; Cycling in planner-tasks-overview
(defun planner-tasks-overview-n-days (nbrdays)
  "The two functions |tv-cur-date-string
                     |tv-time-date-in-n-days
are needed, they are in macros-func-thierry.el"
  (interactive "nNbrDays: ")
  (if (> nbrdays 0)
      (planner-tasks-overview (tv-cur-date-string)
                              (tv-time-date-in-n-days nbrdays))
    (planner-tasks-overview (tv-time-date-in-n-days nbrdays)
                            (tv-cur-date-string))))

;; Cycling in planner-tasks-overview
(defun planner-tasks-overview-n-days (nbrdays)
  "The two functions |tv-cur-date-string
                     |tv-time-date-in-n-days
are needed, they are in macros-func-thierry.el"
  (interactive "nNbrDays: ")
  (if (> nbrdays 0)
      (planner-tasks-overview (tv-cur-date-string)
                              (tv-time-date-in-n-days nbrdays))
    (planner-tasks-overview (tv-time-date-in-n-days nbrdays)
                            (tv-cur-date-string))))

(defun tv-time-date-in-n-days (days)
  "Return the date in string form in n +/-days"
  (let* ((days-in-sec (* 3600 (* (+ days) 24)))
         (interval-days-sec (if `(< ,days 0)
                                (+ (float-time (current-time)) days-in-sec)
                              (- (float-time (current-time)) days-in-sec)))
         (sec-to-time (seconds-to-time interval-days-sec))
         (time-dec (decode-time sec-to-time))
         (new-date ""))
    (setq new-date (concat
                    (int-to-string (nth 5 time-dec))
                    "."
                    (substring (int-to-string (/ (float (nth 4 time-dec)) 100)) 
2)
                    "."
                    (substring (int-to-string (/ (float (nth 3 time-dec)) 100)) 
2)))
    new-date))

(defun tv-cur-date-string ()
  "Return current date under string form ==>2008.03.16"
  (interactive)
  (let ((year (nth 5 (decode-time (current-time))))
        (month (nth 4 (decode-time (current-time))))
        (day (nth 3 (decode-time (current-time))))
        (str-day-date ""))
    (setq str-day-date
          (concat (int-to-string year)
                  "."
                  (substring (int-to-string (/ (float month) 100)) 2)
                  "."
                  (substring (int-to-string (/ (float day) 100)) 2)))
    str-day-date))
--8<---------------cut here---------------end--------------->8---

-- 
A + Thierry
Pub key: http://pgp.mit.edu

_______________________________________________
Planner-el-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/planner-el-discuss

Reply via email to