emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ilya Shlyakhter <ilya_shl@alum.mit.edu>
To: Bastien <bzg@gnu.org>
Cc: Achim Gratz <Stromeko@nexgo.de>, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Fixed bug in org-entry-get-with-inheritance
Date: Mon, 17 Mar 2014 17:30:31 -0400	[thread overview]
Message-ID: <CACfYvRa=UnU7jqqXqOJkGnXG_QWhRqSg_CLjm6ihvpb-QZ9k1g@mail.gmail.com> (raw)
In-Reply-To: <87mwgopnrf.fsf@bzg.ath.cx>

In the current master branch, doing the example from the patch
(reproduced below again) gives "aaa", because the line
          (let (org-file-properties org-global-properties
org-global-properties-fixed)
has been removed from org-entry-get-with-inheritance .
I agree that patching a function as core as this should be done with
care; however, I'm pretty positive that there was a bug, as explained
in the patch message.
org-entry-get-with-inheritance calls org-entry-get for each entry
going up the tree, to read the property at that entry _without_
inheritance; however, unless
the let line above is included, this reading actually happens _with_
inheritance -- of global properties.  So a property can appear to be
set at a node during
up-the-tree traversal, when in fact it is only set as a global
property.   If org-entry-get-with-inheritance see a property set at a
node during up-the-tree traversal,
it stops the traversal right there, ignoring any settings of this
property further up the tree -- which should override any global
settings of the same property.

Here is the test case again:

#+PROPERTY: myprop aaa
* headline A
  :PROPERTIES:
  :myprop: bbb
  :END:
*** headline B
    :PROPERTIES:
    :otherprop:       ccc
    :END:

    #+BEGIN_SRC emacs-lisp
    (message (org-entry-get-with-inheritance "myprop"))
    #}

    #+RESULTS:
    : aaa



On Mon, Mar 17, 2014 at 4:35 PM, Bastien <bzg@gnu.org> wrote:
> Achim Gratz <Stromeko@nexgo.de> writes:
>
>>> I meant: can you tell me how the tests fail?
>>
>> They don't produce the result they are supposed to produce.
>
> Thanks for this explanation.
>
>>> I'm interested in the answer.
>>
>> make BTEST_RE='\\(header-arg-defaults\\|property-accumulation\\)'
>> test-dirty
>
> Thanks!
>
>>>>> If the patch is good and the tests are outdated, I'd rather
>>>>> fix the tests than revert the patch to re-revert it again.
>>>>
>>>> No, the patch is bad, otherwise it wouldn't break the tests.
>>>
>>> Sorry, I don't buy this.
>>
>> I'm not selling anything.
>
> What I meant is this: broken tests are not a sufficient reason to
> revert a commit.  You need to show the commit is wrong and the tests
> are not outdated.
>
> In this case, I made the error of reproduce Ilya's solution,
> not Ilya's problem, so I wrong assumed his patch was the problem
> to his problem.
>
> Ilya: from the maint and master branch, I get "bbb" as a result
> for the example you placed in your commit message.  Do you have
> "aaa" as a result with Org from maint or master?  If so, can you
> provide a recipe?
>
> Thanks,
>
> --
>  Bastien

  parent reply	other threads:[~2014-03-17 21:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07  6:28 [PATCH] Fixed bug in org-entry-get-with-inheritance Ilya Shlyakhter
2014-03-14 11:16 ` Bastien
2014-03-17 18:25   ` Achim Gratz
2014-03-17 19:08     ` Bastien
2014-03-17 19:20       ` Achim Gratz
2014-03-17 19:33         ` Bastien
2014-03-17 19:49           ` Achim Gratz
2014-03-17 20:35             ` Bastien
2014-03-17 20:51               ` Achim Gratz
2014-03-17 20:56                 ` Bastien
2014-03-17 21:30               ` Ilya Shlyakhter [this message]
2014-03-17 21:43                 ` Achim Gratz
2014-03-17 22:06                   ` Ilya Shlyakhter
2014-03-17 22:13                     ` Bastien
2014-03-18 12:01                       ` Bastien
2014-03-18 15:14                       ` Bastien
2014-03-18 15:38                         ` Ilya Shlyakhter
2014-03-18 17:23                         ` Achim Gratz
2014-03-18 18:27                           ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACfYvRa=UnU7jqqXqOJkGnXG_QWhRqSg_CLjm6ihvpb-QZ9k1g@mail.gmail.com' \
    --to=ilya_shl@alum.mit.edu \
    --cc=Stromeko@nexgo.de \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).