[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Help debugging a problem when saving org-agenda files with
From: |
Tassilo Horn |
Subject: |
[Orgmode] Re: Help debugging a problem when saving org-agenda files with C-x s |
Date: |
Wed, 13 May 2009 10:55:59 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) |
Tassilo Horn <address@hidden> writes:
> I use an own function to save the current agenta to a text file, which
> I display in a tooltip on my desktop:
>
> (defun th-org-mode-init ()
> (add-hook 'after-save-hook 'th-org-update-agenda-file t t))
>
> (add-hook 'org-mode-hook 'th-org-mode-init)
>
> ;; TODO: This errors when calling C-x s after modifying things in the agenda.
> (defun th-org-update-agenda-file (&optional force)
> (interactive)
> (when (and (eq major-mode 'org-mode)
> (member buffer-file-name org-agenda-files))
> (save-excursion
> (save-window-excursion
> (let ((file "/tmp/org-agenda.txt"))
> (org-agenda-list)
> (org-write-agenda file))))))
>
> This works fine when I save an agenda file while in its buffer, but
> when I edit the file via agenda commands and hit `C-x s', I'm asked if
> I want to save "/home/horn/repos/org/uni.org" and say yes, I get this
> error:
Just a short addition: If I answer yes and get this error, the buffer
contents (and file contents) of uni.org are "Week-agenda (W20):\n".
Thanks I have all my agenda files in git and commit regularly!
Bye,
Tassilo