emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Nautical Agenda


From: Martyn Jago
Subject: [O] Nautical Agenda
Date: Mon, 30 Apr 2012 11:21:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (darwin)

Disclaimer: NOT FOR NAVIGATION!

Recently I discovered that the agenda was capable of displaying
time-related events such as sunrise-sunset, phases of the moon, holidays
etc. 

As a keen Windsurfer I started to wonder whether I could display tidal
times based on agenda dates.

Thanks to Kevin Ryde, the author of xtide.el the answer is yes - and not
just a text list, a nice graphical representation (see screen-shot
below). However your personal location may be a hurdle [1].

The procedure was as follows:

1) Download and install xtide
http://www.flaterco.com/xtide/installation.html

2) Download xtide.el
http://user42.tuxfamily.org/xtide/index.html

3) Find a suitable tcd data file (see [1]) and place in
/opt/local/share/xtide/harmonics/ (or relevant to your setup)

4) Add something approaching the following to your .emacs:

#+begin_src emacs-lisp :results silent

(add-to-list
 'load-path
  (concat dotfiles-dir "xtide"))
(autoload 'xtide "xtide" nil t)
(autoload 'xtide-calendar-setups "xtide")
(add-hook 'calendar-load-hook 'xtide-calendar-setups)
(define-key calendar-mode-map "~" 'xtide-calendar-tides)
(org-defkey org-agenda-mode-map "~" 'org-agenda-display-tides)

(setq xtide-location "Bournemouth, England")

(defun org-agenda-display-tides ()
  "Draw XTides buffer with date from agenda."
  (interactive)
  (org-agenda-check-type t 'agenda 'timeline)
  (let* ((day (or (get-text-property (point) 'day)
                  (error "Don't know which date to open in calendar/agenda")))
         (date (calendar-gregorian-from-absolute day)))
    (set (make-local-variable 'xtide-time)
         (encode-time 0 30 2
                      (cadr date) (car date) (nth 2 date)))
    (xtide)
    (xtide-zoom-in-horizontal)))

#+end_src

4) I found I needed to comment out line 1271 of xtide.el to make this work

- (kill-all-local-variables)
+ ;; (kill-all-local-variables)

And that should be it. The `~" (tilda) key (chosen to look somewhat like
a wave!) will now work from your daily / weekly agenda, and also from
calendar.

Once the tide chart opens up in Emacs you may navigate forward and
backward in time with the arrow keys, zoom in / out, and do lots of
other things thanks to xtide.el. `q' closes the tide chart.

This is a screen-shot from my system:

Attachment: Screen shot 2012-04-30 at 10.00.22.png
Description: Screen Shot

Best, Martyn
 
bookmarks:

1) To use xtide at your location you need to obtain a harmonic constant
table (tcd extension) for your area. If you live in North America you
are in luck. Things further afield are no longer so easy (an example
where free data has unfortunately become non-free data). Further info
here: http://www.flaterco.com/xtide/harmonics.html

Note: I successfully managed to find data for England on Debians server,
named harmonics-dwf-20100529-nonfree.tcd which is suitable for me.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]