emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* PATCH:  Fix for agenda problems
@ 2010-07-29 23:21 Robert Goldman
  2010-08-01 18:28 ` David Maus
  2010-08-01 18:28 ` PATCH: Fix for agenda problems David Maus
  0 siblings, 2 replies; 8+ messages in thread
From: Robert Goldman @ 2010-07-29 23:21 UTC (permalink / raw)
  To: Org Mode

[-- 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-08-19 18:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 23:21 PATCH: Fix for agenda problems Robert Goldman
2010-08-01 18:28 ` 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

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