[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] viewing appointments
From: |
Phillip Lord |
Subject: |
[emacs-wiki-discuss] viewing appointments |
Date: |
Wed, 07 Jun 2006 15:28:39 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
Dear all
This is a bit of an egregious hack that I knocked up at the
weekend. I've never been satisfied with planners appointment
views...the problem has been that you only get to see what you are
doing today, rather than the result of the week coming up. This is
fine until you find out at the beginning of the day that you are
supposed to be at a meeting in Manchester and you are in Newcastle.
This should help a bit. It's very poor code at the moment. To work
well, it needs fiddling with stuff in planner-appt. Anyway, just
wondered whether anyone else fancied this kind of view.
Cheers
Phil
(add-hook 'calendar-move-hook
'phil-planner-calendar-lazy-display)
(defvar phil-planner-calendar-display-timer nil)
(defvar phil-planner-calendar-frame nil)
(defun phil-planner-calendar ()
(interactive)
(unless (and phil-planner-calendar-frame
(frame-live-p phil-planner-calendar-frame))
(setq phil-planner-calendar-frame (make-frame))
(modify-frame-parameters phil-planner-calendar-frame
(list (cons 'name
(concat "calendar@" system-name)))))
(select-frame-set-input-focus phil-planner-calendar-frame)
(phil-planner-calendar-forthcoming-day-display))
(defun phil-planner-calendar-lazy-display()
(interactive)
(unless phil-planner-calendar-display-timer
(setq
phil-planner-calendar-display-timer
(run-with-idle-timer
0.3 nil 'phil-planner-calendar-timer))))
(defun phil-planner-calendar-timer()
(interactive)
(setq phil-planner-calendar-display-timer nil)
(when (and (equal calendar-buffer
(buffer-name (current-buffer)))
(equal (selected-frame) phil-planner-calendar-frame))
(phil-planner-calendar-forthcoming-day-display)))
(defun phil-planner-calendar-forthcoming-day-display()
(interactive)
(when (not calendar-buffer)
(calendar))
(switch-to-buffer calendar-buffer)
;; forthcoming-diplay only works from today, but timewarp fiddles this!
(planner-timewarp (planner-date-to-filename (calendar-cursor-to-date)))
(planner-appt-forthcoming-display 7)
(planner-timewarp nil)
(message nil)
(let* ((planner-use-other-window t)
(date (planner-date-to-filename (calendar-cursor-to-date)))
(planner-page-p
(planner-goto date planner-show-only-existing))
(planner-page))
(when planner-page-p
(add-to-list 'planner-calendar-buffer-list (current-buffer))
(setq planner-page (current-buffer)))
;; I don't know how to do window configurations well, so this is
;; very procedural.
;; calendar on top
(switch-to-buffer calendar-buffer)
(delete-other-windows)
(split-window)
;; forthcoming display
(other-window 1)
(switch-to-buffer planner-appt-forthcoming-display-buffer)
(goto-char 0)
;; do we have a planner page.
(when planner-page-p
(split-window)
(other-window 1)
;; planner pages
(switch-to-buffer planner-page))
(shrink-window-if-larger-than-buffer
(get-buffer-window calendar-buffer))
(shrink-window-if-larger-than-buffer
(get-buffer-window planner-appt-forthcoming-display-buffer))
(select-window
(get-buffer-window calendar-buffer))))
- [emacs-wiki-discuss] viewing appointments,
Phillip Lord <=