[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] PATCH: Fix for agenda problems

From: David Maus
Subject: Re: [Orgmode] PATCH: Fix for agenda problems
Date: Mon, 02 Aug 2010 18:53:41 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Goj┼Ź) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Robert Goldman wrote:
>On 8/1/10 Aug 1 -1:28 PM, David Maus wrote:
>> Robert Goldman wrote:
>>> [1  <text/plain; ISO-8859-1 (7bit)>]
>>> 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

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).

  -- David

OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden

Attachment: pgpdDZFRvkT7v.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]