From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Help debugging a problem when saving org-agenda files with C-x s
Date: Wed, 13 May 2009 08:12:12 +0200 [thread overview]
Message-ID: <87d4ad8rb7.fsf@thinkpad.tsdh.de> (raw)
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](#<buffer uni.org>)
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
next reply other threads:[~2009-05-13 6:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 6:12 Tassilo Horn [this message]
2009-05-13 8:55 ` Help debugging a problem when saving org-agenda files with C-x s Tassilo Horn
2009-05-14 14:17 ` Carsten Dominik
2009-05-14 16:43 ` Tassilo Horn
2009-05-14 17:28 ` Carsten Dominik
2009-05-14 18:41 ` Tassilo Horn
2009-05-16 15:14 ` Carsten Dominik
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d4ad8rb7.fsf@thinkpad.tsdh.de \
--to=tassilo@member.fsf.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.