emacs-orgmode
[Top][All Lists]
Advanced

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

Re: sorting plain list while making - equal spc [was Re: [O] About org-s


From: Samuel Wales
Subject: Re: sorting plain list while making - equal spc [was Re: [O] About org-sort -> org-sort-list with custom sort function]
Date: Sat, 9 Jul 2022 21:09:05 -0700

miraculously i made a buggy solution for myself only.  it might sort
wrong if you have [-] in rest of line.

so fwiw.  in org-list.el.

for anybody who is searching for same thing:

                   ((= dcst ?x) (or (and (stringp (match-string 1))
                                          (replace-regexp-in-string "\\[-\\]"
                                                                   "[ ]"
                                                                   ;;
"  - [X] whatever")
                                                                   ;;
"  - [ ] whatever")
                                                                   ;;
"  - [-] whatever")

(match-string 1)))


On 7/1/22, Samuel Wales <samologist@gmail.com> wrote:
> i am confused by the custom sorting function for plain
> lists.  are there examples?  [note: still on maint.]
>
> i want to ignore [-] for sorting by checked.  it can be equal to [ ].
> i don't need it to be custom but that seems available.
>
> a rationale and possible interesting solutions are below, but i'm ok
> with anything.  current x/X is always flawed for me.
>
>
> rationale:
>
> suppose you have a long list like
>
> - [ ] hello
>   + [ ] hi
>   + [ ] greetings
> ... [long list]
>
> suppose you mark greetings as [X] with c-c c-c, at least with my
> settings, hello will become [-] to indicate "partly X".
>
> suppose hello is still high priority.  but you don't notice it's there
> because you use very large fonts and it is not on the same page.  it's
> in the middle.  you keep your list in priority sequence.  you have at
> the top something like
>
> - [ ] bonjour
> - [ ] some kind of greeting
> ...
>
> and most are spc like that and - is rare.  suppose you mark bonjour X
> with c-c c-c.  now it is in your face and you want to move it down.
> so you sort by checked.  now it is out of your face.  but you didn't
> notice that your hello moved down also.
>
> this isn't particularly a bug; it is just that - is part of sorting
> and it is hardcoded to be below SPC [i think].
>
> so hello gets moved down a whoooooooooooooole lot.  its place in the
> list is gone.  you aren't even looking at the bottom of hte list
> because it is so long.  it is as if hello has disappeared.
>
> and this is because you marked a sub-item as X.  and then sorted the
> top level by checked.  and didn't notice.
>
> so i'm thinking this is a feature that could cause unexpected results.
> [because it did that to me.  existence proof.]
>
> and there's nothing really wrong with existing semantics, but i'd want
> - to be ignored in sorting, because of the above.
>
> i can think of some possible solutions.  for example
>
> - have something like an x X command that makes - eqal to spc or
> custom variable for sorting with ability to specify '(?   ?x) thus
> ignoring ?-.
> - have a command that moves all X to a sibling header so you don't
> need sorting to get X out of your face
> - have the possibility of this all working on sublists too
>
>
> [i kinda want all....  there are more ideas.  please do not shoot me
> or say i am destroying the spirit and letter of org and the milky way
> galaxy.  these are just brainstorms.  possibilities to possibly
> consider, not analyzed to perfection.]
>
> thanks!
>
>
> On 5/8/17, Kyle Meyer <kyle@kyleam.com> wrote:
>> Kyle Meyer <kyle@kyleam.com> writes:
>>
>>> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>>>
>>>> The we may not need `call-interactively' at all.
>>>>
>>>> WDYT?
>>>
>>> Yeah, I agree that there's no need for call-interactively here because
>>> the interactive forms of org-table-sort-lines, org-sort-list,
>>> org-sort-entries are covered by org-sort's.
>>>
>>> Switched call-interactively to funcall in c1addc825.
>>
>> Ehh, I should have looked more closely at org-table-sort-lines.  Unlike
>> org-sort-entries and org-sort-list, it uses called-interactively-p to
>> determine whether it should prompt the user.  I've put the
>> org-call-with-arg back, at least for now.
>>
>> --
>> Kyle
>>
>>
>
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



reply via email to

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