emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] About org-sort -> org-sort-list with custom sort function


From: Kyle Meyer
Subject: Re: [O] About org-sort -> org-sort-list with custom sort function
Date: Sun, 07 May 2017 10:20:16 -0400

Nicolas Goaziou <address@hidden> writes:

> Kyle Meyer <address@hidden> 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.

OK, I'll have a closer look at which org-call-with-arg calls are
unnecessary.

> 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.

True, at the very least, the prompt is confusingly phrased, but it's
probably an indication that the intended interface wasn't fully
implemented.

>> 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.

The interactive caller is certainly losing functionality, but my guess
was that sort-subr's default behavior is sufficient for handling the
keys returned by most custom key functions.  Probably a bad guess.

-- 
Kyle



reply via email to

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