From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Re: Help debugging a problem when saving org-agenda files with C-x s Date: Wed, 13 May 2009 10:55:59 +0200 Message-ID: <87my9h5qlc.fsf@thinkpad.tsdh.de> References: <87d4ad8rb7.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M4AGA-0000DO-Lf for emacs-orgmode@gnu.org; Wed, 13 May 2009 04:56:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M4AG6-0000Aa-9C for emacs-orgmode@gnu.org; Wed, 13 May 2009 04:56:18 -0400 Received: from [199.232.76.173] (port=45557 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4AG6-0000AT-3E for emacs-orgmode@gnu.org; Wed, 13 May 2009 04:56:14 -0400 Received: from main.gmane.org ([80.91.229.2]:55002 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M4AG4-0000d2-Ow for emacs-orgmode@gnu.org; Wed, 13 May 2009 04:56:13 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1M4AG2-0005OI-3S for emacs-orgmode@gnu.org; Wed, 13 May 2009 08:56:10 +0000 Received: from dhcp42.uni-koblenz.de ([141.26.71.42]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 May 2009 08:56:10 +0000 Received: from tassilo by dhcp42.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 May 2009 08:56:10 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Tassilo Horn 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