unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: dalanicolai <dalanicolai@gmail.com>
To: Stefan Kangas <stefan@marxist.se>
Cc: 51371@debbugs.gnu.org
Subject: bug#51371: 28.0.50; [PATCH] Make list-colors-display sorting support general
Date: Sun, 24 Oct 2021 15:16:12 +0200	[thread overview]
Message-ID: <CACJP=3nrDng5Pmxv2LYJ6UNdXo6R4myDp_YfMNonaYVArAbwnw@mail.gmail.com> (raw)
In-Reply-To: <CADwFkmmQLXMHgzf15_bV99A_svznVCTirFiqn7Mv99DfuUQ7hA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

(@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 <stefan@marxist.se> wrote:

> dalanicolai <dalanicolai@gmail.com> 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?
>

[-- Attachment #2: Type: text/html, Size: 1793 bytes --]

  reply	other threads:[~2021-10-24 13:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-24  9:35 bug#51371: 28.0.50; [PATCH] Make list-colors-display sorting support general dalanicolai
2021-10-24 12:47 ` Stefan Kangas
2021-10-24 13:16   ` dalanicolai [this message]
2021-10-24 13:18     ` dalanicolai
2021-10-24 22:08     ` Stefan Kangas
2021-10-25 21:46       ` dalanicolai
2021-10-30 15:40         ` Stefan Kangas

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CACJP=3nrDng5Pmxv2LYJ6UNdXo6R4myDp_YfMNonaYVArAbwnw@mail.gmail.com' \
    --to=dalanicolai@gmail.com \
    --cc=51371@debbugs.gnu.org \
    --cc=stefan@marxist.se \
    /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.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).