From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: [PATCH] Always return refreshed category Date: Fri, 24 Dec 2010 10:46:28 -0500 Message-ID: <87r5d7xjfv.fsf@fastmail.fm> References: <1293026785-12467-1-git-send-email-julien@danjou.info> <74C83FF2-959A-4C7D-B161-0C333EEE36DD@gmail.com> <87d3osa42b.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=37871 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PW9qr-0006d9-IJ for emacs-orgmode@gnu.org; Fri, 24 Dec 2010 10:46:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PW9qg-0007Ha-Sl for emacs-orgmode@gnu.org; Fri, 24 Dec 2010 10:46:41 -0500 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:42812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PW9qg-0007Gt-Qm for emacs-orgmode@gnu.org; Fri, 24 Dec 2010 10:46:30 -0500 In-Reply-To: (Julien Danjou's message of "Thu, 23 Dec 2010 17:03:00 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Julien Danjou Cc: emacs-orgmode@gnu.org, Carsten Dominik Hi Julien, Julien Danjou writes: > On Thu, Dec 23 2010, Matt Lundin wrote: > >> Another observation: org-refresh-category-properties returns t > > That's the 't' you see as category. > >> and thus >> short-circuits the "or" here. Is the following perhaps the intended >> behavior? >> >> diff --git a/lisp/org.el b/lisp/org.el >> index e80d2fc..55f1bf1 100644 >> --- a/lisp/org.el >> +++ b/lisp/org.el >> @@ -8143,8 +8143,8 @@ call CMD." >> "Get the category applying to position POS." >> (let ((pos (or pos (point)))) >> (or (get-text-property pos 'org-category) >> - (org-refresh-category-properties) >> - (get-text-property pos 'org-category)))) >> + (progn (org-refresh-category-properties) >> + (get-text-property pos 'org-category))))) >> >> (defun org-refresh-category-properties () >> "Refresh category text properties in the buffer." > > Good catch indeed, I missed a progn. With your original patch, I am also frequently seeing "???" as a category in the agenda buffer. E.g., ???: In -1 d.: TODO Christmas gifts wrapped :home: This occurs with files/entries that do not have an in-buffer category statement (e.g, #+CATEGORY: or :CATEGORY:). Thanks, Matt