From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Genovese Subject: org-write-agenda failure Date: Thu, 6 Jan 2011 23:24:37 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0499150132==" Return-path: Received: from [140.186.70.92] (port=40356 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pb3sX-00048g-QM for emacs-orgmode@gnu.org; Thu, 06 Jan 2011 23:24:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pb3sW-0002mH-6O for emacs-orgmode@gnu.org; Thu, 06 Jan 2011 23:24:41 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]:52035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pb3sV-0002m5-Qr for emacs-orgmode@gnu.org; Thu, 06 Jan 2011 23:24:40 -0500 Received: by bwz16 with SMTP id 16so19635298bwz.0 for ; Thu, 06 Jan 2011 20:24:38 -0800 (PST) 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 --===============0499150132== Content-Type: multipart/alternative; boundary=001485f46e5a01bd15049939ff25 --001485f46e5a01bd15049939ff25 Content-Type: text/plain; charset=ISO-8859-1 On Mac OS X 10.5.8, GNU Emacs 23.2.1, Org Mode 7.4, setting the following: (setq org-todo-keywords '((sequence "TODO" "WAIT" "DONE"))) (setq org-todo-keyword-faces '(("WAIT" . "lightgoldenrod2"))) has the intended effect, with WAIT items properly displayed, ... *until* I do org-write-agenda in the Agenda buffer (writing to "foobar.pdf"), which fails in ps-print with the stack trace shown below. (The failure is not dependent on the color chosen in the string.) Note, however, that when doing the following instead everything works: (setq org-todo-keywords '((sequence "TODO" "WAIT" "DONE"))) (copy-face 'org-todo 'org-wait-face) ; bug with string when doing org-write-agenda (set-face-foreground 'org-wait-face "lightgoldenrod2") (setq org-todo-keyword-faces '(("WAIT" . org-wait-face))) In the former case (which fails), the problem appears in the call (ps-face-attribute-list '(:inherit org-todo :foreground "lightgoldenrod2")) but if the property list is itself wrapped in a list as (ps-face-attribute-list '((:inherit org-todo :foreground "lightgoldenrod2"))) then this function does not raise an error. This seems like a bug to me, as I'm pretty sure I'm matching the documented form required for org-todo-keyword-faces (in both cases), but I could be wrong. I have not had a chance to track this down all the way, but I thought I'd pass it on in hopes it is either helpful or will help someone show me the error of my ways. Thanks for your help. The backtrace for the original problem is given below. Debugger entered--Lisp error: (wrong-type-argument listp "lightgoldenrod2") ps-face-attributes("lightgoldenrod2") ps-face-attribute-list((:inherit org-todo :foreground "lightgoldenrod2")) ps-plot-with-face(662 666 (:inherit org-todo :foreground "lightgoldenrod2")) ps-generate-postscript-with-faces1(1 1549) ps-generate-postscript-with-faces(1 1549) ps-generate(# 1 1549 ps-generate-postscript-with-faces) ps-spool-with-faces(1 1549 nil) ps-print-with-faces(1 1549 "~/foobar.ps") ps-print-buffer-with-faces("~/foobar.ps") (cond ((org-bound-and-true-p org-mobile-creating-agendas) (org-mobile-write-agenda-for-mobile file)) ((string-match "\\.html?\\'" file) (require ...) (set-buffer ...) (when ... ... ... ...) (write-file file) (kill-buffer ...) (message "HTML written to %s" file)) ((string-match "\\.ps\\'" file) (require ...) (ps-print-buffer-with-faces file) (message "Postscript written to %s" file)) ((string-match "\\.pdf\\'" file) (require ...) (ps-print-buffer-with-faces ...) (call-process "ps2pdf" nil nil nil ... ...) (delete-file ...) (message "PDF written to %s" file)) ((string-match "\\.ics\\'" file) (require ...) (let ... ...)) (t (let ... ... ... ... ... ... ...))) (progn (rename-buffer "Agenda View" t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text (quote org-filtered)) (while (setq beg ...) (delete-region beg ...)) (run-hooks (quote org-agenda-before-write-hook)) (cond (... ...) (... ... ... ... ... ... ...) (... ... ... ...) (... ... ... ... ... ...) (... ... ...) (t ...))) (unwind-protect (progn (rename-buffer "Agenda View" t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text ...) (while ... ...) (run-hooks ...) (cond ... ... ... ... ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ... ... ... ... ...) (and ... ...))) (with-current-buffer temp-buffer (unwind-protect (progn ... ... ... ... ... ... ...) (and ... ...))) (let ((temp-buffer ...)) (with-current-buffer temp-buffer (unwind-protect ... ...))) (with-temp-buffer (rename-buffer "Agenda View" t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text (quote org-filtered)) (while (setq beg ...) (delete-region beg ...)) (run-hooks (quote org-agenda-before-write-hook)) (cond (... ...) (... ... ... ... ... ... ...) (... ... ... ...) (... ... ... ... ... ...) (... ... ...) (t ...))) (let ((bs ...) beg) (org-agenda-unmark-filtered-text) (with-temp-buffer (rename-buffer "Agenda View" t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text ...) (while ... ...) (run-hooks ...) (cond ... ... ... ... ... ...))) (save-window-excursion (org-agenda-mark-filtered-text) (let (... beg) (org-agenda-unmark-filtered-text) (with-temp-buffer ... ... ... ... ... ... ...))) (save-excursion (save-window-excursion (org-agenda-mark-filtered-text) (let ... ... ...))) (let nil (save-excursion (save-window-excursion ... ...)) #) eval((let nil (save-excursion (save-window-excursion ... ...)) #)) org-let(nil (save-excursion (save-window-excursion (org-agenda-mark-filtered-text) (let ... ... ...))) #) org-write-agenda("~/foobar.pdf") --001485f46e5a01bd15049939ff25 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mac OS X 10.5.8, GNU Emacs 23.2.1, Org Mode 7.4,
setting the followin= g:

(setq org-todo-keywords
=A0=A0=A0=A0=A0=A0=A0 '((sequence = "TODO" "WAIT" "DONE")))
(setq org-todo-key= word-faces '(("WAIT" . "lightgoldenrod2")))

has the intended effect, with WAIT items properly displayed, ... *until= *
I do org-write-agenda in the Agenda buffer (writing to "foobar.pd= f"),
which fails in ps-print with the stack trace shown below.
(The failure is not dependent on the color chosen in the string.)

No= te, however, that when doing the following instead
everything works:
=
=A0(setq org-todo-keywords
=A0=A0=A0=A0=A0=A0=A0 '((sequence &qu= ot;TODO" "WAIT" "DONE")))
=A0(copy-face 'org-todo 'org-wait-face) ; bug with string when doin= g org-write-agenda
=A0(set-face-foreground 'org-wait-face "ligh= tgoldenrod2")
=A0(setq org-todo-keyword-faces '(("WAIT&quo= t; . org-wait-face)))


In the former case (which fails), the problem appears in the call <= br>
=A0 (ps-face-attribute-list '(:inherit org-todo :foreground &quo= t;lightgoldenrod2"))

but if the property list is itself wrapped= in a list as

=A0(ps-face-attribute-list '((:inherit org-todo :foreground "l= ightgoldenrod2")))

then this function does not raise an error.<= br>
This seems like a bug to me, as I'm pretty sure I'm matching= the
documented form required for org-todo-keyword-faces (in both cases),
but= I could be wrong. I have not had a chance to track this down all the way, = but I thought I'd
pass it on in hopes it is either helpful or will h= elp someone show me the error of my ways.

Thanks for your help. The backtrace for the original problem is given b= elow.

=A0=A0=A0=A0=A0 Debugger entered--Lisp error: (wrong-type-argu= ment listp "lightgoldenrod2")
=A0=A0=A0=A0=A0=A0=A0 ps-face-at= tributes("lightgoldenrod2")
=A0=A0=A0=A0=A0=A0=A0 ps-face-attribute-list((:inherit org-todo :foreground= "lightgoldenrod2"))
=A0=A0=A0=A0=A0=A0=A0 ps-plot-with-face(6= 62 666 (:inherit org-todo :foreground "lightgoldenrod2"))
=A0= =A0=A0=A0=A0=A0=A0 ps-generate-postscript-with-faces1(1 1549)
=A0=A0=A0=A0=A0=A0=A0 ps-generate-postscript-with-faces(1 1549)
=A0=A0= =A0=A0=A0=A0=A0 ps-generate(#<buffer Agenda View> 1 1549 ps-generate-= postscript-with-faces)
=A0=A0=A0=A0=A0=A0=A0 ps-spool-with-faces(1 1549 = nil)
=A0=A0=A0=A0=A0=A0=A0 ps-print-with-faces(1 1549 "~/foobar.ps")
=A0=A0=A0=A0=A0=A0=A0 ps-print-buffer-with-faces("~/foobar.ps")
=A0=A0=A0=A0=A0=A0=A0 (cond ((org-bound-= and-true-p org-mobile-creating-agendas) (org-mobile-write-agenda-for-mobile= file)) ((string-match "\\.html?\\'" file) (require ...) (set= -buffer ...) (when ... ... ... ...) (write-file file) (kill-buffer ...) (me= ssage "HTML written to %s" file)) ((string-match "\\.ps\\= 9;" file) (require ...) (ps-print-buffer-with-faces file) (message &qu= ot;Postscript written to %s" file)) ((string-match "\\.pdf\\'= " file) (require ...) (ps-print-buffer-with-faces ...) (call-process &= quot;ps2pdf" nil nil nil ... ...) (delete-file ...) (message "PDF= written to %s" file)) ((string-match "\\.ics\\'" file) = (require ...) (let ... ...)) (t (let ... ... ... ... ... ... ...)))
=A0=A0=A0=A0=A0=A0=A0 (progn (rename-buffer "Agenda View" t) (set= -buffer-modified-p nil) (insert bs) (org-agenda-remove-marked-text (quote o= rg-filtered)) (while (setq beg ...) (delete-region beg ...)) (run-hooks (qu= ote org-agenda-before-write-hook)) (cond (... ...) (... ... ... ... ... ...= ...) (... ... ... ...) (... ... ... ... ... ...) (... ... ...) (t ...))) =A0=A0=A0=A0=A0=A0=A0 (unwind-protect (progn (rename-buffer "Agenda Vi= ew" t) (set-buffer-modified-p nil) (insert bs) (org-agenda-remove-mark= ed-text ...) (while ... ...) (run-hooks ...) (cond ... ... ... ... ... ...)= ) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
=A0=A0=A0=A0=A0=A0=A0 (save-current-buffer (set-buffer temp-buffer) (unwind= -protect (progn ... ... ... ... ... ... ...) (and ... ...)))
=A0=A0=A0= =A0=A0=A0=A0 (with-current-buffer temp-buffer (unwind-protect (progn ... ..= . ... ... ... ... ...) (and ... ...)))
=A0=A0=A0=A0=A0=A0=A0 (let ((temp-buffer ...)) (with-current-buffer temp-bu= ffer (unwind-protect ... ...)))
=A0=A0=A0=A0=A0=A0=A0 (with-temp-buffer = (rename-buffer "Agenda View" t) (set-buffer-modified-p nil) (inse= rt bs) (org-agenda-remove-marked-text (quote org-filtered)) (while (setq be= g ...) (delete-region beg ...)) (run-hooks (quote org-agenda-before-write-h= ook)) (cond (... ...) (... ... ... ... ... ... ...) (... ... ... ...) (... = ... ... ... ... ...) (... ... ...) (t ...)))
=A0=A0=A0=A0=A0=A0=A0 (let ((bs ...) beg) (org-agenda-unmark-filtered-text)= (with-temp-buffer (rename-buffer "Agenda View" t) (set-buffer-mo= dified-p nil) (insert bs) (org-agenda-remove-marked-text ...) (while ... ..= .) (run-hooks ...) (cond ... ... ... ... ... ...)))
=A0=A0=A0=A0=A0=A0=A0 (save-window-excursion (org-agenda-mark-filtered-text= ) (let (... beg) (org-agenda-unmark-filtered-text) (with-temp-buffer ... ..= . ... ... ... ... ...)))
=A0=A0=A0=A0=A0=A0=A0 (save-excursion (save-win= dow-excursion (org-agenda-mark-filtered-text) (let ... ... ...)))
=A0=A0=A0=A0=A0=A0=A0 (let nil (save-excursion (save-window-excursion ... .= ..)) #<buffer *Org Agenda*>)
=A0=A0=A0=A0=A0=A0=A0 eval((let nil (= save-excursion (save-window-excursion ... ...)) #<buffer *Org Agenda*>= ;))
=A0=A0=A0=A0=A0=A0=A0 org-let(nil (save-excursion (save-window-excur= sion (org-agenda-mark-filtered-text) (let ... ... ...))) #<buffer *Org A= genda*>)
=A0=A0=A0=A0=A0=A0=A0 org-write-agenda("~/foobar.pdf")

--001485f46e5a01bd15049939ff25-- --===============0499150132== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0499150132==--