Robert Goldman wrote: >On 8/1/10 Aug 1 -1:28 PM, David Maus wrote: >> Robert Goldman wrote: >>> [1 ] >>> As far as I can tell, the current version of org-write-agenda evaluates >>> ps-print-buffer-with-faces too eagerly. I tripped over this because >>> aquamacs 2.0, which I'm using, seems to have ps-printing code that >>> conflicts with org-mode's expectation. >> >>> The attached patch tries to fix this, but does not do the job >>> particularly elegantly. Instead of EVALUATING the flet form, it >>> MACROEXPANDS that form, which I believe is correct in this context. >> >> Yes, the intension of backquoting the flet macro was macroexpansion, >> not evaluation. And it should work to solve the issue with cl not >> loaded on runtime when calling `org-agenda-write'[1]. >> >> Best, >> -- David >> >> [1] Cf. http://thread.gmane.org/gmane.emacs.orgmode/26132/focus=26698 >Are you sure that my patch will work properly? I was looking at it, and >it seems like the use of org-let might cause the list (the code) to be >evaluated at run-time, and not at compile time, right? AFAIK this is the case: The list is passed to org-let and evaluated there at run-time. The backquotes were introduced to solve this issue: A user might run `org-write-agenda' at a point where cl hasn't be loaded (run-time dependency on cl.el). Because the whole lisp structure is passed as a quoted list to org-let, the byte compiler does not touch it. If it is evaluated at run-time and cl.el is not loaded, `flet' is not fbound and `org-write-agenda' fails. Writing this I realize that the original patch (using backquotes) as well as the proposed patch using `macroexpand' does /not/ solve this issue completely: It solves it for running byte-compiled Org, but not non-byte-compiled Org. >It occurs in org-agenda. Question: does this mean that the backquoted >expression will be evaluated at run-time, or is the compiler aggressive >enough to do it at compile-time? The backquoted expression will be evaluated at compile-time. Backquoting `flet' removes the run-time dependency on cl.el for byte compiled code (http://thread.gmane.org/gmane.emacs.orgmode/26132/focus=26698). IMO using backquoted `macroexpand' is the way to go. I'll see if it works as advertised (e.g. not causing org-write-agenda to fail when run from byte compiled Org). Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de