emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* sorting plain list while making - equal spc [was Re: [O] About org-sort -> org-sort-list with custom sort function]
@ 2022-07-02  4:25 Samuel Wales
  2022-07-10  4:09 ` Samuel Wales
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Wales @ 2022-07-02  4:25 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Kyle Meyer, Nicolas Goaziou, Zhitao Gong

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sorting plain list while making - equal spc [was Re: [O] About org-sort -> org-sort-list with custom sort function]
  2022-07-02  4:25 sorting plain list while making - equal spc [was Re: [O] About org-sort -> org-sort-list with custom sort function] Samuel Wales
@ 2022-07-10  4:09 ` Samuel Wales
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Wales @ 2022-07-10  4:09 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Kyle Meyer, Nicolas Goaziou, Zhitao Gong

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-10  4:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-02  4:25 sorting plain list while making - equal spc [was Re: [O] About org-sort -> org-sort-list with custom sort function] Samuel Wales
2022-07-10  4:09 ` Samuel Wales

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).