Re: [PATCH] `compopt -o nosort` with duplicates intact

Chet Ramey <[email protected]>
Newsgroups gmane.comp.shells.bash.bugs
Organization ITS, Case Western Reserve University
Message-ID <[email protected]>
On 2/22/26 9:18 AM, [email protected] wrote:
> Hello!
> 
> I have a completion function where I want the list of completions to
> match COMPREPLY exactly. No sorting or deduplicating.
> 
> I thought compopt -o nosort would disable both. 

Why?

> Turned out that the
> deduplication is only disabled for *non-adjacent* entries. Adjacent
> duplicates are still folded into one.

Yes, that's what the readline variable your patch modifies controls.
It doesn't really have much to do with sorting, though -- sorting just
orders the duplicates together.

> Duplicates in this context are not a sign of a mistake, they are all
> a valid choice.

OK, so it sounds like you are requesting a new compopt option to manage
the value of the separate readline variable (something like `nodups' or
`nodedup'). I'll consider it for a future version.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc (application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE-----

wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCaZxpIAUDAAAAAAAKCRC7WGnwZOp0q3pQ
AJ9D9hiWXu/dS+x4uBxxvez6A5HspgCfTwcbCH2ktaY1gko5pMrUP6GyrYo=
=LF7d
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.