From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Help debugging a problem when saving org-agenda files with C-x s Date: Wed, 13 May 2009 08:12:12 +0200 Message-ID: <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 1M47hf-0000ir-8V for emacs-orgmode@gnu.org; Wed, 13 May 2009 02:12:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M47ha-0000if-FA for emacs-orgmode@gnu.org; Wed, 13 May 2009 02:12:30 -0400 Received: from [199.232.76.173] (port=35777 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M47ha-0000ic-BX for emacs-orgmode@gnu.org; Wed, 13 May 2009 02:12:26 -0400 Received: from mx20.gnu.org ([199.232.41.8]:15535) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M47hZ-00068B-Vt for emacs-orgmode@gnu.org; Wed, 13 May 2009 02:12:26 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M47hX-00073y-LV for emacs-orgmode@gnu.org; Wed, 13 May 2009 02:12:24 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1M47hW-0006mM-Qz for emacs-orgmode@gnu.org; Wed, 13 May 2009 06:12:22 +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 06:12:22 +0000 Received: from tassilo by dhcp42.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 May 2009 06:12:22 +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 Hi all, I use an own function to save the current agenta to a text file, which I display in a tooltip on my desktop: --8<---------------cut here---------------start------------->8--- (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)))))) --8<---------------cut here---------------end--------------->8--- 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: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "Agenda file /home/horn/repos/org/uni.org is not in `org-mode'") signal(error ("Agenda file /home/horn/repos/org/uni.org is not in `org-mode'")) error("Agenda file %s is not in `org-mode'" "/home/horn/repos/org/uni.org") org-agenda-get-day-entries("/home/horn/repos/org/uni.org" (5 11 2009) :deadline :scheduled :sexp :timestamp) byte-code("...") org-agenda-list() (let ((file "/tmp/org-agenda.txt")) (org-agenda-list) (org-write-agenda file)) (save-window-excursion (let (...) (org-agenda-list) (org-write-agenda file))) (save-excursion (save-window-excursion (let ... ... ...))) (progn (save-excursion (save-window-excursion ...))) (if (and (eq major-mode ...) (member buffer-file-name org-agenda-files)) (progn (save-excursion ...))) (when (and (eq major-mode ...) (member buffer-file-name org-agenda-files)) (save-excursion (save-window-excursion ...))) th-org-update-agenda-file() run-hooks(after-save-hook) basic-save-buffer() save-buffer() #[(buffer) "rq. )" [buffer save-buffer] 1](#) map-y-or-n-p(#[(buffer) ".!V.!..."]) byte-code("...") save-some-buffers(nil) call-interactively(save-some-buffers nil nil) --8<---------------cut here---------------end--------------->8--- I'm not sure what's the problem here. /home/horn/repos/org/uni.org is surely in org-mode! Any help on that? Bye, Tassilo