From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: philipk@posteo.net, bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2023 07:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66114 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 66114@debbugs.gnu.org Cc: Philip Kaludercic X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Philip Kaludercic Received: via spool by submit@debbugs.gnu.org id=B.16951935749180 (code B ref -1); Wed, 20 Sep 2023 07:07:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Sep 2023 07:06:14 +0000 Received: from localhost ([127.0.0.1]:58159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qirHp-0002Ny-NF for submit@debbugs.gnu.org; Wed, 20 Sep 2023 03:06:14 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qirHm-0002Nf-Bg for submit@debbugs.gnu.org; Wed, 20 Sep 2023 03:06:12 -0400 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 1qirHW-0002KB-7o for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 03:05:54 -0400 Received: from out-226.mta1.migadu.com ([95.215.58.226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qirHS-0007C6-6p for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 03:05:53 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1695193547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=fuggQz6FwHsVQY2dCqI6L/P9u7BMurlFmD1zQRDEya8=; b=YzIScB77S5JN3rqVd4dReAxhKziBvLznviUw7C36S8JFLktvT0WrxydnRxlw4Y8WtWOCMb 01cfXXbVD/+mfCjxlGTBm8DGvLmgPMsUGDK6D+Jz7QwtyxaQQmRMq+3Hq3QuA58Ogpu/sM 0zDSbJ7puQk74cUnMOgsT74sOmikcxk= From: Joseph Turner Date: Wed, 20 Sep 2023 00:02:43 -0700 Message-ID: <87h6npfhoa.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.226; envelope-from=joseph@breatheoutbreathe.in; helo=out-226.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch This patch fixes the interactive prompt in package-vc-checkout. See commit message for details. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch >From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001 From: Joseph Turner 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. --- 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) + (user-error "Directory not empty: %S" (expand-file-name dir))))) + (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)) -- 2.41.0 --=-=-=-- From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for selecting checkout directory) Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2023 07:26: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 To: 66114@debbugs.gnu.org Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.169519472311215 (code B ref 66114); Wed, 20 Sep 2023 07:26:02 +0000 Received: (at 66114) by debbugs.gnu.org; 20 Sep 2023 07:25:23 +0000 Received: from localhost ([127.0.0.1]:58212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiraM-0002uo-OC for submit@debbugs.gnu.org; Wed, 20 Sep 2023 03:25:23 -0400 Received: from out-227.mta0.migadu.com ([91.218.175.227]:10429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiraJ-0002ub-DM for 66114@debbugs.gnu.org; Wed, 20 Sep 2023 03:25:21 -0400 References: <87h6npfhoa.fsf@breatheoutbreathe.in> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1695194708; 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=5rx6nZilqlJlQAjzNqxmJHqYnZFHSBvVTrJ6VZFPxCk=; b=g+CdTjTSbzVyQ/dMuHqwjlAj0lBQ3VVGmOy+MaIj5WyN0qDVdNAEyjwHaQaujDvCmKIZA3 dO0P8sD7DJopbg5puh/JPHyrj/wfCRRzTIFovqb/GeRC4EHnqc8oumSaj0H18PYo5E1fBK 8LvhziHpdZmEw2VzlDM6GIjQef0cpn4= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner Date: Wed, 20 Sep 2023 00:24:04 -0700 In-reply-to: Message-ID: <875y45fgrz.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain In this updated patch, I didn't not remove a double negative. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch >From cc5d53e59928747b324eef312a4c83266a3bb8c3 Mon Sep 17 00:00:00 2001 From: Joseph Turner 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. --- 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..9caa1931af8 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: "))) + (when (or (file-exists-p dir) + (not (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) + (user-error "Directory not empty: %S" (expand-file-name dir))))) + (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)) -- 2.41.0 --=-=-=-- From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for selecting checkout directory) Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2023 07:33: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 To: 66114@debbugs.gnu.org Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.169519515522299 (code B ref 66114); Wed, 20 Sep 2023 07:33:02 +0000 Received: (at 66114) by debbugs.gnu.org; 20 Sep 2023 07:32:35 +0000 Received: from localhost ([127.0.0.1]:58238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qirhL-0005nZ-6K for submit@debbugs.gnu.org; Wed, 20 Sep 2023 03:32:35 -0400 Received: from out-230.mta0.migadu.com ([91.218.175.230]:20972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qirhH-0005nQ-Nl for 66114@debbugs.gnu.org; Wed, 20 Sep 2023 03:32:33 -0400 References: <87h6npfhoa.fsf@breatheoutbreathe.in> <875y45fgrz.fsf@breatheoutbreathe.in> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1695195141; 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=DP1EGsku8pMRZiGib9aQQPZuftEptxglhz5FLnhzBas=; b=HKiwBckYZVdInHWveAdCcNoeuPnI7As+WJSDsNxdfMIhPrUuN5JSiaZQOk4fOTkmsPGCwr Y8T0LBnPKh0N58mhjoGnCKLykQ9xYT9Yt/oQFYklL6b76NQlBpoxAt+YSp84Z3aCww1QbR rfYH9nd6raTid8N1uM4dk5DkpC9fOCE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner Date: Wed, 20 Sep 2023 00:31:21 -0700 In-reply-to: <875y45fgrz.fsf@breatheoutbreathe.in> Message-ID: <871qetfgfx.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Oops! I forgot how contrapositives work for a moment. Please ignore the previous two patches. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch >From aa3aca16755a8edec8d761e28d4ad0125cc5b7cd Mon Sep 17 00:00:00 2001 From: Joseph Turner 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. --- lisp/emacs-lisp/package-vc.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index c7a30736e32..14014a84448 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -823,12 +823,16 @@ 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: "))) + (when (and (file-exists-p dir) (not (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) + (user-error "Directory not empty: %S" (expand-file-name dir))))) + (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)) -- 2.41.0 --=-=-=-- From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Sep 2023 08:22: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 To: Joseph Turner Cc: 66114@debbugs.gnu.org Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.16953709217403 (code B ref 66114); Fri, 22 Sep 2023 08:22:02 +0000 Received: (at 66114) by debbugs.gnu.org; 22 Sep 2023 08:22:01 +0000 Received: from localhost ([127.0.0.1]:35270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjbQG-0001vK-N1 for submit@debbugs.gnu.org; Fri, 22 Sep 2023 04:22:01 -0400 Received: from mout02.posteo.de ([185.67.36.66]:42359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjbQE-0001uz-LS for 66114@debbugs.gnu.org; Fri, 22 Sep 2023 04:21:59 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0AE58240103 for <66114@debbugs.gnu.org>; Fri, 22 Sep 2023 10:21:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695370902; bh=Vd4SdsLU6R0kDMTXqRnGuOCQuLfXnvMjK8NV2fPbsNo=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=XuBUtmTlNuY3+ZmPRJqDMpv5zW2j/podo1W5yxy1702pc52d4QvqlhmA2T57d9XdA 4o3ZkcmY2E9N9aGbqBAi/uJf8qfRf8ukBeR7sN7X3ND/aSwSlUzW+iUsE1Gp1lKu0t KTMTY3mcsMSvLAnf1bDRU86998PGwDRAOYaV9GFbXPdiTwulasooFV03hW/V7F2Jml 7vv1P3uJnan0G3ZLVQbItjA/HjFWK2yhA00qoNoUgqGQhMWEctpYMlDzwTUritG0qh FJz8ubQ+z8/kTuQaGUh8IzpmXp5R/hgFZZKJJ/gcZ+c+UvhkrKfzjIxU3MeuOPj9Ud Pvb5IyZTgcp6g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RsQGY4T9mz9rxD; Fri, 22 Sep 2023 10:21:41 +0200 (CEST) From: Philip Kaludercic In-Reply-To: <87h6npfhoa.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Wed, 20 Sep 2023 00:02:43 -0700") References: <87h6npfhoa.fsf@breatheoutbreathe.in> Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Fri, 22 Sep 2023 08:21:41 +0000 Message-ID: <87h6nmvcru.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Joseph Turner 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 > 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)) From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2023 05:22: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 To: Philip Kaludercic Cc: 66114@debbugs.gnu.org Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.16955328928186 (code B ref 66114); Sun, 24 Sep 2023 05:22:02 +0000 Received: (at 66114) by debbugs.gnu.org; 24 Sep 2023 05:21:32 +0000 Received: from localhost ([127.0.0.1]:40874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkHYh-00027x-So for submit@debbugs.gnu.org; Sun, 24 Sep 2023 01:21:32 -0400 Received: from out-190.mta1.migadu.com ([95.215.58.190]:61559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkHYf-00027m-11 for 66114@debbugs.gnu.org; Sun, 24 Sep 2023 01:21:30 -0400 References: <87h6npfhoa.fsf@breatheoutbreathe.in> <87h6nmvcru.fsf@posteo.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1695532875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=R6vmdpv4nvZWkswn2urYwim5ltlqi4/033UT3WCQXdw=; b=fyI1wM7J+fzCNuHBwedAHRtUlugpMPud839xZ1EoE3yxfSeDvggVpEZFbZUjoSTnc8d1Jp lcACZ53HyXNUU+ho+KytmKgmMLVyVGR/PJcv8ic3p0A4y+lgq+FN64UQZBeQOp5zMge3Wn cAyO4FH3/93ih0BIpV4NoeyVyMAeY8k= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner Date: Sat, 23 Sep 2023 22:06:06 -0700 In-reply-to: <87h6nmvcru.fsf@posteo.net> Message-ID: <87bkdsp2ns.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philip Kaludercic writes: > Joseph Turner 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 >> 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)) From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2023 14:38: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 To: Joseph Turner Cc: 66114@debbugs.gnu.org Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.169556625612483 (code B ref 66114); Sun, 24 Sep 2023 14:38:02 +0000 Received: (at 66114) by debbugs.gnu.org; 24 Sep 2023 14:37:36 +0000 Received: from localhost ([127.0.0.1]:43394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkQEp-0003FG-ND for submit@debbugs.gnu.org; Sun, 24 Sep 2023 10:37:36 -0400 Received: from mout02.posteo.de ([185.67.36.66]:39487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkQEk-0003Ez-2t for 66114@debbugs.gnu.org; Sun, 24 Sep 2023 10:37:33 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 14BD0240101 for <66114@debbugs.gnu.org>; Sun, 24 Sep 2023 16:37:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695566232; bh=8VcFkjp/dLXRzWqodQqR6X5dwTxUdSAt7Lz9k3XJzNw=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=XGLt0OmzAVxJcluBRHE7TjR6zfgA2s31BmRyKl6I+8BjSm45P70n8MiLia9TjFQvG IAylQ94zRZKdCl97NS+HU4bjtsJvpQbNmMRi5aaD6vHoq0xykwQqkkZgH+7rgLjiig WedrsjB9MT5Jr4toY68rTWCQpTzHHNgHq54c8Zi43dIW/fvyHne5DtL4a1UUIgkepy 8jvaqD9ZUy+IbLahLm6fIPJgqWfz+77Z7dnkovAzd9BwoAVMh1gptZf2AQuqWnGXAg CXPqFqbMJmL1HOiAdTFP9soNefyJqWmXcTgW39lw+ymBQfD6Vg99JOBZKY40wrjSDx riRJxZQZNFZyg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RtpVv5B3bz9ryR; Sun, 24 Sep 2023 16:37:11 +0200 (CEST) From: Philip Kaludercic In-Reply-To: <87bkdsp2ns.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Sat, 23 Sep 2023 22:06:06 -0700") References: <87h6npfhoa.fsf@breatheoutbreathe.in> <87h6nmvcru.fsf@posteo.net> <87bkdsp2ns.fsf@breatheoutbreathe.in> User-Agent: Gnus/5.13 (Gnus v5.13) X-Hashcash: 1:20:230924:joseph@breatheoutbreathe.in::gTIRL+ne/p0mcYua:ga2 X-Hashcash: 1:20:230924:66114@debbugs.gnu.org::rBL9w328YEmpiK1W:B6KY Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Date: Sun, 24 Sep 2023 16:37:11 +0200 Message-ID: <87lecvbpt4.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Joseph Turner writes: > Philip Kaludercic writes: > >> Joseph Turner 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 >>> 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 From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2023 21:31:01 +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 To: Philip Kaludercic Cc: 66114@debbugs.gnu.org Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.169559105912311 (code B ref 66114); Sun, 24 Sep 2023 21:31:01 +0000 Received: (at 66114) by debbugs.gnu.org; 24 Sep 2023 21:30:59 +0000 Received: from localhost ([127.0.0.1]:43692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkWgs-0003CV-J1 for submit@debbugs.gnu.org; Sun, 24 Sep 2023 17:30:59 -0400 Received: from out-204.mta1.migadu.com ([2001:41d0:203:375::cc]:45347) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkWgm-0003CF-Ih for 66114@debbugs.gnu.org; Sun, 24 Sep 2023 17:30:57 -0400 References: <87h6npfhoa.fsf@breatheoutbreathe.in> <87h6nmvcru.fsf@posteo.net> <87bkdsp2ns.fsf@breatheoutbreathe.in> <87lecvbpt4.fsf@posteo.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1695591038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y0sT1TppzMQRcsvijevtxe6RWxDf3Ppl0Wa80tBDW6g=; b=OXE4uazoYXjGD8Q4Cufwz2kDru38DC5rxcpR0L9DQ4VoOkAvyRtcb+B7Cy82YY8hIo0KFz qUO55KVf57zUVor0jfirLQwR04bT7AUSEjqQH9/l6Z1WEdktCW62+65SDKyhvqyuFttMV3 6nYjyfcitB11Sc18ryTbUzzxntUkL6o= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner Date: Sun, 24 Sep 2023 14:27:53 -0700 In-reply-to: <87lecvbpt4.fsf@posteo.net> Message-ID: <87v8bzi7iz.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philip Kaludercic writes: > Joseph Turner writes: > >> Philip Kaludercic writes: >> >>> Joseph Turner 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 >>>> 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)) From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory 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 To: Philip Kaludercic , 66114@debbugs.gnu.org Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.170728192710911 (code B ref 66114); Wed, 07 Feb 2024 04:59:02 +0000 Received: (at 66114) by debbugs.gnu.org; 7 Feb 2024 04:58:47 +0000 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 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 References: <87h6npfhoa.fsf@breatheoutbreathe.in> <87h6nmvcru.fsf@posteo.net> <87bkdsp2ns.fsf@breatheoutbreathe.in> <87lecvbpt4.fsf@posteo.net> <87v8bzi7iz.fsf@breatheoutbreathe.in> 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. From: Joseph Turner Date: Tue, 30 Jan 2024 00:42:21 -0800 In-reply-to: <87v8bzi7iz.fsf@breatheoutbreathe.in> Message-ID: <877cjgvpjl.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Joseph Turner writes: > Philip Kaludercic writes: > >> Joseph Turner writes: >> >>> However, the behavior of >>> read-file-name is unspecified when a MUSTMATCH function re [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Joseph Turner writes: > Philip Kaludercic writes: > >> Joseph Turner writes: >> >>> However, the behavior of >>> read-file-name is unspecified when a MUSTMATCH function re [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.1 DATE_IN_PAST_96_XX Date: is 96 hours or more before Received: date 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= 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 --=-=-=-- From unknown Sat Aug 09 05:05:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Joseph Turner Subject: bug#66114: closed (Re: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory) Message-ID: References: <87eddfgf60.fsf@posteo.net> <87h6npfhoa.fsf@breatheoutbreathe.in> X-Gnu-PR-Message: they-closed 66114 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 66114@debbugs.gnu.org Date: Wed, 14 Feb 2024 16:55:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1707929702-21028-1" This is a multi-part message in MIME format... ------------=_1707929702-21028-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #66114: [PATCH] Fix interactive prompt for selecting checkout directory which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 66114@debbugs.gnu.org. --=20 66114: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D66114 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1707929702-21028-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 66114-done) by debbugs.gnu.org; 14 Feb 2024 16:54:43 +0000 Received: from localhost ([127.0.0.1]:52933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raIWx-0005Se-9r for submit@debbugs.gnu.org; Wed, 14 Feb 2024 11:54:43 -0500 Received: from mout02.posteo.de ([185.67.36.66]:46659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raIWu-0005SP-N2 for 66114-done@debbugs.gnu.org; Wed, 14 Feb 2024 11:54:41 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7BA4E240104 for <66114-done@debbugs.gnu.org>; Wed, 14 Feb 2024 17:54:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1707929656; bh=VtfDQsJFn4/vRyMnmTJANSMfC4SaLQbHttFtL/mm13I=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=K2oak402DbxnVFoaPr8O9IOyCypT9Falq3jTdVaq7DWGUYwSmwMFmf1FTMhcTX1l/ H2tzhelUBVqoBFGuNFhdT6skrr7ygpdXP7Dl1vpwZmI4L46MBrI2djXNA8whUbgAz0 U8p4YRV9i+hYyBWFFgRAICUl2XlcHiNBoJsRfUqwI+SnbTpipBO1iv13ksuAcMuu+L SMuNGUNWpP6C2aB9m1lEWq/UIvfiBu0yjn1ZRYyRNF4fHkJPVcDENmUaOh8bpUYF/o NvmxsK4PO7FRiwGMAln2rPBuhMDdYkgv5BHCE+QnF01pXeUaMckveLvndORmTTJ2Fg fqXWCRK3IhEwA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TZkn35Krhz9rxK; Wed, 14 Feb 2024 17:54:15 +0100 (CET) From: Philip Kaludercic To: Joseph Turner Subject: Re: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory In-Reply-To: <877cjgvpjl.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Tue, 30 Jan 2024 00:42:21 -0800") References: <87h6npfhoa.fsf@breatheoutbreathe.in> <87h6nmvcru.fsf@posteo.net> <87bkdsp2ns.fsf@breatheoutbreathe.in> <87lecvbpt4.fsf@posteo.net> <87v8bzi7iz.fsf@breatheoutbreathe.in> <877cjgvpjl.fsf@breatheoutbreathe.in> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Wed, 14 Feb 2024 16:54:15 +0000 Message-ID: <87eddfgf60.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 66114-done Cc: 66114-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) Joseph Turner writes: > 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. LGTM, I've pushed it to emacs-29. Thanks! > Thanks! > > Joseph ------------=_1707929702-21028-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 Sep 2023 07:06:14 +0000 Received: from localhost ([127.0.0.1]:58159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qirHp-0002Ny-NF for submit@debbugs.gnu.org; Wed, 20 Sep 2023 03:06:14 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qirHm-0002Nf-Bg for submit@debbugs.gnu.org; Wed, 20 Sep 2023 03:06:12 -0400 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 1qirHW-0002KB-7o for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 03:05:54 -0400 Received: from out-226.mta1.migadu.com ([95.215.58.226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qirHS-0007C6-6p for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 03:05:53 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1695193547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=fuggQz6FwHsVQY2dCqI6L/P9u7BMurlFmD1zQRDEya8=; b=YzIScB77S5JN3rqVd4dReAxhKziBvLznviUw7C36S8JFLktvT0WrxydnRxlw4Y8WtWOCMb 01cfXXbVD/+mfCjxlGTBm8DGvLmgPMsUGDK6D+Jz7QwtyxaQQmRMq+3Hq3QuA58Ogpu/sM 0zDSbJ7puQk74cUnMOgsT74sOmikcxk= From: Joseph Turner To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix interactive prompt for selecting checkout directory Date: Wed, 20 Sep 2023 00:02:43 -0700 X-Debbugs-CC: Philip Kaludercic Message-ID: <87h6npfhoa.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.226; envelope-from=joseph@breatheoutbreathe.in; helo=out-226.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain Tags: patch This patch fixes the interactive prompt in package-vc-checkout. See commit message for details. --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch >From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001 From: Joseph Turner 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. --- 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) + (user-error "Directory not empty: %S" (expand-file-name dir))))) + (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)) -- 2.41.0 --=-=-=-- ------------=_1707929702-21028-1-- From unknown Sat Aug 09 05:05:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Feb 2024 17:29:01 +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 To: Philip Kaludercic Cc: 66114-done@debbugs.gnu.org Received: via spool by 66114-done@debbugs.gnu.org id=D66114.170801809027869 (code D ref 66114); Thu, 15 Feb 2024 17:29:01 +0000 Received: (at 66114-done) by debbugs.gnu.org; 15 Feb 2024 17:28:10 +0000 Received: from localhost ([127.0.0.1]:56903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rafWr-0007FQ-Mv for submit@debbugs.gnu.org; Thu, 15 Feb 2024 12:28:10 -0500 Received: from out-173.mta0.migadu.com ([91.218.175.173]:38387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rafWo-0007Eu-AW for 66114-done@debbugs.gnu.org; Thu, 15 Feb 2024 12:28:07 -0500 References: <87h6npfhoa.fsf@breatheoutbreathe.in> <87h6nmvcru.fsf@posteo.net> <87bkdsp2ns.fsf@breatheoutbreathe.in> <87lecvbpt4.fsf@posteo.net> <87v8bzi7iz.fsf@breatheoutbreathe.in> <877cjgvpjl.fsf@breatheoutbreathe.in> <87eddfgf60.fsf@posteo.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1708018060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uDV9sANqjIlovmhMgAxFvN1re/oeJyzGat3yhSBthM4=; b=MVnTHZb3t5/qqhzjKivr+heIUpw7JjtVkVj+DUwQdTo9UHirBTN1XrVg4wwudoDbFMn+8F FN+k9Ecss83tJia/Qj7sHu/bjQRheQWct25ADtl8Xfu4NuV6sU5OFCpJMvPp0G3gexuba6 SYenQ0t9VOp7R47zj5e8HEjG6DoePuM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner Date: Thu, 15 Feb 2024 10:27:20 -0700 In-reply-to: <87eddfgf60.fsf@posteo.net> Message-ID: <87a5o1hc3b.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) Philip Kaludercic writes: > Joseph Turner writes: > >> 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. > > LGTM, I've pushed it to emacs-29. Thanks! Thanks!! Joseph