emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-write-agenda failure
@ 2011-01-07  4:24 Christopher Genovese
  2011-01-23 13:14 ` David Maus
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Genovese @ 2011-01-07  4:24 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 5011 bytes --]

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(#<buffer Agenda View> 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 ... ...)) #<buffer
*Org Agenda*>)
        eval((let nil (save-excursion (save-window-excursion ... ...))
#<buffer *Org Agenda*>))
        org-let(nil (save-excursion (save-window-excursion
(org-agenda-mark-filtered-text) (let ... ... ...))) #<buffer *Org Agenda*>)
        org-write-agenda("~/foobar.pdf")

[-- Attachment #1.2: Type: text/html, Size: 5720 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: org-write-agenda failure
  2011-01-07  4:24 org-write-agenda failure Christopher Genovese
@ 2011-01-23 13:14 ` David Maus
  0 siblings, 0 replies; 2+ messages in thread
From: David Maus @ 2011-01-23 13:14 UTC (permalink / raw)
  To: Christopher Genovese; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2649 bytes --]

At Thu, 6 Jan 2011 23:24:37 -0500,
Christopher Genovese wrote:
> 
> [1  <multipart/alternative (7bit)>]
> [1.1  <text/plain; ISO-8859-1 (7bit)>]
> 
> [1.2  <text/html; ISO-8859-1 (quoted-printable)>]
> 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.

I can confirm this for 

Org-mode version 7.4 (release_7.4.215.g1350)

GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-12-11 on raven, modified by Debian

Setting (setq org-todo-keyword-faces '(("WAIT" . "lightgoldenrod2")))
seems right according to the docstring:

,----
| This is a list of cons cells, with TODO keywords in the car
| and faces in the cdr.  The face can be a symbol, a color
| as a string (in which case the rest is inherited from the `org-todo' face),
| or a property list of attributes, like
|    (:foreground "blue" :weight bold :underline t).
| If it is a color string, the variable `org-faces-easy-properties'
| determines if it is a foreground or a background color.
`---

Best,
  -- David
-- 
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-23 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-07  4:24 org-write-agenda failure Christopher Genovese
2011-01-23 13:14 ` David Maus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).