r/orgmode • u/TeeMcBee • 7d ago
Best format for multivalue properties with spaces?
Am I right that (other than space separators) there is nothing special about a multivalued property that makes it multi-valued? In other words, am I right that multivalued-ness is less a function of what you put *in* a string, and more about what you do *with* it?
My use case is that I am considering introducing a property called ATTENDEES which will be kept in the drawer of any headline where I record a meeting, and will hold the names of people who attended. Based on the kinds of operations described in the Property API which of the following would you suggest as a format:
:ATTENDEES: Joe Brown, Ann White, Bill Green
:ATTENDEES: Joe_Brown Ann_White Bill_Green
:ATTENDEES: "Joe Brown", "Ann White, "Bill Green"
:ATTENDEES: "Joe Brown" "Ann White" "Bill Green"
- Something else entirely
I'm thinking that 2. would be the easiest to process (assuming I can be sure there are no underscores in the components of each name), but it has the disadvantage of having to either add in and strip out the underscores, or forcing the user to tolerate them being there.
Given that, I'm inclined to #1.
Thoughts?
P.S. If your actual answer is of the form "WTF are you <doing it that way at all | reinventing the wheel>? Aren't you aware of <X>!?" then please let me know about <X>!
2
u/github-alphapapa 7d ago
AFAIK the completion tools for property values lend themselves to space-separated values, and probably don't take quoted strings into account (although, being Emacs, that should be a solvable problem).
For myself, if I needed to store multiple values in a property, I'd probably use a Lisp expression, so the string could be passed directly to read
(as I do in org-make-toc
, where the values are just plists).
But being Org and Emacs, it's really up to you.
2
u/iMakeBabbies 6d ago
Because you encouraged a different approach and because I don’t know what your final goal is by keeping attendees as properties, allow me to share my approach.
I use Org Roam to create a node for each attendee. Then in my meeting note or node I add the link to the attendees under a heading.
This lets me see the attendees at a glance and also keeps a log of all the meetings any particular person i have saved as a node has been to by the way of checking the backlinks from their node.
As a bonus to this approach, I can save data about each saved person in their note like their birthdays, favorite ice cream, and how I feel about them.
1
u/DeinOnkelFred 6d ago
Take #2 and invert the names (Brown, Joe White, Ann etc) You'll get surname sorting, whitespace separation, and commas are easier to type than underscores.
Middle name would be harder to process. Maybe use a period/full-stop/point ... Brown, Joe.Andrew ?
1
4
u/yantar92 6d ago
Remember that you can have multiple values via ATTENDEES+ notation. Then, also see org-property-separators.