From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: PATCH: Fix for agenda problems Date: Thu, 29 Jul 2010 18:21:22 -0500 Message-ID: <4C520CF2.6060802@sift.info> Reply-To: rpgoldman@sift.info Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020708070504010001020809" Return-path: Received: from [140.186.70.92] (port=46908 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OecPm-0000oR-Ty for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 19:21:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OecPl-0006vT-KW for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 19:21:26 -0400 Received: from mpls.sift.info ([75.146.46.193]:48652) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OecPl-0006vP-D0 for emacs-orgmode@gnu.org; Thu, 29 Jul 2010 19:21:25 -0400 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: Org Mode This is a multi-part message in MIME format. --------------020708070504010001020809 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 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. Please have a look at the patch and test it. I believe you should be able to verify this problem with the git head by doing something like: 1. (fmakunbound 'ps-print-buffer-with-faces) 2. push the mobile org agendas If I am correct, then pushing the mobile org agendas, which does NOT involve writing any postscript, will crash, because the ps-print-buffer-with-faces will be called. best, r PS I am not sure what the rules are about attachments on this mailing list, so I am both attaching the patch and inserting it as text below. >From 6bc0ba91667f84be9b7e334c517dad72f6eb277f Mon Sep 17 00:00:00 2001 From: Robert P. Goldman Date: Thu, 29 Jul 2010 18:11:21 -0500 Subject: [PATCH] Fixed macroexpansion bug for FLET in org-write-agenda --- lisp/org-agenda.el | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index d62b193..b694ff3 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -2486,14 +2486,16 @@ higher priority settings." (message "HTML written to %s" file)) ((string-match "\\.ps\\'" file) (require 'ps-print) - ,(flet ((ps-get-buffer-name () "Agenda View")) - (ps-print-buffer-with-faces file)) + ,(macroexpand + '(flet ((ps-get-buffer-name () "Agenda View")) + (ps-print-buffer-with-faces file))) (message "Postscript written to %s" file)) ((string-match "\\.pdf\\'" file) (require 'ps-print) - ,(flet ((ps-get-buffer-name () "Agenda View")) - (ps-print-buffer-with-faces - (concat (file-name-sans-extension file) ".ps"))) + ,(macroexpand + '(flet ((ps-get-buffer-name () "Agenda View")) + (ps-print-buffer-with-faces + (concat (file-name-sans-extension file) ".ps")))) (call-process "ps2pdf" nil nil nil (expand-file-name (concat (file-name-sans-extension file) ".ps")) -- 1.7.1 --------------020708070504010001020809 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="0001-Fixed-macroexpansion-bug-for-FLET-in-org-write-agend.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fixed-macroexpansion-bug-for-FLET-in-org-write-agend.pa"; filename*1="tch" >From 6bc0ba91667f84be9b7e334c517dad72f6eb277f Mon Sep 17 00:00:00 2001 From: Robert P. Goldman Date: Thu, 29 Jul 2010 18:11:21 -0500 Subject: [PATCH] Fixed macroexpansion bug for FLET in org-write-agenda --- lisp/org-agenda.el | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index d62b193..b694ff3 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -2486,14 +2486,16 @@ higher priority settings." (message "HTML written to %s" file)) ((string-match "\\.ps\\'" file) (require 'ps-print) - ,(flet ((ps-get-buffer-name () "Agenda View")) - (ps-print-buffer-with-faces file)) + ,(macroexpand + '(flet ((ps-get-buffer-name () "Agenda View")) + (ps-print-buffer-with-faces file))) (message "Postscript written to %s" file)) ((string-match "\\.pdf\\'" file) (require 'ps-print) - ,(flet ((ps-get-buffer-name () "Agenda View")) - (ps-print-buffer-with-faces - (concat (file-name-sans-extension file) ".ps"))) + ,(macroexpand + '(flet ((ps-get-buffer-name () "Agenda View")) + (ps-print-buffer-with-faces + (concat (file-name-sans-extension file) ".ps")))) (call-process "ps2pdf" nil nil nil (expand-file-name (concat (file-name-sans-extension file) ".ps")) -- 1.7.1 --------------020708070504010001020809 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 --------------020708070504010001020809--