From 1974ab4985f5f36e68d5be63ee0124e41ad251a6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 24 Oct 2024 21:15:28 +0800 Subject: [PATCH] ; Touch up & fix documentation changes from last commit (cherry picked from commit fefc3005d46f4ac41af624d4591b052df92e4bd0) --- etc/NEWS | 10 ++++++---- lisp/emacs-lisp/package-vc.el | 4 ++-- lisp/ldefs-boot.el | 2 +- lisp/vc/vc.el | 12 ++++++------ 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index c09c8276f85..3fd3623efb7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -547,15 +547,17 @@ even though Emacs thinks it is dangerous. So far, this applies only to using 'e' from Log View mode for Git. +--- *** 'vc-clone' is now an interactive command. When called interactively, 'vc-clone' now prompts for the remote -repository address, the backend for cloning, if it has not been -determined automatically according to the URL, and the directory to -clone the repository into. +repository address, and the directory into which to clone the +repository. It tries to automatically determine the VC backend for +cloning, or prompts for that, too. +--- *** 'vc-clone' now accepts an optional argument OPEN-DIR. When the argument is non-nil, the function switches to a buffer visiting -directory to which the repository was cloned. +the directory into which the repository was cloned. * New Modes and Packages in Emacs 31.1 diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 445f52477b2..9c185da02ab 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -71,7 +71,7 @@ "Default VC backend to use for cloning package repositories. `package-vc-install' uses this backend when you specify neither the backend nor a repository URL that's recognized via -`package-vc-heuristic-alist'. +`vc-clone-heuristic-alist'. The value must be a member of `vc-handled-backends' that supports the `clone' VC function." @@ -809,7 +809,7 @@ If PACKAGE is a string, it specifies the URL of the package repository. In this case, optional argument BACKEND specifies the VC backend to use for cloning the repository; if it's nil, this function tries to infer which backend to use according to -the value of `package-vc-heuristic-alist' and if that fails it +the value of `vc-clone-heuristic-alist' and if that fails it uses `package-vc-default-backend'. Optional argument NAME specifies the package name in this case; if it's nil, this package uses `file-name-base' on the URL to obtain the package diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 5816f94b138..cf088b19324 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -23149,7 +23149,7 @@ If PACKAGE is a string, it specifies the URL of the package repository. In this case, optional argument BACKEND specifies the VC backend to use for cloning the repository; if it's nil, this function tries to infer which backend to use according to -the value of `package-vc-heuristic-alist' and if that fails it +the value of `vc-clone-heuristic-alist' and if that fails it uses `package-vc-default-backend'. Optional argument NAME specifies the package name in this case; if it's nil, this package uses `file-name-base' on the URL to obtain the package diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index f6436ebb9bf..c4b05950229 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3884,17 +3884,17 @@ If successful, return the string with the directory of the checkout; otherwise return nil. REMOTE should be a string, the URL of the remote repository or the name of a directory (if the repository is local). + +When called interactively, prompt for REMOTE, BACKEND and DIRECTORY, +except attempt to determine BACKEND automatically based on REMOTE. + If DIRECTORY is nil or omitted, it defaults to `default-directory'. If BACKEND is nil or omitted, the function iterates through every known backend in `vc-handled-backends' until one succeeds to clone REMOTE. If REV is non-nil, it indicates a specific revision to check out after cloning; the syntax of REV depends on what BACKEND accepts. -If OPEN-DIR is non-nil, switches to a buffer visiting DIRECTORY to -which the repository was cloned. It would be useful in scripts, but not -in regular code. -If called interactively, prompt for REMOTE, DIRECTORY and BACKEND, -if BACKEND has not been automatically determined according to the REMOTE -URL, in the minibuffer." +If OPEN-DIR is non-nil, as it is interactively, also switches to a +buffer visiting DIRECTORY." (interactive (let* ((url (read-string "Remote: " nil 'vc--remotes-history)) (backend (or (vc-guess-url-backend url) -- 2.39.5