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: Acknowledgement ([PATCH] Fix interactive prompt for selecting checkout directory) Date: Wed, 20 Sep 2023 00:31:21 -0700 Message-ID: <871qetfgfx.fsf@breatheoutbreathe.in> References: <87h6npfhoa.fsf@breatheoutbreathe.in> <875y45fgrz.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="1167"; mail-complaints-to="usenet@ciao.gmane.io" To: 66114@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 20 09:33:09 2023 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 1qirhs-000AaT-Ke for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Sep 2023 09:33:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qirhk-0007JC-Ek; Wed, 20 Sep 2023 03:33:00 -0400 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 1qirhf-0007Ht-1C for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 03:32:55 -0400 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 1qirhe-0004DB-64 for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 03:32:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qirhm-0005oK-EE for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2023 03:33:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 66114-submit@debbugs.gnu.org id=B66114.169519515522299 (code B ref 66114); Wed, 20 Sep 2023 07:33:02 +0000 Original-Received: (at 66114) by debbugs.gnu.org; 20 Sep 2023 07:32:35 +0000 Original-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 Original-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 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. In-reply-to: <875y45fgrz.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:270910 Archived-At: --=-=-= 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 --=-=-=--