>From 6d8411910f83aa46b5b7782060bb25549e7d663b Mon Sep 17 00:00:00 2001
From: Max Mikhanosha <max@openchat.com>
Date: Fri, 22 Jul 2011 13:31:05 -0400
Subject: [PATCH 7/8] (org-agenda-change-all-lines): Change to item's buffer and use
 original column format that item was generated with

---
 lisp/org-agenda.el |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index c230201..ff1d55c 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5566,7 +5566,6 @@ Any match of REMOVE-RE will be removed from TXT."
 		 (>= (length category) org-prefix-category-max-length))
 	    (setq category (substring category 0 (1- org-prefix-category-max-length)))))
       ;; Evaluate the compiled format
-      (assert effort)
       (setq rtn (concat (eval org-prefix-format-compiled) txt))
 
       ;; And finally add the text properties
@@ -5583,6 +5582,7 @@ Any match of REMOVE-RE will be removed from TXT."
 	'txt txt
 	'time time
 	'extra extra
+	'format org-prefix-format-compiled
 	'dotime dotime))))
 
 (defun org-agenda-fix-displayed-tags (txt tags add-inherited hide-re)
@@ -7257,8 +7257,16 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
 		dotime (org-get-at-bol 'dotime)
 		cat (org-get-at-bol 'org-category)
 		tags thetags
-		new (org-format-agenda-item (org-get-at-bol 'extra)
-					    newhead cat tags dotime)
+		new
+		(let ((org-prefix-format-compiled
+		       (or (get-text-property (point) 'format)
+			   org-prefix-format-compiled)))
+		  (with-current-buffer (marker-buffer hdmarker)
+		    (save-excursion
+		      (save-restriction
+			(widen)
+			(org-format-agenda-item (org-get-at-bol 'extra)
+						newhead cat tags dotime)))))
 		pl (text-property-any (point-at-bol) (point-at-eol) 'org-heading t)
 		undone-face (org-get-at-bol 'undone-face)
 		done-face (org-get-at-bol 'done-face))
-- 
1.7.3.4

