From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mLiVNxBRymLBmAAAbAwnHQ (envelope-from ) for ; Sun, 10 Jul 2022 06:09:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AOVvNxBRymL8WwEAauVa8A (envelope-from ) for ; Sun, 10 Jul 2022 06:09:52 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4CEB1C4D3 for ; Sun, 10 Jul 2022 06:09:52 +0200 (CEST) Received: from localhost ([::1]:34144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAOGU-0006xb-Vs for larch@yhetil.org; Sun, 10 Jul 2022 00:09:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAOFr-0006xB-L1 for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 00:09:11 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:36853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAOFp-0007qh-Nf for emacs-orgmode@gnu.org; Sun, 10 Jul 2022 00:09:11 -0400 Received: by mail-lf1-x133.google.com with SMTP id f39so3792652lfv.3 for ; Sat, 09 Jul 2022 21:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lOzjHxvtQyt6aSrRmszqDk6WiTpUUkhOla11VcCFy0U=; b=M50a1RX+TUpTnA7fyCFMcGZT3CpDUcKd55oaz2/AvvFKI9YTFHhnPONWbUBmG48hrO i65cUoIQRksZ/jcYrHUpgB7rFc8K0oNvfrjV55Z4nRj/eyvRYTKbHdVLRfPMYMifNEL8 31hcPDxnKT+YS0LU7oOXJkhuiI4i9f/SyXq+mcw4HV6dxcp/1gYjYRw0d2CpW97aO9s3 xDNXt0VfxW44pImnn+pz96wH1CudeiqmHzpHZUKVOS/Ul+R1oXDP6pnX0BuSTruTwUx7 MhXVnw8piWMOMXp3j3wh1wCDrDEjCh8p57Q6jxkDwY1RNU6xmRaWlpEDQcXzHRPC9i/H BnNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lOzjHxvtQyt6aSrRmszqDk6WiTpUUkhOla11VcCFy0U=; b=YKE7Dyx7HFipBH5660xKYK8bXrQgZhI9kAALiuJ4V/gOr30PA+DSNy+aLioKZUklzJ zfNxBkWLWeo6vzZbDcn+x1k7uRRp3TNj8JB3sc+RzGwG5GyEBy+H0l7nHtpmNf4CHwqi rdv55y6aS2MekB7qvCce2jeHbHlCrsBoSg/Apl+LWtNznaJqDVk5x1cc7PXcUzadnhn5 i57gnJKSsehOTK+2doL5vsxLdguYYUzgm2w/IbjD4Gw88Zcq8Y5qnZeX6LOcoyMwmGpt Um4cF9MxZaz1Cp/tvAuh3mG02ECBZcx3fkJ5Ir16DIywmgzWH9l2rxS/xT+OjxexiMJt IYuQ== X-Gm-Message-State: AJIora8AOQxyAahyMDBdGGlHyM5MLQLpwVHR21jrzfc+2x3MqFrtuJ1K GyRqWcwx6GxP0rqP24QYxYyV5sQpvTPTQVsJbootPMJlFQxKRQ== X-Google-Smtp-Source: AGRyM1twhP2+fT59uyoiW/e740upocal/QvwXzfJz98bEdf2naENjI5gGgThm9Bu7agJJ5BAE53PQlMQkD/hOCfn7O8= X-Received: by 2002:a05:6512:e90:b0:489:cd56:4610 with SMTP id bi16-20020a0565120e9000b00489cd564610mr4040565lfb.483.1657426146514; Sat, 09 Jul 2022 21:09:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6520:2432:b0:1f7:d9f7:61a with HTTP; Sat, 9 Jul 2022 21:09:05 -0700 (PDT) In-Reply-To: References: From: Samuel Wales Date: Sat, 9 Jul 2022 21:09:05 -0700 Message-ID: Subject: Re: sorting plain list while making - equal spc [was Re: [O] About org-sort -> org-sort-list with custom sort function] To: emacs-orgmode@gnu.org Cc: Kyle Meyer , Nicolas Goaziou , Zhitao Gong Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=samologist@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657426192; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=lOzjHxvtQyt6aSrRmszqDk6WiTpUUkhOla11VcCFy0U=; b=uIoRcgNG3phajMevZwcJBsoVOBk7R+k+PBKlpUcLh8cCJWSr3nEBfsDVhZ1Hrb4FQMNDnh PzIutz2Onqh2jkots1jHfPcVrWbxELAb42jOYHP1Z0o9f3BZAEAkwZ6ZyPa+FeJhKhioA9 eswgPCBrktAfaDu3gyXnEyAi8WQEL9kyQC+9Aro/taT6VL0slwxOZHYdLxMV/y69zSQ6sm of9/kevbFkqf0hGLt0OFUZDZEy22qn7mOMTYMepMcJE27k2AvPCtcWnnK7qMsEnvAk9YYv MGwJ/Uyh3UuBO9qtO9V22gzTIU+VFPm55ub/EiKeVOo01jrKXSQzPayU4akw8w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657426192; a=rsa-sha256; cv=none; b=tOobJSSCeQkCSlfA3XKgJ8+yDmsH8Yf5K3UTQ+ZM5cYXZVka7C3n7nSXyTaInTdfKlJ/VU UPKJD5RW9sAZove8IBF2FAM1RaZQ4V8bgN04nMBv8RpJHEhc57At4/pET2C53aNjzsS31t Tqd8/Q6b05nh1WqeolPBp8mfv0NedBhGlVXsDPgTrszMvuAePJFLMtJJwR3guPM6SZq95P hVMmWziy5ubr6k6QM/a6C/Vs5gc/cR5t91V/JgOvFGcmCJTaZrLehrTPA/2FMntoa6mtu7 D/LejkfuyOJkbgB83BJm7oTnJTHYsf77Xc/z9zbwGSK1ZDXbGZxYzZ6TaU5fMw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=M50a1RX+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=M50a1RX+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4CEB1C4D3 X-Spam-Score: -2.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: +9W3x/YH0LIZ 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 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 wrote: >> Kyle Meyer writes: >> >>> Nicolas Goaziou 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