emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Re: Concatenate properties


From: Tyler Grinn
Subject: Re: [PATCH] Re: Concatenate properties
Date: Thu, 12 May 2022 19:27:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Ihor Radchenko <yantar92@gmail.com> writes:

> Note that your patch is >15LOC long and you need to sign the copyright
> agreement with FSF in order to contribute. See
> https://orgmode.org/worg/org-contribute.html#copyright

I've already submitted a copyright assignment to the FSF in order to
publish on ELPA. Do I need one specific to org-mode?

> Some comments on the patch:
>
>> * lisp/org.el (org-property-separators, org-property-get-separator):
>> Created.
>
> I'd make the function private: org--property-get-separator. It is not
> intended as an API function.

I agree, that was an oversight.

>
>> (org-entry-get, org-entry-get-with-inheritance): Use new
>> org-property-get-separator function.
>
>> org-property-separators is a customization option that allows for
>
> Please quote the function name as `org-property-get-separator'.
>

No problem.

>> +If a property is specified multiple times with a =+=, like
>> +=:EXPORT_FILE_NAME+:=, the old behavior was to always combine them
>> +with a single space. For the new variable, the car of each item in
>> the
>
> Please, use double space "  " to separate sentences. Also, see
> doc/Documentation_Standards.org

No problem.

>
>> +For example, in order to combine =EXPORT_FILE_NAME= properties with a
>> +forward slash =/=, one can use
>> +
>> +#+begin_src emacs-lisp
>> +(setq org-use-property-inheritance '("EXPORT_FILE_NAME")
>> +      org-property-separators '((("EXPORT_FILE_NAME") . "/")))
>> +#+end_src
>
> This example is a bit confusing because it is unclear what you want to
> achieve and why you also need to set inheritance.

Inheritance is the most likely scenario one would need to use the '+'
property syntax, but I do agree it's kinda distracting and not
absolutely necessary in order to get the correct behavior.

>
>> +(defcustom org-property-separators nil
>> ...
>> +  :group 'org-properties
>> +  :type '(alist :key-type string :value-type sexp))
>
> This defcustom type does not match what you described in the docstring.
> You need something like :type '(alist :key-type (choice string (repeat 
> string)) :value-type string)
>
> Best,
> Ihor

Setting ':value-type string' is confusing, in my opinion, because the
default single space looks like:   in the customization buffer, which is
indistinguishable from no space: . I just found out about the restricted-sexp
type, which I think makes the customization buffer more user-friendly.

Attachment: 0001-lisp-org.el-Add-org-property-separators-option.patch
Description: Add org-property-separators option


reply via email to

[Prev in Thread] Current Thread [Next in Thread]