From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Date: Tue, 30 Jan 2024 00:42:21 -0800 Message-ID: <877cjgvpjl.fsf@breatheoutbreathe.in> References: <87h6npfhoa.fsf@breatheoutbreathe.in> <87h6nmvcru.fsf@posteo.net> <87bkdsp2ns.fsf@breatheoutbreathe.in> <87lecvbpt4.fsf@posteo.net> <87v8bzi7iz.fsf@breatheoutbreathe.in> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3479"; mail-complaints-to="usenet@ciao.gmane.io" To: Philip Kaludercic , 66114@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 07 05:59:13 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rXa1h-0000gN-1S for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 07 Feb 2024 05:59:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXa1L-0003mo-RJ; Tue, 06 Feb 2024 23:58:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXa1J-0003mQ-7T for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 23:58:49 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rXa1I-0008D9-Vy for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 23:58:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rXa1W-0002qQ-HK for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 23:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Feb 2024 04:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66114 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.170728192710911 (code B ref 66114); Wed, 07 Feb 2024 04:59:02 +0000 Original-Received: (at 66114) by debbugs.gnu.org; 7 Feb 2024 04:58:47 +0000 Original-Received: from localhost ([127.0.0.1]:55552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXa1H-0002pu-1y for submit@debbugs.gnu.org; Tue, 06 Feb 2024 23:58:47 -0500 Original-Received: from out-188.mta1.migadu.com ([2001:41d0:203:375::bc]:15028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXa1E-0002pj-3t for 66114@debbugs.gnu.org; Tue, 06 Feb 2024 23:58:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1707281907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FsUsFQVERSNiDMEBcV/FeW0hgaq5YsB50xUzcXaoKLo=; b=S3cjE7sCTXvQn1L0tCEAzB03T2Eg5RzzujvwmDKZicQdaCxZ8q6dwbOsVXytj8Mu6Fbu/d V62hyP35MytnBSITGwhNpzVblxaB3jMLLbmueV3QVwoLLsjBKTnZZUq/UTgRi090wF5Eg7 9qr80noeqGWpwSGzt5JJrN19Re5zQYk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87v8bzi7iz.fsf@breatheoutbreathe.in> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279535 Archived-At: --=-=-= Content-Type: text/plain Joseph Turner writes: > Philip Kaludercic writes: > >> Joseph Turner 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 () and bug#68815 () 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Improve-package-vc-checkout-interactive-prompt-bug-6.patch >From e6c82fe35e3f5de107020ee206043bd80cbfff27 Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Tue, 30 Jan 2024 00:52:39 -0800 Subject: [PATCH] Improve package-vc-checkout interactive prompt (bug#66114) * lisp/emacs-lisp/package-vc.el (package-vc--read-package-name): Use read-directory-name instead of read-file-name. --- lisp/emacs-lisp/package-vc.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index e89ead89d4b..5c5486de290 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -825,8 +825,8 @@ package-vc-checkout (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)) + (read-directory-name "Clone into new or empty directory: " nil nil + (lambda (dir) (or (not (file-exists-p dir)) (directory-empty-p dir)))) (and current-prefix-arg :last-release)))) (setf directory (expand-file-name directory)) -- 2.41.0 --=-=-=--