From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: [PATCH] Fix `org-refresh-category-properties' (was: `org-get-category' and `org-entry-get' do not return the same value) Date: Tue, 28 Apr 2015 09:02:23 +0200 Message-ID: <871tj4g2gw.fsf@konixwork.incubateur.ens-lyon.fr> References: <87386sitvl.fsf@konixwork.incubateur.ens-lyon.fr> <87egqcr6hb.fsf@nicolasgoaziou.fr> <874mo0g2wx.fsf@konixwork.incubateur.ens-lyon.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmzXM-0002cJ-Eg for emacs-orgmode@gnu.org; Tue, 28 Apr 2015 03:02:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmzXG-00062K-O3 for emacs-orgmode@gnu.org; Tue, 28 Apr 2015 03:02:32 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:36532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmzXG-000622-GD for emacs-orgmode@gnu.org; Tue, 28 Apr 2015 03:02:26 -0400 Received: by wizk4 with SMTP id k4so127665068wiz.1 for ; Tue, 28 Apr 2015 00:02:25 -0700 (PDT) In-Reply-To: <874mo0g2wx.fsf@konixwork.incubateur.ens-lyon.fr> 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: Nicolas Goaziou Cc: OrgMode ML --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Samuel Loury writes: > Dear Nicolas, [...] > --8<---------------cut here---------------start------------->8--- > #+CATEGORY: c > * foo > :PROPERTIES: > :CATEGORY: a > :END: > ** bar > :PROPERTIES: > :CATEGORY: b > :END: > > --8<---------------cut here---------------end--------------->8--- > > `org-get-category' in the bar headline returns 'a', while I would expect > it to return 'b'. [...] > I don't understand why one would want to remove this behavior. Does it > raise a technical issue? After a quick look at the code, I wonder if this new behavior is a technical choice or hopefully a simple mistake. Please find attached a patch that restores the behavior of taking into account the CATEGORY keyword in sub-trees also. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-org-refresh-category-properties.patch Content-Transfer-Encoding: quoted-printable From=209de5161d4bf8a3a3be2fa91d48667d676233e1a4 Mon Sep 17 00:00:00 2001 From: Konubinix Date: Tue, 28 Apr 2015 08:55:10 +0200 Subject: [PATCH] Fix `org-refresh-category-properties' * lisp/org.el (org-refresh-category-properties): Prevent the `put-text-prop= erty' to change the point in order to take into account the CATEGORY keyword property in subtrees also. =2D-- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index e52bf53..5b1dded 100755 =2D-- a/lisp/org.el +++ b/lisp/org.el @@ -9568,7 +9568,7 @@ The refresh happens only for the current tree (not su= btree)." (when (org-at-property-p) (put-text-property (save-excursion (org-back-to-heading t) (point)) =2D (org-end-of-subtree t t) + (save-excursion (org-end-of-subtree t t) (point)) 'org-category value))))))))) =20 =2D-=20 2.1.4 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Best regards, =2D-=20 Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVPzCAAAoJEHXSPO10ORBqVrsH/AxZ25YCPeosUmvjS8LIkTXS y3u4IsWItOBWZ9GYUbUngCYOOq9gZ0yggM6QfvDsnXvl2hd016rpKcWDFFMZ4h8c ZCXlNj0O9o5u1FXmPHseOVX7uix8m63rzN2FzTFjmqY9ZcTGGT/PGoLcCglbBagQ +dXYrXodTqy0xKV7WuJZLu+kXc0zk6J0XoZU9NiY7ovcZ1AItNLz/sMsvUiBEl5Z 4LZYgI+Ho2nGIL6MF1iflOpEQqj8Z9hIIwD4YxrCM2u1v3mZPHvwrGxSMtVYNyLq fw7lx02KMdocJD6RCOSXwcHCmme3/teKiKJFMoSzVP+k9dYPBMR1gjqYaUhidjc= =iMN3 -----END PGP SIGNATURE----- --==-=-=--