emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martyn Jago <martyn.jago@btinternet.com>
To: emacs-orgmode@gnu.org
Subject: Nautical Agenda
Date: Mon, 30 Apr 2012 11:21:59 +0100	[thread overview]
Message-ID: <m262chikoo.fsf@btinternet.com> (raw)

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

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

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


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	other threads:[~2012-04-30 10:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m262chikoo.fsf@btinternet.com \
    --to=martyn.jago@btinternet.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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