emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Goldman <rpgoldman@sift.info>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: PATCH:  Fix for agenda problems
Date: Thu, 29 Jul 2010 18:21:22 -0500	[thread overview]
Message-ID: <4C520CF2.6060802@sift.info> (raw)

[-- Attachment #1: Type: text/plain, Size: 2397 bytes --]

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 <rpgoldman@real-time.com>
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


[-- Attachment #2: 0001-Fixed-macroexpansion-bug-for-FLET-in-org-write-agend.patch --]
[-- Type: text/plain, Size: 1409 bytes --]

From 6bc0ba91667f84be9b7e334c517dad72f6eb277f Mon Sep 17 00:00:00 2001
From: Robert P. Goldman <rpgoldman@real-time.com>
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


[-- Attachment #3: 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

             reply	other threads:[~2010-07-29 23:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 23:21 Robert Goldman [this message]
2010-08-01 18:28 ` PATCH: Fix for agenda problems David Maus
2010-08-02  1:42   ` Robert Goldman
2010-08-02 16:53     ` David Maus
2010-08-12 16:31       ` [PATCH] Remove dependency of flet in org-write-agenda David Maus
2010-08-12 16:31       ` [PATCH] Rename temporary buffer to remove dependency of `flet' macro David Maus
2010-08-18  8:43         ` Carsten Dominik
2010-08-01 18:28 ` PATCH: Fix for agenda problems David Maus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C520CF2.6060802@sift.info \
    --to=rpgoldman@sift.info \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).