From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Mikhanosha Subject: [PATCH 1/2] Fix error with %e agenda prefix format when there is no effort set Date: Thu, 21 Jul 2011 13:56:53 -0400 Message-ID: <87ipqv5xga.wl%max@openchat.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjy5c-0007cD-RR for emacs-orgmode@gnu.org; Thu, 21 Jul 2011 14:35:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qjy5b-0001i6-Lf for emacs-orgmode@gnu.org; Thu, 21 Jul 2011 14:35:16 -0400 Received: from p84-72.acedsl.com ([66.114.84.72]:36157 helo=momoland.openchat.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qjy5b-0001hb-8x for emacs-orgmode@gnu.org; Thu, 21 Jul 2011 14:35:15 -0400 Received: from momoland.openchat.com (localhost [IPv6:::1]) by momoland.openchat.com (Postfix) with ESMTP id 874BBE7E85 for ; Thu, 21 Jul 2011 13:56:53 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode List `org-agenda-prefix-format' has un undocumented format %e for Effort, which is broken. it throws error on entries without effort property. Following patch fixes that problem. TODO: make agenda redraw current line when `org-agenda-set-effort' sets a new effort =46rom c06b376737142eff5cdec71e8fc8129552aba673 Mon Sep 17 00:00:00 2001 From: Max Mikhanosha Date: Wed, 6 Jul 2011 20:05:06 -0400 Subject: [PATCH 1/2] Fix error with %e agenda prefix format when there is n= o effort set --- lisp/org-agenda.el | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index cd09a74..f34ffae 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5511,7 +5511,9 @@ Any match of REMOVE-RE will be removed from TXT." (error nil))) (when effort (setq neffort (org-duration-string-to-minutes effort) - effort (setq effort (concat "[" effort "]" ))))) + effort (setq effort (concat "[" effort "]"))))) + ;; prevent erroring out with %e format when there is no effort + (or effort (setq effort "")) =20 (when remove-re (while (string-match remove-re txt) @@ -5549,6 +5551,7 @@ Any match of REMOVE-RE will be removed from TXT." (>=3D (length category) org-prefix-category-max-length)) (setq category (substring category 0 (1- org-prefix-category-max-leng= th))))) ;; Evaluate the compiled format + (assert effort) (setq rtn (concat (eval org-prefix-format-compiled) txt)) =20 ;; And finally add the text properties --=20 1.7.3.4