From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: [Accepted] Always return refreshed category Date: Thu, 23 Dec 2010 08:43:12 +0100 (CET) Message-ID: <20101223074312.273A27FB1BF@localhost.localhost> References: <1293026785-12467-1-git-send-email-julien@danjou.info> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=41607 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVfpT-0003Pz-2w for emacs-orgmode@gnu.org; Thu, 23 Dec 2010 02:43:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PVfpR-0005X2-MZ for emacs-orgmode@gnu.org; Thu, 23 Dec 2010 02:43:14 -0500 Received: from dslb-088-073-014-145.pools.arcor-ip.net ([88.73.14.145]:63379 helo=localhost.localhost) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PVfpR-0005Ws-3h for emacs-orgmode@gnu.org; Thu, 23 Dec 2010 02:43:13 -0500 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: emacs-orgmode@gnu.org Patch 505 (http://patchwork.newartisans.com/patch/505/) is now "Accepted". Maintainer comment: No comment This relates to the following submission: http://mid.gmane.org/%3C1293026785-12467-1-git-send-email-julien%40danjou.info%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [Orgmode] Always return refreshed category > Date: Wed, 22 Dec 2010 19:06:25 -0000 > From: Julien Danjou > X-Patchwork-Id: 505 > Message-Id: <1293026785-12467-1-git-send-email-julien@danjou.info> > To: emacs-orgmode@gnu.org > Cc: Julien Danjou > > * org-icalendar.el (org-print-icalendar-entries): Do not manually > refresh categories. > > * org-clock.el (org-clock-insert-selection-line): Do not manually > refresh categories. > > * org.el (org-get-category): Refresh categories if no category found. > (org-entry-properties): Do not manually refresh categories. > (org-prepare-agenda-buffers): Do not manually refresh categories. > > It seems a very bad thing to call manually for a category refresh. It > seems better to try to refresh if we do not have a category. > > Signed-off-by: Julien Danjou > > --- > lisp/org-archive.el | 1 - > lisp/org-clock.el | 4 +--- > lisp/org-icalendar.el | 1 - > lisp/org.el | 11 +++++------ > 4 files changed, 6 insertions(+), 11 deletions(-) > > diff --git a/lisp/org-archive.el b/lisp/org-archive.el > index e56b01f..c32ee23 100644 > --- a/lisp/org-archive.el > +++ b/lisp/org-archive.el > @@ -226,7 +226,6 @@ this heading." > (save-excursion > (org-back-to-heading t) > ;; Get context information that will be lost by moving the tree > - (org-refresh-category-properties) > (setq category (org-get-category) > todo (and (looking-at org-todo-line-regexp) > (match-string 2)) > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index 93b0b52..17fccae 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -442,9 +442,7 @@ pointing to it." > (ignore-errors > (goto-char marker) > (setq file (buffer-file-name (marker-buffer marker)) > - cat (or (org-get-category) > - (progn (org-refresh-category-properties) > - (org-get-category))) > + cat (org-get-category) > heading (org-get-heading 'notags) > prefix (save-excursion > (org-back-to-heading t) > diff --git a/lisp/org-icalendar.el b/lisp/org-icalendar.el > index d4034fe..a1bc5ad 100644 > --- a/lisp/org-icalendar.el > +++ b/lisp/org-icalendar.el > @@ -302,7 +302,6 @@ When COMBINE is non nil, add the category to each line." > scheduledp deadlinep todo prefix due start > tmp pri categories location summary desc uid alarm > (sexp-buffer (get-buffer-create "*ical-tmp*"))) > - (org-refresh-category-properties) > (save-excursion > (goto-char (point-min)) > (while (re-search-forward re1 nil t) > diff --git a/lisp/org.el b/lisp/org.el > index 3cecca7..e80d2fc 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -8141,7 +8141,10 @@ call CMD." > > (defun org-get-category (&optional pos) > "Get the category applying to position POS." > - (get-text-property (or pos (point)) 'org-category)) > + (let ((pos (or pos (point)))) > + (or (get-text-property pos 'org-category) > + (org-refresh-category-properties) > + (get-text-property pos 'org-category)))) > > (defun org-refresh-category-properties () > "Refresh category text properties in the buffer." > @@ -13481,10 +13484,7 @@ things up because then unnecessary parsing is avoided." > 'add_times)) > props)) > (unless (assoc "CATEGORY" props) > - (setq value (or (org-get-category) > - (progn (org-refresh-category-properties) > - (org-get-category)))) > - (push (cons "CATEGORY" value) props)) > + (push (cons "CATEGORY" (org-get-category)) props)) > (append sum-props (nreverse props))))))) > > (defun org-entry-get (pom property &optional inherit literal-nil) > @@ -15701,7 +15701,6 @@ When a buffer is unmodified, it is just killed. When modified, it is saved > (set-buffer (org-get-agenda-file-buffer file))) > (widen) > (setq bmp (buffer-modified-p)) > - (org-refresh-category-properties) > (setq org-todo-keywords-for-agenda > (append org-todo-keywords-for-agenda org-todo-keywords-1)) > (setq org-done-keywords-for-agenda >