emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Nautical Agenda
@ 2012-04-30 10:21 Martyn Jago
  0 siblings, 0 replies; only message in thread
From: Martyn Jago @ 2012-04-30 10:21 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]


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

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

2) Download xtide.el

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

  (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."
  (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)))


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

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 #2: Screen Shot --]
[-- Type: image/png, Size: 144938 bytes --]

[-- Attachment #3: Type: text/plain, Size: 502 bytes --]

Best, Martyn

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-30 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30 10:21 Nautical Agenda Martyn Jago

Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).