From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Clemente Subject: [PATCH] initialize level in org-agenda-format-item Date: Wed, 26 Sep 2012 11:14:40 +0200 Message-ID: <87pq59tabj.wl%n142857@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGnhg-0008Hi-14 for emacs-orgmode@gnu.org; Wed, 26 Sep 2012 05:14:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGnhc-0002Sa-0C for emacs-orgmode@gnu.org; Wed, 26 Sep 2012 05:14:47 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:59536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGnhb-0002SU-MK for emacs-orgmode@gnu.org; Wed, 26 Sep 2012 05:14:43 -0400 Received: by wgbdt14 with SMTP id dt14so219934wgb.30 for ; Wed, 26 Sep 2012 02:14:42 -0700 (PDT) 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: emacs-orgmode@gnu.org When I used %l in org-agenda-prefix-format, my agenda failed with: Debugger entered--Lisp error: (args-out-of-range 0 0) get-text-property(0 extra-space nil) (concat level "" (get-text-property 0 (quote extra-space) level)) (if (equal level "") "" (concat level "" (get-text-property 0 (quote extr= a-space) level))) (format "%s" (if (equal level "") "" (concat level "" (get-text-property = 0 (quote extra-space) level)))) =E2=80=A6 It was due to =E2=80=9Elevel=E2=80=9C being nil. The (if (equal level "")) = did not run because level was nil and not "". So I set it to "" and it worked: diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 9e2380b..a8b009c 100755 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6038,7 +6038,8 @@ Any match of REMOVE-RE will be removed from TXT." (t "")) extra (or (and (not habitp) extra) "") category (if (symbolp category) (symbol-name category) category) - thecategory (copy-sequence category)) + thecategory (copy-sequence category) + level "") (if (string-match org-bracket-link-regexp category) (progn (setq l (if (match-end 3)