GNU bug report logs - #66114
[PATCH] Fix interactive prompt for selecting checkout directory

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Wed, 20 Sep 2023 07:07:02 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66114 in the body.
You can then email your comments to 66114 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to philipk <at> posteo.net, bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Wed, 20 Sep 2023 07:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joseph Turner <joseph <at> breatheoutbreathe.in>:
New bug report received and forwarded. Copy sent to philipk <at> posteo.net, bug-gnu-emacs <at> gnu.org. (Wed, 20 Sep 2023 07:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix interactive prompt for selecting checkout directory
Date: Wed, 20 Sep 2023 00:02:43 -0700
[Message part 1 (text/plain, inline)]
Tags: patch

This patch fixes the interactive prompt in package-vc-checkout. See
commit message for details.

[0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Wed, 20 Sep 2023 07:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 66114 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: 66114 <at> debbugs.gnu.org
Subject: Re: bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for
 selecting checkout directory)
Date: Wed, 20 Sep 2023 00:24:04 -0700
[Message part 1 (text/plain, inline)]
In this updated patch, I didn't not remove a double negative.

[0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Wed, 20 Sep 2023 07:33:02 GMT) Full text and rfc822 format available.

Message #11 received at 66114 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: 66114 <at> debbugs.gnu.org
Subject: Re: bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for
 selecting checkout directory)
Date: Wed, 20 Sep 2023 00:31:21 -0700
[Message part 1 (text/plain, inline)]
Oops! I forgot how contrapositives work for a moment.

Please ignore the previous two patches.

[0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Fri, 22 Sep 2023 08:22:02 GMT) Full text and rfc822 format available.

Message #14 received at 66114 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: 66114 <at> debbugs.gnu.org
Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting
 checkout directory
Date: Fri, 22 Sep 2023 08:21:41 +0000
Joseph Turner <joseph <at> breatheoutbreathe.in> writes:

> Tags: patch
>
> This patch fixes the interactive prompt in package-vc-checkout. See
> commit message for details.
>
> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
> Date: Tue, 19 Sep 2023 23:58:43 -0700
> Subject: [PATCH] Fix interactive prompt for selecting checkout directory
>
> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
> read-directory-name instead of read-file-name with
> predicate.  Previously, it was impossible to interactively navigate to
> a nested subdirectory.

I can "navigate" into whatever directory I want, but I don't get completion.

> ---
>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index c7a30736e32..29b540d86b8 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>  `:last-release' (interactively, the prefix argument), that stands
>  for the last released version of the package."
>    (interactive
> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
> -     (list (cadr (assoc name package-archive-contents #'string=))
> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
> -                           (lambda (dir) (or (not (file-exists-p dir))
> -                                             (directory-empty-p dir))))
> -           (and current-prefix-arg :last-release))))
> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
> +          (desc (cadr (assoc name package-archive-contents #'string=)))
> +          (dir (read-directory-name "Clone into new or empty directory: ")))
> +     (unless (or (not (file-exists-p dir))
> +                 (directory-empty-p dir))
> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
> +         (if (and (not (file-exists-p subdir))
> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
> +             (setf dir subdir)

I'd prefer to use a setq here.

> +           (user-error "Directory not empty: %S" (expand-file-name dir)))))

This seems like an anti-feature to me, because you need to know what
directory is empty before confirming your choice, and if it is not
empty, you have to restart the entire command again.

> +     (list desc dir (and current-prefix-arg :last-release))))
>    (package-vc--archives-initialize)
>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>                        (and-let* ((extras (package-desc-extras pkg-desc))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Sun, 24 Sep 2023 05:22:02 GMT) Full text and rfc822 format available.

Message #17 received at 66114 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 66114 <at> debbugs.gnu.org
Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting
 checkout directory
Date: Sat, 23 Sep 2023 22:06:06 -0700
Philip Kaludercic <philipk <at> posteo.net> writes:

> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>
>> Tags: patch
>>
>> This patch fixes the interactive prompt in package-vc-checkout. See
>> commit message for details.
>>
>> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001
>> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
>> Date: Tue, 19 Sep 2023 23:58:43 -0700
>> Subject: [PATCH] Fix interactive prompt for selecting checkout directory
>>
>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
>> read-directory-name instead of read-file-name with
>> predicate.  Previously, it was impossible to interactively navigate to
>> a nested subdirectory.
>
> I can "navigate" into whatever directory I want, but I don't get completion.

You're right.

>> ---
>>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>>  1 file changed, 11 insertions(+), 6 deletions(-)
>>
>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>> index c7a30736e32..29b540d86b8 100644
>> --- a/lisp/emacs-lisp/package-vc.el
>> +++ b/lisp/emacs-lisp/package-vc.el
>> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>>  `:last-release' (interactively, the prefix argument), that stands
>>  for the last released version of the package."
>>    (interactive
>> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
>> -     (list (cadr (assoc name package-archive-contents #'string=))
>> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
>> -                           (lambda (dir) (or (not (file-exists-p dir))
>> -                                             (directory-empty-p dir))))
>> -           (and current-prefix-arg :last-release))))
>> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
>> +          (desc (cadr (assoc name package-archive-contents #'string=)))
>> +          (dir (read-directory-name "Clone into new or empty directory: ")))
>> +     (unless (or (not (file-exists-p dir))
>> +                 (directory-empty-p dir))
>> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
>> +         (if (and (not (file-exists-p subdir))
>> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
>> +             (setf dir subdir)
>
> I'd prefer to use a setq here.
>
>> +           (user-error "Directory not empty: %S" (expand-file-name dir)))))
>
> This seems like an anti-feature to me, because you need to know what
> directory is empty before confirming your choice, and if it is not
> empty, you have to restart the entire command again.

Yes, I agree.

IIUC, we want to read from the user a directory which is either
nonexistent or empty.  However, we also want the completions to include
non-empty directories so that the user can easily select a deeply nested
directory.  The current solution does not offer non-empty directories for
completions, meaning that users must manually type in a potentially long
path to a nested empty or nonexistent directory.

Here's a different idea I tried:

(read-file-name "Clone into new or empty directory: " nil nil
                ;; Must match a nonexistent or empty directory
                (lambda (dir) (or (not (file-exists-p dir))
                                  (directory-empty-p dir)))
                nil
                ;; `read-directory-name' accepts no PREDICATE
                ;; argument: hack `read-file-name' instead.
                (lambda (file-name) (file-directory-p file-name)))

but this erroneously returns the default filename, which might be
buffer-file-name or whatever string is currently in the minibuffer.

I would have expected that when MUSTMATCH is a function and it returns
nil, a "[Match required]" message would appear.  However, the behavior of
read-file-name is unspecified when a MUSTMATCH function returns nil:

- a function, which will be called with the input as the
  argument.  If the function returns a non-nil value, the
  minibuffer is exited with that argument as the value.

Is this a bug, a case of under-documentation, or do I misunderstand something?

I'm happy to post this in a separate bug thread if you think it's worth it.

Joseph

>> +     (list desc dir (and current-prefix-arg :last-release))))
>>    (package-vc--archives-initialize)
>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>                        (and-let* ((extras (package-desc-extras pkg-desc))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Sun, 24 Sep 2023 14:38:02 GMT) Full text and rfc822 format available.

Message #20 received at 66114 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: 66114 <at> debbugs.gnu.org
Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting
 checkout directory
Date: Sun, 24 Sep 2023 16:37:11 +0200
Joseph Turner <joseph <at> breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>>
>>> Tags: patch
>>>
>>> This patch fixes the interactive prompt in package-vc-checkout. See
>>> commit message for details.
>>>
>>> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001
>>> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
>>> Date: Tue, 19 Sep 2023 23:58:43 -0700
>>> Subject: [PATCH] Fix interactive prompt for selecting checkout directory
>>>
>>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
>>> read-directory-name instead of read-file-name with
>>> predicate.  Previously, it was impossible to interactively navigate to
>>> a nested subdirectory.
>>
>> I can "navigate" into whatever directory I want, but I don't get completion.
>
> You're right.
>
>>> ---
>>>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>>>  1 file changed, 11 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>>> index c7a30736e32..29b540d86b8 100644
>>> --- a/lisp/emacs-lisp/package-vc.el
>>> +++ b/lisp/emacs-lisp/package-vc.el
>>> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>>>  `:last-release' (interactively, the prefix argument), that stands
>>>  for the last released version of the package."
>>>    (interactive
>>> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
>>> -     (list (cadr (assoc name package-archive-contents #'string=))
>>> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
>>> -                           (lambda (dir) (or (not (file-exists-p dir))
>>> -                                             (directory-empty-p dir))))
>>> -           (and current-prefix-arg :last-release))))
>>> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
>>> +          (desc (cadr (assoc name package-archive-contents #'string=)))
>>> +          (dir (read-directory-name "Clone into new or empty directory: ")))
>>> +     (unless (or (not (file-exists-p dir))
>>> +                 (directory-empty-p dir))
>>> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
>>> +         (if (and (not (file-exists-p subdir))
>>> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
>>> +             (setf dir subdir)
>>
>> I'd prefer to use a setq here.
>>
>>> +           (user-error "Directory not empty: %S" (expand-file-name dir)))))
>>
>> This seems like an anti-feature to me, because you need to know what
>> directory is empty before confirming your choice, and if it is not
>> empty, you have to restart the entire command again.
>
> Yes, I agree.
>
> IIUC, we want to read from the user a directory which is either
> nonexistent or empty.  However, we also want the completions to include
> non-empty directories so that the user can easily select a deeply nested
> directory.  The current solution does not offer non-empty directories for
> completions, meaning that users must manually type in a potentially long
> path to a nested empty or nonexistent directory.

It is funny to me, that I probably never noticed this issue because I
have the habit of using hippie-expand to complete partial file names,
including in the minibuffer :)

> Here's a different idea I tried:
>
> (read-file-name "Clone into new or empty directory: " nil nil
>                 ;; Must match a nonexistent or empty directory
>                 (lambda (dir) (or (not (file-exists-p dir))
>                                   (directory-empty-p dir)))
>                 nil
>                 ;; `read-directory-name' accepts no PREDICATE
>                 ;; argument: hack `read-file-name' instead.
>                 (lambda (file-name) (file-directory-p file-name)))
>
> but this erroneously returns the default filename, which might be
> buffer-file-name or whatever string is currently in the minibuffer.

An issue I am observing, is that it allows selecting non-empty
directories.

> I would have expected that when MUSTMATCH is a function and it returns
> nil, a "[Match required]" message would appear.  

For the record, what completion system are you using.  I don't appear to
see this message at all.

>                                                  However, the behavior of
> read-file-name is unspecified when a MUSTMATCH function returns nil:
>
> - a function, which will be called with the input as the
>   argument.  If the function returns a non-nil value, the
>   minibuffer is exited with that argument as the value.
>
> Is this a bug, a case of under-documentation, or do I misunderstand something?
>
> I'm happy to post this in a separate bug thread if you think it's worth it.

Perhaps that would be worth doing, that way the people who know more
about completion than I do would be more likely to see it and help out.

>
> Joseph
>
>>> +     (list desc dir (and current-prefix-arg :last-release))))
>>>    (package-vc--archives-initialize)
>>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>>                        (and-let* ((extras (package-desc-extras pkg-desc))

-- 
Philip Kaludercic




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Sun, 24 Sep 2023 21:31:01 GMT) Full text and rfc822 format available.

Message #23 received at 66114 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 66114 <at> debbugs.gnu.org
Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting
 checkout directory
Date: Sun, 24 Sep 2023 14:27:53 -0700
Philip Kaludercic <philipk <at> posteo.net> writes:

> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>
>> Philip Kaludercic <philipk <at> posteo.net> writes:
>>
>>> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>>>
>>>> Tags: patch
>>>>
>>>> This patch fixes the interactive prompt in package-vc-checkout.
>>>> See
>>>> commit message for details.
>>>>
>>>> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00
>>>> 2001
>>>> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
>>>> Date: Tue, 19 Sep 2023 23:58:43 -0700
>>>> Subject: [PATCH] Fix interactive prompt for selecting checkout
>>>> directory
>>>>
>>>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
>>>> read-directory-name instead of read-file-name with
>>>> predicate. Previously, it was impossible to interactively navigate
>>>> to
>>>> a nested subdirectory.
>>>
>>> I can "navigate" into whatever directory I want, but I don't get
>>> completion.
>>
>> You're right.
>>
>>>> ---
>>>>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>>>>  1 file changed, 11 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>>>> index c7a30736e32..29b540d86b8 100644
>>>> --- a/lisp/emacs-lisp/package-vc.el
>>>> +++ b/lisp/emacs-lisp/package-vc.el
>>>> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>>>>  `:last-release' (interactively, the prefix argument), that stands
>>>>  for the last released version of the package."
>>>>    (interactive
>>>> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
>>>> -     (list (cadr (assoc name package-archive-contents #'string=))
>>>> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
>>>> -                           (lambda (dir) (or (not (file-exists-p dir))
>>>> -                                             (directory-empty-p dir))))
>>>> -           (and current-prefix-arg :last-release))))
>>>> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
>>>> +          (desc (cadr (assoc name package-archive-contents #'string=)))
>>>> +          (dir (read-directory-name "Clone into new or empty directory: ")))
>>>> +     (unless (or (not (file-exists-p dir))
>>>> +                 (directory-empty-p dir))
>>>> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
>>>> +         (if (and (not (file-exists-p subdir))
>>>> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
>>>> +             (setf dir subdir)
>>>
>>> I'd prefer to use a setq here.
>>>
>>>> + (user-error "Directory not empty: %S" (expand-file-name dir)))))
>>>
>>> This seems like an anti-feature to me, because you need to know
>>> what
>>> directory is empty before confirming your choice, and if it is not
>>> empty, you have to restart the entire command again.
>>
>> Yes, I agree.
>>
>> IIUC, we want to read from the user a directory which is either
>> nonexistent or empty. However, we also want the completions to
>> include
>> non-empty directories so that the user can easily select a deeply
>> nested
>> directory. The current solution does not offer non-empty directories
>> for
>> completions, meaning that users must manually type in a potentially
>> long
>> path to a nested empty or nonexistent directory.
>
> It is funny to me, that I probably never noticed this issue because I
> have the habit of using hippie-expand to complete partial file names,
> including in the minibuffer :)

Ah, that makes sense :)

>> Here's a different idea I tried:
>>
>> (read-file-name "Clone into new or empty directory: " nil nil
>>                 ;; Must match a nonexistent or empty directory
>>                 (lambda (dir) (or (not (file-exists-p dir))
>>                                   (directory-empty-p dir)))
>>                 nil
>>                 ;; `read-directory-name' accepts no PREDICATE
>>                 ;; argument: hack `read-file-name' instead.
>>                 (lambda (file-name) (file-directory-p file-name)))
>>
>> but this erroneously returns the default filename, which might be
>> buffer-file-name or whatever string is currently in the minibuffer.
>
> An issue I am observing, is that it allows selecting non-empty
> directories.
>
>> I would have expected that when MUSTMATCH is a function and it
>> returns
>> nil, a "[Match required]" message would appear.
>
> For the record, what completion system are you using. I don't appear
> to
> see this message at all.

I also do not see the message, but I expect to see it. I am using
vertico + orderless.

>>                                                  However, the behavior of
>> read-file-name is unspecified when a MUSTMATCH function returns nil:
>>
>> - a function, which will be called with the input as the
>>   argument.  If the function returns a non-nil value, the
>>   minibuffer is exited with that argument as the value.
>>
>> Is this a bug, a case of under-documentation, or do I misunderstand something?
>>
>> I'm happy to post this in a separate bug thread if you think it's worth it.
>
> Perhaps that would be worth doing, that way the people who know more
> about completion than I do would be more likely to see it and help
> out.

Okay, thanks! I'll do that.

>>
>> Joseph
>>
>>>> +     (list desc dir (and current-prefix-arg :last-release))))
>>>>    (package-vc--archives-initialize)
>>>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>>>                        (and-let* ((extras (package-desc-extras pkg-desc))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Wed, 07 Feb 2024 04:59:02 GMT) Full text and rfc822 format available.

Message #26 received at 66114 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Philip Kaludercic <philipk <at> posteo.net>, 66114 <at> debbugs.gnu.org
Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting
 checkout directory
Date: Tue, 30 Jan 2024 00:42:21 -0800
[Message part 1 (text/plain, inline)]
Joseph Turner <joseph <at> breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>>
>>>                                                  However, the behavior of
>>> read-file-name is unspecified when a MUSTMATCH function returns nil:
>>>
>>> - a function, which will be called with the input as the
>>>   argument.  If the function returns a non-nil value, the
>>>   minibuffer is exited with that argument as the value.
>>>
>>> Is this a bug, a case of under-documentation, or do I misunderstand something?
>>>
>>> I'm happy to post this in a separate bug thread if you think it's worth it.
>>
>> Perhaps that would be worth doing, that way the people who know more
>> about completion than I do would be more likely to see it and help
>> out.
>
> Okay, thanks! I'll do that.

Now that #66187
(<https://yhetil.org/emacs-bugs/87cytlqmqh.fsf <at> breatheoutbreathe.in/>)
and bug#68815
(<https://yhetil.org/emacs-bugs/8734ufyxoy.fsf <at> breatheoutbreathe.in/>)
are fixed on emacs-29, I'm revisiting this issue.

With the following patch, the interactive prompt in package-vc-checkout
now offers all directory for completion (empty or not), but only exits
when the minibuffer contains an empty directory or nonexistent filename.

Testing this patch requires checking out emacs-29 after e6c82fe35e3.

Thanks!

Joseph

[0001-Improve-package-vc-checkout-interactive-prompt-bug-6.patch (text/x-diff, attachment)]

Reply sent to Philip Kaludercic <philipk <at> posteo.net>:
You have taken responsibility. (Wed, 14 Feb 2024 16:55:01 GMT) Full text and rfc822 format available.

Notification sent to Joseph Turner <joseph <at> breatheoutbreathe.in>:
bug acknowledged by developer. (Wed, 14 Feb 2024 16:55:01 GMT) Full text and rfc822 format available.

Message #31 received at 66114-done <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: 66114-done <at> debbugs.gnu.org
Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting
 checkout directory
Date: Wed, 14 Feb 2024 16:54:15 +0000
Joseph Turner <joseph <at> breatheoutbreathe.in> writes:

> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>
>> Philip Kaludercic <philipk <at> posteo.net> writes:
>>
>>> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>>>
>>>>                                                  However, the behavior of
>>>> read-file-name is unspecified when a MUSTMATCH function returns nil:
>>>>
>>>> - a function, which will be called with the input as the
>>>>   argument.  If the function returns a non-nil value, the
>>>>   minibuffer is exited with that argument as the value.
>>>>
>>>> Is this a bug, a case of under-documentation, or do I misunderstand something?
>>>>
>>>> I'm happy to post this in a separate bug thread if you think it's worth it.
>>>
>>> Perhaps that would be worth doing, that way the people who know more
>>> about completion than I do would be more likely to see it and help
>>> out.
>>
>> Okay, thanks! I'll do that.
>
> Now that #66187
> (<https://yhetil.org/emacs-bugs/87cytlqmqh.fsf <at> breatheoutbreathe.in/>)
> and bug#68815
> (<https://yhetil.org/emacs-bugs/8734ufyxoy.fsf <at> breatheoutbreathe.in/>)
> are fixed on emacs-29, I'm revisiting this issue.
>
> With the following patch, the interactive prompt in package-vc-checkout
> now offers all directory for completion (empty or not), but only exits
> when the minibuffer contains an empty directory or nonexistent filename.
>
> Testing this patch requires checking out emacs-29 after e6c82fe35e3.

LGTM, I've pushed it to emacs-29.  Thanks!

> Thanks!
>
> Joseph




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66114; Package emacs. (Thu, 15 Feb 2024 17:29:01 GMT) Full text and rfc822 format available.

Message #34 received at 66114-done <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 66114-done <at> debbugs.gnu.org
Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting
 checkout directory
Date: Thu, 15 Feb 2024 10:27:20 -0700
Philip Kaludercic <philipk <at> posteo.net> writes:

> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>
>> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>>
>>> Philip Kaludercic <philipk <at> posteo.net> writes:
>>>
>>>> Joseph Turner <joseph <at> breatheoutbreathe.in> writes:
>>>>
>>>>>                                                  However, the behavior of
>>>>> read-file-name is unspecified when a MUSTMATCH function returns nil:
>>>>>
>>>>> - a function, which will be called with the input as the
>>>>>   argument.  If the function returns a non-nil value, the
>>>>>   minibuffer is exited with that argument as the value.
>>>>>
>>>>> Is this a bug, a case of under-documentation, or do I misunderstand something?
>>>>>
>>>>> I'm happy to post this in a separate bug thread if you think it's worth it.
>>>>
>>>> Perhaps that would be worth doing, that way the people who know more
>>>> about completion than I do would be more likely to see it and help
>>>> out.
>>>
>>> Okay, thanks! I'll do that.
>>
>> Now that #66187
>> (<https://yhetil.org/emacs-bugs/87cytlqmqh.fsf <at> breatheoutbreathe.in/>)
>> and bug#68815
>> (<https://yhetil.org/emacs-bugs/8734ufyxoy.fsf <at> breatheoutbreathe.in/>)
>> are fixed on emacs-29, I'm revisiting this issue.
>>
>> With the following patch, the interactive prompt in package-vc-checkout
>> now offers all directory for completion (empty or not), but only exits
>> when the minibuffer contains an empty directory or nonexistent filename.
>>
>> Testing this patch requires checking out emacs-29 after e6c82fe35e3.
>
> LGTM, I've pushed it to emacs-29.  Thanks!

Thanks!!

Joseph




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 15 Mar 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.