From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: PATCH: Fix for agenda problems Date: Mon, 02 Aug 2010 18:53:41 +0200 Message-ID: <87hbjdq7l6.wl%dmaus@ictsoc.de> References: <4C520CF2.6060802@sift.info> <874ofefarb.wl%dmaus@ictsoc.de> <4C562282.5090802@sift.info> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============1167089320==" Return-path: Received: from [140.186.70.92] (port=52939 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfyH0-0005wc-3j for emacs-orgmode@gnu.org; Mon, 02 Aug 2010 12:53:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfyGy-0003NO-Da for emacs-orgmode@gnu.org; Mon, 02 Aug 2010 12:53:57 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:34079) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfyGy-0003M2-4W for emacs-orgmode@gnu.org; Mon, 02 Aug 2010 12:53:56 -0400 In-Reply-To: <4C562282.5090802@sift.info> 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: rpgoldman@sift.info Cc: Org Mode --===============1167089320== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Mon_Aug__2_18:53:41_2010-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Mon_Aug__2_18:53:41_2010-1 Content-Type: text/plain; charset=US-ASCII 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 --pgp-sign-Multipart_Mon_Aug__2_18:53:41_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAkxW+BUACgkQma24O1pEeOawbAD/T+zoQWvuiy2Puc29ii0Xzw8b 6oRuT6Y4koGzX2518OMA/j9D5FgnEuRXVYMo1FMd1cYMTAsj1ssY1v3GRUj/M+Gq =RrY2 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Mon_Aug__2_18:53:41_2010-1-- --===============1167089320== 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 --===============1167089320==--