From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Spiers Subject: [PATCH] Fix (wrong-type-argument integer-or-marker-p nil) in org-agenda-get-todos. Date: Sun, 4 Mar 2012 23:47:14 +0000 Message-ID: <20120304234713.GA27660@atlantic.linksys.moosehall> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4L95-0000yU-Fl for emacs-orgmode@gnu.org; Sun, 04 Mar 2012 18:47:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4L93-0003si-Pf for emacs-orgmode@gnu.org; Sun, 04 Mar 2012 18:47:19 -0500 Received: from arctic.adamspiers.org ([85.119.82.176]:35367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4L93-0003sb-KY for emacs-orgmode@gnu.org; Sun, 04 Mar 2012 18:47:17 -0500 Received: from localhost (70.83.187.81.in-addr.arpa [81.187.83.70]) by arctic.adamspiers.org (Postfix) with ESMTP id 1CFE8240F9 for ; Sun, 4 Mar 2012 23:47:15 +0000 (UTC) Content-Disposition: inline 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 mailing list org-get-category can sometimes invoke org-refresh-category-properties which can perform a re-search-forward which destroys the existing match data. When called from org-agenda-get-todos, this can result in its subsequent call to (match-beginning 2) to return nil, which when passed as the first parameter to buffer-string causes the above error. --- lisp/org-agenda.el | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index ac1b5b1..4efb332 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4664,10 +4664,11 @@ the documentation of `org-diary'." (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible)) (throw :skip nil))) (goto-char (match-beginning 2)) - (setq marker (org-agenda-new-marker (match-beginning 0)) - category (org-get-category) - org-category-pos (get-text-property (point) 'org-category-position) - txt (org-trim + (setq marker (org-agenda-new-marker (match-beginning 0))) + (save-match-data + (setq category (org-get-category) + org-category-pos (get-text-property (point) 'org-category-position))) + (setq txt (org-trim (buffer-substring (match-beginning 2) (match-end 0))) tags (org-get-tags-at (point)) txt (org-agenda-format-item "" txt category tags) -- 1.7.8.206.g71406