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

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

bug#58447: [PATCH] In project-find-file, add absolute file name to histo


From: Augusto Stoffel
Subject: bug#58447: [PATCH] In project-find-file, add absolute file name to history
Date: Thu, 27 Oct 2022 19:48:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

On Thu, 27 Oct 2022 at 20:34, Dmitry Gutov wrote:

> On 27.10.2022 19:53, Augusto Stoffel wrote:
>> On Thu, 27 Oct 2022 at 19:48, Dmitry Gutov wrote:
>> 
>>> On 27.10.2022 19:37, Augusto Stoffel wrote:
>>>> The patch in my original message fixes this and shouldn't complicate a
>>>> future implementation of the per-project histories.
>>> OK. Are you sure that it doesn't add the relative name to the history still?
>>>
>>> AFAIU as long as hist is passed to project--completing-read-strict,
>>> the completing-read call in there will alter the history first.
>> Note that history-add-new-input is bound to nil at the appropriate
>> place in the patch.
>
> Ah, ok.
>
> But how is completing-read using the history var? Only reading past
> inputs?

Yes, completing-read will make past inputs available for selection but
not updated the history variable.  Then, a couple lines later in the
patch, we update the history manually:

    (when (and hist history-add-new-input)
      (add-to-history hist absname))

> Can it handle the absolute values there?

The completing read reads a file name, the relname; if it's relative,
then it's expanded to an absolute name (the absname).  If for whatever
reason the relname was already absolute, then absname will be equal to
relname (what else could you do, right?)





reply via email to

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