bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64656: 29.0.91; Doc of minibuffer histories and completing-read - au


From: Eli Zaretskii
Subject: bug#64656: 29.0.91; Doc of minibuffer histories and completing-read - automatic addition of completions to DEFAULT list
Date: Fri, 10 Nov 2023 10:15:45 +0200

> From: Juri Linkov <juri@linkov.net>
> Cc: drew.adams@oracle.com,  64656@debbugs.gnu.org
> Date: Fri, 10 Nov 2023 09:45:02 +0200
> 
> >> A recipe is to customize `completions-sort' to nil ("No sorting"),
> >> then first call `M-& ls -U RET' and afterwards `C-x C-f TAB TAB'
> >> and compare the contents of two buffers *Async Shell Command*
> >> and *Completions*.  The order of files is reversed.
> >
> > OK, I see it now, thanks.
> >
> > But IMO this raises several issues:
> >
> >   . completions-sort affects all completions, not just completions of
> >     file names, right?  So why the change only for file names?
> 
> I'm trying various completions after customizing completions-sort to nil,
> so currently noticed a problem in the completions of file names.

So you agree that the problem is wider than that?

> >   . who said that the order we get file names from readdir is the
> >     "unsorted order", and not its reverse?
> 
> 'readdir' returns the order of the file system,

That is not true in general.  For example, on MS-Windows, it returns
the file names in alphabetical order.  In general, we don't know what
is the relation between the order in which readdir returns file names
and the order of the file entries in the directory on disk, as that is
an implementation detail.

> >   . in any case, I think we should reverse only when completions-sort
> >     is nil, because otherwise we could adversely affect the sorting
> >     performed on the results
> 
> This means bringing 'Qcompletions_sort' to 'file_name_completion'?

Yes.

> Probably not worth the trouble.

Why not?  It's just a single simple test.

> Better to declare the value nil of `completions-sort' as
> unsupported.

I don't see why.

> Anyway this was just an experiment to see how useful is the
> no sorting option for completions.
> 
> And the conclusion is that it's useful only for part of completion types,
> and not useful for others.  It's useless for obarray and file names.

I added Stefan to this discussion, in case he has an opinion or
comments.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]