Ihor Radchenko <yanta...@posteo.net> writes:

> Ihor Radchenko <yanta...@posteo.net> writes:
>
>>> Fallback to `org-sort-function'.
>>
>> I am not sure if it is the best idea to hard-code using
>> `org-sort-function' here.
>>
>> What if a user wants specific `org-sort-function' for, say, table
>> sorting, but something else for tags?
>> Secondary sorting would better be customizeable.
>>
>> Maybe you can have a function generator that will work like
>>
>> (org-tags-sort-hierarchy-by org-sort-function)
>> or
>> (org-tags-sort-hierarchy-by #'string<)
>
> Morgan, may I know if you are still interested to finish the patch?

Yes I am very interested in finishing this patch.  Has it been 10 months
since I started this already?  Oh how time flys!

I hit a roadblock trying to figure out how best to implement your
suggestion.

After running something like this:

(setopt org-tags-sort-function (org-tags-sort-hierarchy-by
                                org-sort-function))

The help buffer for `org-tags-sort-function' displays a lambda as the
value which isn't very helpful.  It also isn't conducive to users using
the customize interface (I think?  I'm not going to pretend I actually
use that thing).

I wanted to set up a default named function that used org-sort-function.
I was playing around with defalias to generate that function and copy
the docstring but I think that was very hacky and I can't seem to get it
to work with the latest Emacs.

At that point it got put on my backburner and it hasn't been worked on
since :P

Looking into it now it looks like an oclosure would be an interesting
way to implement this.  However, I don't think those got backported to
older emacsen so I guess that's out.

Maybe I'm thinking too hard about this but it feels to me like it should
be a solved problem.  How would you do this?

Reply via email to