Hello, Kyle Meyer <k...@kyleam.com> writes:
> I'm a bit confused about why org-call-with-arg is necessary because I > think call-interactively already propagates the current prefix argument, > but perhaps I'm missing some subtlety here. Either way ... I thought the same. I think we can replace `org-call-with-arg' with `call-interactively' in master. >> The problem is that if you choose ?f (sorting with custom key function), >> then org-sort-list expects another argument, the compare-func, which is >> not passed to it. >> >> IMHO, there are two ways to solve this >> >> 1. Ask for the compare-func in org-sort-list, as it does for the >> getkey-func. A default value could be provided for compare-func, >> e.g., string<, <, etc. Or >> 2. Restrict the return type to a string (or integer) so that we could >> fix the compare-func I'd rather have 1. Actually, there's some confusion in `org-sort-list' about how getkey-func and compare-func are handled. For example, the question asked to bind GETKEY-FUNC is "Sort using function: ", which should really be asked for COMPARE-FUNC. IOW, we need to move this question to COMPARE-FUNC and ask a new one for GETKEY-FUNC. > And I think it's OK to not expose compare-func to the interactive > caller. In cases where sort-subr's default behavior won't do and a user > wants to supply a value for compare-func, they can create their own > command that wraps a non-interactive org-sort-list call. I disagree. getkey-func and compare-func work hand in hand. You cannot let users provide one but not the other without crippling functionality. Regards, -- Nicolas Goaziou