Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: (property) :multi argument #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SqrtMinusOne
Copy link

This adds the :multi argument to the property predicate.

E.g. for the following case:

* Test 1
:PROPERTIES:
:PROP:     value-1
:PROP+:     value-2
:PROP+:     value-3
:END:

* Test 2
:PROPERTIES:
:PROP:     value-2
:END:
  • (property "PROP" "value-2") returns just Test 2
  • (property "PROP" "value-2" :multi t) returns both Test 1 and Test 2

@alphapapa
Copy link
Owner

Hello,

Thanks for submitting this. This would be a good feature to support.

It should be noted that this PR is intended to address #254.

A few questions:

  1. Have you signed the FSF copyright assignment for Emacs/Org, or would you be willing to? I'm trying to keep Org QL suitable for inclusion in GNU ELPA or Org itself.
  2. The Org manual at (info "(org) Property Syntax") says: "Note that a property can only have one entry per drawer." So it's unclear to me whether a property value can be added to multiple times in a single entry. Do you know anything about that?
  3. Before support for this feature could be merged, any patch would need to include tests.

Thanks.

@SqrtMinusOne
Copy link
Author

Hello.

  1. Ah, unfortunately not. I wonder if I can even pull this off... if this requires convincing my university that I have something to do with a US-based nonprofit, much less an explicitly political nonprofit.
    Maybe I'll ask around, but I guess this puts the PR on hold if there's no other way.
  2. Hmm, that's strange. The same manual page says: "If you want to add to the value of an existing property, append a ‘+’ to the property name".
    And then "It is also possible to add to the values of inherited properties.". So if adding values to inherited properties isn't the only use case, where would the additional entry be if not in the same drawer?
    Anyway, org-contacts supports adding emails like this.
  3. I see. I'll add tests if there's any chance this can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants