From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.bugs Subject: bug#51371: 28.0.50; [PATCH] Make list-colors-display sorting support general Date: Sun, 24 Oct 2021 15:18:40 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000db383105cf191515" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34692"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51371@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 24 15:20:57 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1medQn-0008oF-7n for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 15:20:57 +0200 Original-Received: from localhost ([::1]:54958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1medQl-0000XA-Uz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 09:20:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1medPv-0000X2-G8 for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 09:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1medPv-0002gd-7t for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 09:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1medPv-0006bc-2Y for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 09:20:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dalanicolai Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 13:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51371 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51371-submit@debbugs.gnu.org id=B51371.163508154325298 (code B ref 51371); Sun, 24 Oct 2021 13:20:03 +0000 Original-Received: (at 51371) by debbugs.gnu.org; 24 Oct 2021 13:19:03 +0000 Original-Received: from localhost ([127.0.0.1]:38176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1medOx-0006Zx-2e for submit@debbugs.gnu.org; Sun, 24 Oct 2021 09:19:03 -0400 Original-Received: from mail-vk1-f174.google.com ([209.85.221.174]:37791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1medOr-0006ZP-Ok for 51371@debbugs.gnu.org; Sun, 24 Oct 2021 09:19:01 -0400 Original-Received: by mail-vk1-f174.google.com with SMTP id j12so3853255vka.4 for <51371@debbugs.gnu.org>; Sun, 24 Oct 2021 06:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TuyNnIpO/7RHokArf+AmE5n586nVSs/Uon57O4q93eU=; b=HUbSa3a8rZ906YCCRdm09uhFvfBVS9bftHR//wx+kyFyza4lNViTPUyeyO6JXZSZq6 LN/28j13/CB+Tms5ToOmkrnOeVXF4J/QlrNgOGUTf5mVacyqTtReJp0T70sdzJ37+NN2 zFXZXCncMaHcn099+K+PPlSryHAhSPVMT5exjdjC3Lw3DhH831VY32KsqAq9ISHTPKbB 3ImFnkzeoXeoxfsXjaRzZeIP2/lJ5Ru3n8G97cOaqLDKKFsvYvH24AOcRsgUQUHXo/WJ Do5r+zsXOe30BR87nDvRGMXL6oN3Hmo86a2uXAVFAG3m1AS9dXN5lgwimozWGTBpQncz Ekuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TuyNnIpO/7RHokArf+AmE5n586nVSs/Uon57O4q93eU=; b=egW+8w+h6aCs/iLcq0JrHhIBmP8kWsMbWcZwvReACEz/q3KHSWa+EmrsvxJ2fvKe9G 8YDCag9NjuhJBKV0YEtCqbyzGM46t2OYvpjZaxpTS0I7FrMnAJDJJiN8Q6E1++rR1y7f ha7/8h4kboLprSIok9XsGD4EiYbdzBH9ZNw2olB0T6PUz43BqvnmsgIvfU6oamjPZ51z ynVJb8rLXs5zDIYmCDOZqJ07m+Qonz02Bu+j1S9/SPDaV6TSRVnx3v5cpKLqCWVwME6h +gJ0kxT6rrk9tviEY/0WcMUuXwUb+mDb3WH9KFJ6NZaDfkZVR0ceVfEW69sfrBMApcmS L5IQ== X-Gm-Message-State: AOAM530/M/Ci/GwY2AirxC8LeG3KxFLrjVGftdZI7MMDGH3t3yR9Ultj 1i1mZH1mtKrC9iI+3kLlg8GbSP6iF4QHVYwrOq4= X-Google-Smtp-Source: ABdhPJwzzoRiSsCxFem1H+uvOoXv2Pj9QlQHrn5pqrb+FWlvrUNZyEtN3TtPUQuu2E+YhUeBrJ7R2H3UibdRBJ7Sn+w= X-Received: by 2002:a1f:f8c5:: with SMTP id w188mr5614278vkh.5.1635081531372; Sun, 24 Oct 2021 06:18:51 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218113 Archived-At: --000000000000db383105cf191515 Content-Type: text/plain; charset="UTF-8" The nil (again) without the quote of course On Sun, 24 Oct 2021 at 15:16, dalanicolai wrote: > (@stefan Did not notice it was a group message) > > Not really, I think. But if so then I guess we could just call it with > list-colors-sort set to nil: > ``` > (let ((list-colors-sort 'nil)) > (list-colors-display (mapcar #'car shr-color-html-colors-alist) > nil)) > ``` > > > > On Sun, 24 Oct 2021 at 14:47, Stefan Kangas wrote: > >> dalanicolai writes: >> >> > The snippet passes colors form the shr-color-html-colors-alist variable >> > to list-colors-display. However, currently, despite the docstring >> > suggesting to me something different, the list-colors-display function >> > only applies its sort functionality if no list is passes as argument. >> > I don't see a good reason for that limitation, because the limitation is >> > set using a when condition, while the sort function works perfectly fine >> > with custom color-lists (e.g. try the snippet above). >> > >> > So this patch simply removes the (when (null list)) condition, and >> > passes the list, if given, to the sort functionality. >> > Adapting the docstring is not necessary as it already suggests that >> the sort functionality works in general. >> >> Is there any situation in which you wouldn't want the list sorted? >> > --000000000000db383105cf191515 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The nil (again) without the quote of course

On Sun, 24 Oct = 2021 at 15:16, dalanicolai <dal= anicolai@gmail.com> wrote:
(@stefan Did not notice it was a gr= oup message)

Not really, I think. But if so t= hen I guess we could just call it with list-colors-sort set to nil:
```
(let ((list-colors-sort 'nil))
=C2=A0 (list-colors-= display (mapcar #'car shr-color-html-colors-alist)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0nil))
```



On Sun, 24 Oct 2021 at = 14:47, Stefan Kangas <stefan@marxist.se> wrote:
dalanicolai <dalanicolai@gmail.com> writes:

> The snippet passes colors form the shr-color-html-colors-alist variabl= e
> to list-colors-display. However, currently, despite the docstring
> suggesting to me something different, the list-colors-display function=
> only applies its sort functionality if no list is passes as argument.<= br> > I don't see a good reason for that limitation, because the limitat= ion is
> set using a when condition, while the sort function works perfectly fi= ne
> with custom color-lists (e.g. try the snippet above).
>
> So this patch simply removes the (when (null list)) condition, and
> passes the list, if given, to the sort functionality.
> Adapting the docstring is not necessary as it already suggests that th= e=C2=A0 sort functionality works in general.

Is there any situation in which you wouldn't want the list sorted?
--000000000000db383105cf191515--