emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: emacs-orgmode@gnu.org
Cc: Kyle Meyer <kyle@kyleam.com>,
	Nicolas Goaziou <mail@nicolasgoaziou.fr>,
	 Zhitao Gong <zhitaao.gong@gmail.com>
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	[thread overview]
Message-ID: <CAJcAo8vUUQgOo7Wr3R2KpkhfBwZoYD=0QRDTGfYwwkFSeafnkw@mail.gmail.com> (raw)
In-Reply-To: <CAJcAo8u7uw6=o-6=zrO9Kh_JJCxQxnOx75Wo1MkVO0rirNz8Qg@mail.gmail.com>

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	other threads:[~2022-07-10  4:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJcAo8vUUQgOo7Wr3R2KpkhfBwZoYD=0QRDTGfYwwkFSeafnkw@mail.gmail.com' \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    --cc=mail@nicolasgoaziou.fr \
    --cc=zhitaao.gong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).