aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-07-25 19:34:04 +0100
committerSean Whitton2025-07-25 19:34:04 +0100
commit50ffb29d0bbb92a7c6569c83d2e3e4868c4e867b (patch)
tree0911cfa9182a3910deb041c6bc7391f2ce849096
parent08ca6caa0a081cd67d253b09896c3789268da7a1 (diff)
downloademacs-50ffb29d0bbb92a7c6569c83d2e3e4868c4e867b.tar.gz
emacs-50ffb29d0bbb92a7c6569c83d2e3e4868c4e867b.zip
VC: New support for other working trees
* lisp/vc/vc-git.el (vc-git--read-start-point): New function, factored out of vc-git-create-tag. (vc-git-create-tag): Use it. (vc-git--worktrees, vc-git-known-other-working-trees) (vc-git-add-working-tree, vc-git-delete-working-tree) (vc-git-move-working-tree): * lisp/vc/vc-hg.el (vc-hg-known-other-working-trees) (vc-hg-add-working-tree, vc-hg--shared-p) (vc-hg-delete-working-tree, vc-hg-move-working-tree): New functions. * lisp/vc/vc.el: Define API for known-other-working-tree, add-working-tree, delete-working-tree and move-working-tree backend functions. (vc-dir-status-files): New function. (project-current-directory-override): Declare. (dired-rename-subdir): Autoload. (vc-add-working-tree, vc-switch-working-tree) (vc-delete-working-tree, vc-move-working-tree): New commands. * lisp/vc/vc-hooks.el (vc-prefix-map): Bind them under C-x v. * doc/emacs/vc1-xtra.texi (Other Working Trees): New node. * etc/NEWS: Announce the new commands. * test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees): New function. (vc-test-git07-other-working-trees) (vc-test-hg07-other-working-trees): New tests. * lisp/ldefs-boot.el: Regenerate.
-rw-r--r--doc/emacs/emacs.texi1
-rw-r--r--doc/emacs/vc1-xtra.texi65
-rw-r--r--etc/NEWS16
-rw-r--r--lisp/ldefs-boot.el256
-rw-r--r--lisp/vc/vc-dir.el4
-rw-r--r--lisp/vc/vc-git.el70
-rw-r--r--lisp/vc/vc-hg.el53
-rw-r--r--lisp/vc/vc-hooks.el6
-rw-r--r--lisp/vc/vc.el194
-rw-r--r--test/lisp/vc/vc-tests/vc-tests.el119
10 files changed, 637 insertions, 147 deletions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index ba47190944a..b373dc092f8 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -868,6 +868,7 @@ Miscellaneous Commands and Features of VC
868* Change Logs and VC:: Generating a change log file from log entries. 868* Change Logs and VC:: Generating a change log file from log entries.
869* VC Delete/Rename:: Deleting and renaming version-controlled files. 869* VC Delete/Rename:: Deleting and renaming version-controlled files.
870* Revision Tags:: Symbolic names for revisions. 870* Revision Tags:: Symbolic names for revisions.
871* Other Working Trees:: Multiple sets of workfiles.
871* Version Headers:: Inserting version control headers into working files. 872* Version Headers:: Inserting version control headers into working files.
872* Editing VC Commands:: Editing the VC shell commands that Emacs will run. 873* Editing VC Commands:: Editing the VC shell commands that Emacs will run.
873* Preparing Patches:: Preparing and composing patches from within VC. 874* Preparing Patches:: Preparing and composing patches from within VC.
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index e35883c4819..29ae63c7e41 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -14,6 +14,7 @@
14* Change Logs and VC:: Generating a change log file from log entries. 14* Change Logs and VC:: Generating a change log file from log entries.
15* VC Delete/Rename:: Deleting and renaming version-controlled files. 15* VC Delete/Rename:: Deleting and renaming version-controlled files.
16* Revision Tags:: Symbolic names for revisions. 16* Revision Tags:: Symbolic names for revisions.
17* Other Working Trees:: Multiple sets of workfiles.
17* Version Headers:: Inserting version control headers into working files. 18* Version Headers:: Inserting version control headers into working files.
18* Editing VC Commands:: Editing the VC shell commands that Emacs will run. 19* Editing VC Commands:: Editing the VC shell commands that Emacs will run.
19* Preparing Patches:: Preparing and composing patches from within VC. 20* Preparing Patches:: Preparing and composing patches from within VC.
@@ -226,6 +227,70 @@ an old tag, the renamed file is retrieved under its new name, which is
226not the name that the makefile expects. So the program won't really 227not the name that the makefile expects. So the program won't really
227work as retrieved. 228work as retrieved.
228 229
230@node Other Working Trees
231@subsubsection Multiple Working Trees for One Repository
232
233@cindex other working trees
234@cindex multiple working trees
235Some VCS support more than one working tree with the same backing
236repository or revisions store. This means that you can have different
237revisions or branches (@pxref{Branches}) checked out simultaneously, in
238different working trees, but with all revision history, branches, tags
239and other metadata shared. The following commands let you switch
240between and modify different working trees.
241
242@table @kbd
243@item C-x v w c
244Add a new working tree.
245
246@item C-x v w w
247Visit this file in another working tree.
248
249@item C-x v w x
250Delete a working tree you no longer need.
251
252@item C-x v w R
253Relocate a working tree to another file name.
254@end table
255
256@kindex C-x v w c
257@findex vc-add-working-tree
258You can start using multiple working trees by using the command
259@w{@kbd{C-x v w c}} (@code{vc-add-working-tree}) to create a new working
260tree. This prompts you to specify a destination directory, which
261identifies the working tree, and which will hold the new set of
262workfiles.
263
264Different VCS have different rules about what may and must be checked
265out in other working trees, so there may be additional prompts depending
266on the VCS in use. For example, Git requires that each branch be
267checked out in only one working tree at a time, so when using Git, Emacs
268will also prompt you for the name of the branch to be checked out in the
269new working tree.
270
271@kindex C-x v w w
272@findex vc-switch-working-tree
273Once your repository has other working trees, you can use the command
274@kbd{C-x v w w} (@code{vc-switch-working-tree}) to switch between them.
275It tries to find the analogue of the current buffer's file
276under another working tree. Typically the sets of workfiles
277under different working trees differ more in file contents than in which
278files do and do not exist. In other words, the file the
279current buffer visits probably exists in other working trees too, and
280this command lets you switch to those versions of the file.
281
282@kindex C-x v w x
283@kindex C-x v w R
284@findex vc-delete-working-tree
285@findex vc-move-working-tree
286The commands @kbd{C-x v w x} (@code{vc-delete-working-tree}) and
287@kbd{C-x v w R} (@code{vc-move-working-tree}) are for performing
288maintenance tasks on other working trees, letting you delete, move and
289rename them. Deleting other working trees is particular useful because
290a common use for multiple working trees is to create throwaway copies of
291the repository to quickly test changes, without interfering with any
292work-in-progress you may have in your primary working trees.
293
229@node Version Headers 294@node Version Headers
230@subsubsection Inserting Version Control Headers 295@subsubsection Inserting Version Control Headers
231 296
diff --git a/etc/NEWS b/etc/NEWS
index 9ccfd75fecf..1164f63028e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1843,6 +1843,22 @@ appearance of the list can be customized with the new faces
1843 1843
1844** VC 1844** VC
1845 1845
1846+++
1847*** New commands to handle repositories with multiple working trees.
1848Some VCS support more than one working tree with the same backing
1849revisions store, such as with Git's 'worktree' subcommand and
1850Mercurial's 'share' extension. Emacs now has some commands to manage
1851other working trees:
1852
1853- 'C-x v w c': Add a new working tree.
1854- 'C-x v w w': Visit this file in another working tree.
1855- 'C-x v w x': Delete a working tree you no longer need.
1856- 'C-x v w R': Relocate a working tree to another file name.
1857
1858In addition, Lisp programs that extend VC can invoke the new backend
1859functions to obtain a list of other working trees, and to add, remove
1860and relocate them.
1861
1846--- 1862---
1847*** Using 'e' from Log View mode to modify change comments now works for Git. 1863*** Using 'e' from Log View mode to modify change comments now works for Git.
1848 1864
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 8d275b37172..10328165450 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -5234,8 +5234,6 @@ evaluate the variable `compilation-shell-minor-mode'.
5234The mode's hook is called both when the mode is enabled and when it is 5234The mode's hook is called both when the mode is enabled and when it is
5235disabled. 5235disabled.
5236 5236
5237\\{compilation-shell-minor-mode-map}
5238
5239(fn &optional ARG)" t) 5237(fn &optional ARG)" t)
5240(autoload 'compilation-minor-mode "compile" "\ 5238(autoload 'compilation-minor-mode "compile" "\
5241Toggle Compilation minor mode. 5239Toggle Compilation minor mode.
@@ -5258,8 +5256,6 @@ evaluate the variable `compilation-minor-mode'.
5258The mode's hook is called both when the mode is enabled and when it is 5256The mode's hook is called both when the mode is enabled and when it is
5259disabled. 5257disabled.
5260 5258
5261\\{compilation-minor-mode-map}
5262
5263(fn &optional ARG)" t) 5259(fn &optional ARG)" t)
5264(autoload 'compilation-next-error-function "compile" "\ 5260(autoload 'compilation-next-error-function "compile" "\
5265Advance to the next error message and visit the file where the error was. 5261Advance to the next error message and visit the file where the error was.
@@ -5372,7 +5368,10 @@ either customize it (see the info node `Easy Customization')
5372or call the function `global-completion-preview-mode'.") 5368or call the function `global-completion-preview-mode'.")
5373(custom-autoload 'global-completion-preview-mode "completion-preview" nil) 5369(custom-autoload 'global-completion-preview-mode "completion-preview" nil)
5374(autoload 'global-completion-preview-mode "completion-preview" "\ 5370(autoload 'global-completion-preview-mode "completion-preview" "\
5375Toggle Completion-Preview mode in all buffers. 5371Toggle Completion-Preview mode in many buffers.
5372Specifically, Completion-Preview mode is enabled in all buffers where
5373`completion-preview-mode' would do it.
5374
5376With prefix ARG, enable Global Completion-Preview mode if ARG is 5375With prefix ARG, enable Global Completion-Preview mode if ARG is
5377positive; otherwise, disable it. 5376positive; otherwise, disable it.
5378 5377
@@ -5380,9 +5379,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
5380Enable the mode if ARG is nil, omitted, or is a positive number. 5379Enable the mode if ARG is nil, omitted, or is a positive number.
5381Disable the mode if ARG is a negative number. 5380Disable the mode if ARG is a negative number.
5382 5381
5383Completion-Preview mode is enabled in all buffers where
5384`completion-preview-mode' would do it.
5385
5386See `completion-preview-mode' for more information on 5382See `completion-preview-mode' for more information on
5387Completion-Preview mode. 5383Completion-Preview mode.
5388 5384
@@ -6539,7 +6535,10 @@ either customize it (see the info node `Easy Customization')
6539or call the function `global-cwarn-mode'.") 6535or call the function `global-cwarn-mode'.")
6540(custom-autoload 'global-cwarn-mode "cwarn" nil) 6536(custom-autoload 'global-cwarn-mode "cwarn" nil)
6541(autoload 'global-cwarn-mode "cwarn" "\ 6537(autoload 'global-cwarn-mode "cwarn" "\
6542Toggle Cwarn mode in all buffers. 6538Toggle Cwarn mode in many buffers.
6539Specifically, Cwarn mode is enabled in all buffers where
6540`turn-on-cwarn-mode-if-enabled' would do it.
6541
6543With prefix ARG, enable Global Cwarn mode if ARG is positive; 6542With prefix ARG, enable Global Cwarn mode if ARG is positive;
6544otherwise, disable it. 6543otherwise, disable it.
6545 6544
@@ -6547,9 +6546,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
6547Enable the mode if ARG is nil, omitted, or is a positive number. 6546Enable the mode if ARG is nil, omitted, or is a positive number.
6548Disable the mode if ARG is a negative number. 6547Disable the mode if ARG is a negative number.
6549 6548
6550Cwarn mode is enabled in all buffers where
6551`turn-on-cwarn-mode-if-enabled' would do it.
6552
6553See `cwarn-mode' for more information on Cwarn mode. 6549See `cwarn-mode' for more information on Cwarn mode.
6554 6550
6555(fn &optional ARG)" t) 6551(fn &optional ARG)" t)
@@ -7653,18 +7649,18 @@ Also see the `diff-entire-buffers' variable.
7653 7649
7654(autoload 'diff-mode "diff-mode" "\ 7650(autoload 'diff-mode "diff-mode" "\
7655Major mode for viewing/editing context diffs. 7651Major mode for viewing/editing context diffs.
7656Supports unified and context diffs as well as (to a lesser extent) 7652Supports unified and context diffs as well as, to a lesser extent, diffs
7657normal diffs. 7653in the old \"normal\" format. (Unified diffs have become the standard,
7658 7654most commonly encountered format.) If you edit the buffer manually,
7659When the buffer is read-only, the ESC prefix is not necessary. 7655`diff-mode' will try to update the hunk headers for you on-the-fly.
7660If you edit the buffer manually, `diff-mode' will try to update the hunk
7661headers for you on-the-fly.
7662 7656
7663You can also switch between context diff and unified diff with \\[diff-context->unified], 7657You can also switch between context diff and unified diff with \\[diff-context->unified],
7664or vice versa with \\[diff-unified->context] and you can also reverse the direction of 7658or vice versa with \\[diff-unified->context] and you can also reverse the direction of
7665a diff with \\[diff-reverse-direction]. 7659a diff with \\[diff-reverse-direction].
7666 7660
7667\\{diff-mode-map} 7661\\{diff-mode-map}
7662In read-only buffers the following bindings are also available:
7663\\{diff-read-only-map}
7668 7664
7669(fn)" t) 7665(fn)" t)
7670(autoload 'diff-minor-mode "diff-mode" "\ 7666(autoload 'diff-minor-mode "diff-mode" "\
@@ -8114,7 +8110,10 @@ either customize it (see the info node `Easy Customization')
8114or call the function `global-display-fill-column-indicator-mode'.") 8110or call the function `global-display-fill-column-indicator-mode'.")
8115(custom-autoload 'global-display-fill-column-indicator-mode "display-fill-column-indicator" nil) 8111(custom-autoload 'global-display-fill-column-indicator-mode "display-fill-column-indicator" nil)
8116(autoload 'global-display-fill-column-indicator-mode "display-fill-column-indicator" "\ 8112(autoload 'global-display-fill-column-indicator-mode "display-fill-column-indicator" "\
8117Toggle Display-Fill-Column-Indicator mode in all buffers. 8113Toggle Display-Fill-Column-Indicator mode in many buffers.
8114Specifically, Display-Fill-Column-Indicator mode is enabled in all
8115buffers where `display-fill-column-indicator--turn-on' would do it.
8116
8118With prefix ARG, enable Global Display-Fill-Column-Indicator mode if 8117With prefix ARG, enable Global Display-Fill-Column-Indicator mode if
8119ARG is positive; otherwise, disable it. 8118ARG is positive; otherwise, disable it.
8120 8119
@@ -8122,9 +8121,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
8122Enable the mode if ARG is nil, omitted, or is a positive number. 8121Enable the mode if ARG is nil, omitted, or is a positive number.
8123Disable the mode if ARG is a negative number. 8122Disable the mode if ARG is a negative number.
8124 8123
8125Display-Fill-Column-Indicator mode is enabled in all buffers where
8126`display-fill-column-indicator--turn-on' would do it.
8127
8128See `display-fill-column-indicator-mode' for more information on 8124See `display-fill-column-indicator-mode' for more information on
8129Display-Fill-Column-Indicator mode. 8125Display-Fill-Column-Indicator mode.
8130 8126
@@ -8185,7 +8181,10 @@ either customize it (see the info node `Easy Customization')
8185or call the function `global-display-line-numbers-mode'.") 8181or call the function `global-display-line-numbers-mode'.")
8186(custom-autoload 'global-display-line-numbers-mode "display-line-numbers" nil) 8182(custom-autoload 'global-display-line-numbers-mode "display-line-numbers" nil)
8187(autoload 'global-display-line-numbers-mode "display-line-numbers" "\ 8183(autoload 'global-display-line-numbers-mode "display-line-numbers" "\
8188Toggle Display-Line-Numbers mode in all buffers. 8184Toggle Display-Line-Numbers mode in many buffers.
8185Specifically, Display-Line-Numbers mode is enabled in all buffers
8186where `display-line-numbers--turn-on' would do it.
8187
8189With prefix ARG, enable Global Display-Line-Numbers mode if ARG is 8188With prefix ARG, enable Global Display-Line-Numbers mode if ARG is
8190positive; otherwise, disable it. 8189positive; otherwise, disable it.
8191 8190
@@ -8193,9 +8192,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
8193Enable the mode if ARG is nil, omitted, or is a positive number. 8192Enable the mode if ARG is nil, omitted, or is a positive number.
8194Disable the mode if ARG is a negative number. 8193Disable the mode if ARG is a negative number.
8195 8194
8196Display-Line-Numbers mode is enabled in all buffers where
8197`display-line-numbers--turn-on' would do it.
8198
8199See `display-line-numbers-mode' for more information on 8195See `display-line-numbers-mode' for more information on
8200Display-Line-Numbers mode. 8196Display-Line-Numbers mode.
8201 8197
@@ -8550,8 +8546,8 @@ switch on the minor mode in all major modes), nil (meaning don't
8550switch on in any major mode), a list of modes (meaning switch on only 8546switch on in any major mode), a list of modes (meaning switch on only
8551in those modes and their descendants), or a list (not MODES...), 8547in those modes and their descendants), or a list (not MODES...),
8552meaning switch on in any major mode except MODES. The value can also 8548meaning switch on in any major mode except MODES. The value can also
8553mix all of these forms, see the info node `Defining Minor Modes' for 8549mix all of these forms, see the Info node `(elisp)Defining Minor Modes'
8554details. The :predicate key causes the macro to create a user option 8550for details. The :predicate key causes the macro to create a user option
8555named the same as MODE, but ending with \"-modes\" instead of \"-mode\". 8551named the same as MODE, but ending with \"-modes\" instead of \"-mode\".
8556That user option can then be used to customize in which modes this 8552That user option can then be used to customize in which modes this
8557globalized minor mode will be switched on. 8553globalized minor mode will be switched on.
@@ -8929,7 +8925,7 @@ A second call of this function without changing point inserts the next match.
8929A call with prefix PREFIX reads the symbol to insert from the minibuffer with 8925A call with prefix PREFIX reads the symbol to insert from the minibuffer with
8930completion. 8926completion.
8931 8927
8932(fn PREFIX)" t) 8928(fn PREFIX)" '("P"))
8933(autoload 'ebrowse-tags-loop-continue "ebrowse" "\ 8929(autoload 'ebrowse-tags-loop-continue "ebrowse" "\
8934Repeat last operation on files in tree. 8930Repeat last operation on files in tree.
8935FIRST-TIME non-nil means this is not a repetition, but the first time. 8931FIRST-TIME non-nil means this is not a repetition, but the first time.
@@ -9851,7 +9847,7 @@ Describe CTR if it is a class constructor.
9851 9847
9852;;; Generated autoloads from emacs-lisp/eldoc.el 9848;;; Generated autoloads from emacs-lisp/eldoc.el
9853 9849
9854(push '(eldoc 1 15 0) package--builtin-versions) 9850(push '(eldoc 1 16 0) package--builtin-versions)
9855 9851
9856 9852
9857;;; Generated autoloads from elec-pair.el 9853;;; Generated autoloads from elec-pair.el
@@ -9951,32 +9947,6 @@ mode hooks.
9951(register-definition-prefixes "elide-head" '("elide-head-")) 9947(register-definition-prefixes "elide-head" '("elide-head-"))
9952 9948
9953 9949
9954;;; Generated autoloads from emacs-lisp/elint.el
9955
9956(autoload 'elint-file "elint" "\
9957Lint the file FILE.
9958
9959(fn FILE)" t)
9960(autoload 'elint-directory "elint" "\
9961Lint all the .el files in DIRECTORY.
9962A complicated directory may require a lot of memory.
9963
9964(fn DIRECTORY)" t)
9965(autoload 'elint-current-buffer "elint" "\
9966Lint the current buffer.
9967If necessary, this first calls `elint-initialize'." t)
9968(autoload 'elint-defun "elint" "\
9969Lint the function at point.
9970If necessary, this first calls `elint-initialize'." t)
9971(autoload 'elint-initialize "elint" "\
9972Initialize elint.
9973If elint is already initialized, this does nothing, unless
9974optional prefix argument REINIT is non-nil.
9975
9976(fn &optional REINIT)" t)
9977(register-definition-prefixes "elint" '("elint-"))
9978
9979
9980;;; Generated autoloads from progmodes/elixir-ts-mode.el 9950;;; Generated autoloads from progmodes/elixir-ts-mode.el
9981 9951
9982(autoload 'elixir-ts-mode "elixir-ts-mode" "\ 9952(autoload 'elixir-ts-mode "elixir-ts-mode" "\
@@ -10721,7 +10691,7 @@ ERC assigns SERVER and FULL-NAME the associated keyword values
10721and defers to `erc-compute-port', `erc-compute-user', and 10691and defers to `erc-compute-port', `erc-compute-user', and
10722`erc-compute-nick' for those respective parameters. 10692`erc-compute-nick' for those respective parameters.
10723 10693
10724(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" t) 10694(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME ID)" '((let ((erc--display-context `((erc-interactive-display . erc) ,@erc--display-context))) (erc-select-read-args))))
10725(defalias 'erc-select #'erc) 10695(defalias 'erc-select #'erc)
10726(autoload 'erc-tls "erc" "\ 10696(autoload 'erc-tls "erc" "\
10727Connect to an IRC server over a TLS-encrypted connection. 10697Connect to an IRC server over a TLS-encrypted connection.
@@ -10744,7 +10714,7 @@ See the alternative entry-point command `erc' as well as Info
10744node `(erc) Connecting' for a fuller description of the various 10714node `(erc) Connecting' for a fuller description of the various
10745parameters, like ID. 10715parameters, like ID.
10746 10716
10747(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" t) 10717(fn &key SERVER PORT NICK USER PASSWORD FULL-NAME CLIENT-CERTIFICATE ID)" '((let ((erc-default-port erc-default-port-tls) (erc--display-context `((erc-interactive-display . erc-tls) ,@erc--display-context))) (erc-select-read-args))))
10748(autoload 'erc-handle-irc-url "erc" "\ 10718(autoload 'erc-handle-irc-url "erc" "\
10749Use ERC to IRC on HOST:PORT in CHANNEL. 10719Use ERC to IRC on HOST:PORT in CHANNEL.
10750If ERC is already connected to HOST:PORT, simply /join CHANNEL. 10720If ERC is already connected to HOST:PORT, simply /join CHANNEL.
@@ -10976,9 +10946,7 @@ it has to be wrapped in `(eval (quote ...))'.
10976If NAME is already defined as a test and Emacs is running 10946If NAME is already defined as a test and Emacs is running
10977in batch mode, an error is signaled. 10947in batch mode, an error is signaled.
10978 10948
10979(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil t) 10949(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags \\='(TAG...)] BODY...)" nil 'macro)
10980(function-put 'ert-deftest 'doc-string-elt 3)
10981(function-put 'ert-deftest 'lisp-indent-function 2)
10982(autoload 'ert-run-tests-batch "ert" "\ 10950(autoload 'ert-run-tests-batch "ert" "\
10983Run the tests specified by SELECTOR, printing results to the terminal. 10951Run the tests specified by SELECTOR, printing results to the terminal.
10984 10952
@@ -12830,6 +12798,8 @@ value is the default binding of the variable.
12830The connection-local value of `path-separator'.") 12798The connection-local value of `path-separator'.")
12831(autoload 'null-device "files-x" "\ 12799(autoload 'null-device "files-x" "\
12832The connection-local value of `null-device'.") 12800The connection-local value of `null-device'.")
12801(autoload 'exec-suffixes "files-x" "\
12802The connection-local value of `exec-suffixes'.")
12833(register-definition-prefixes "files-x" '("connection-local-" "dir-locals-to-string" "modify-" "read-")) 12803(register-definition-prefixes "files-x" '("connection-local-" "dir-locals-to-string" "modify-" "read-"))
12834 12804
12835 12805
@@ -13399,8 +13369,6 @@ evaluate the variable `flymake-mode'.
13399The mode's hook is called both when the mode is enabled and when it is 13369The mode's hook is called both when the mode is enabled and when it is
13400disabled. 13370disabled.
13401 13371
13402\\{flymake-mode-map}
13403
13404(fn &optional ARG)" t) 13372(fn &optional ARG)" t)
13405(autoload 'flymake-mode-on "flymake" "\ 13373(autoload 'flymake-mode-on "flymake" "\
13406Turn Flymake mode on.") 13374Turn Flymake mode on.")
@@ -15232,7 +15200,10 @@ either customize it (see the info node `Easy Customization')
15232or call the function `global-goto-address-mode'.") 15200or call the function `global-goto-address-mode'.")
15233(custom-autoload 'global-goto-address-mode "goto-addr" nil) 15201(custom-autoload 'global-goto-address-mode "goto-addr" nil)
15234(autoload 'global-goto-address-mode "goto-addr" "\ 15202(autoload 'global-goto-address-mode "goto-addr" "\
15235Toggle Goto-Address mode in all buffers. 15203Toggle Goto-Address mode in many buffers.
15204Specifically, Goto-Address mode is enabled in all buffers where
15205`goto-addr-mode--turn-on' would do it.
15206
15236With prefix ARG, enable Global Goto-Address mode if ARG is positive; 15207With prefix ARG, enable Global Goto-Address mode if ARG is positive;
15237otherwise, disable it. 15208otherwise, disable it.
15238 15209
@@ -15240,9 +15211,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
15240Enable the mode if ARG is nil, omitted, or is a positive number. 15211Enable the mode if ARG is nil, omitted, or is a positive number.
15241Disable the mode if ARG is a negative number. 15212Disable the mode if ARG is a negative number.
15242 15213
15243Goto-Address mode is enabled in all buffers where
15244`goto-addr-mode--turn-on' would do it.
15245
15246See `goto-address-mode' for more information on Goto-Address mode. 15214See `goto-address-mode' for more information on Goto-Address mode.
15247 15215
15248(fn &optional ARG)" t) 15216(fn &optional ARG)" t)
@@ -16433,7 +16401,10 @@ either customize it (see the info node `Easy Customization')
16433or call the function `global-hi-lock-mode'.") 16401or call the function `global-hi-lock-mode'.")
16434(custom-autoload 'global-hi-lock-mode "hi-lock" nil) 16402(custom-autoload 'global-hi-lock-mode "hi-lock" nil)
16435(autoload 'global-hi-lock-mode "hi-lock" "\ 16403(autoload 'global-hi-lock-mode "hi-lock" "\
16436Toggle Hi-Lock mode in all buffers. 16404Toggle Hi-Lock mode in many buffers.
16405Specifically, Hi-Lock mode is enabled in all buffers where
16406`turn-on-hi-lock-if-enabled' would do it.
16407
16437With prefix ARG, enable Global Hi-Lock mode if ARG is positive; 16408With prefix ARG, enable Global Hi-Lock mode if ARG is positive;
16438otherwise, disable it. 16409otherwise, disable it.
16439 16410
@@ -16441,9 +16412,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
16441Enable the mode if ARG is nil, omitted, or is a positive number. 16412Enable the mode if ARG is nil, omitted, or is a positive number.
16442Disable the mode if ARG is a negative number. 16413Disable the mode if ARG is a negative number.
16443 16414
16444Hi-Lock mode is enabled in all buffers where
16445`turn-on-hi-lock-if-enabled' would do it.
16446
16447See `hi-lock-mode' for more information on Hi-Lock mode. 16415See `hi-lock-mode' for more information on Hi-Lock mode.
16448 16416
16449(fn &optional ARG)" t) 16417(fn &optional ARG)" t)
@@ -16812,7 +16780,10 @@ either customize it (see the info node `Easy Customization')
16812or call the function `global-highlight-changes-mode'.") 16780or call the function `global-highlight-changes-mode'.")
16813(custom-autoload 'global-highlight-changes-mode "hilit-chg" nil) 16781(custom-autoload 'global-highlight-changes-mode "hilit-chg" nil)
16814(autoload 'global-highlight-changes-mode "hilit-chg" "\ 16782(autoload 'global-highlight-changes-mode "hilit-chg" "\
16815Toggle Highlight-Changes mode in all buffers. 16783Toggle Highlight-Changes mode in many buffers.
16784Specifically, Highlight-Changes mode is enabled in all buffers where
16785`highlight-changes-mode-turn-on' would do it.
16786
16816With prefix ARG, enable Global Highlight-Changes mode if ARG is 16787With prefix ARG, enable Global Highlight-Changes mode if ARG is
16817positive; otherwise, disable it. 16788positive; otherwise, disable it.
16818 16789
@@ -16820,9 +16791,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
16820Enable the mode if ARG is nil, omitted, or is a positive number. 16791Enable the mode if ARG is nil, omitted, or is a positive number.
16821Disable the mode if ARG is a negative number. 16792Disable the mode if ARG is a negative number.
16822 16793
16823Highlight-Changes mode is enabled in all buffers where
16824`highlight-changes-mode-turn-on' would do it.
16825
16826See `highlight-changes-mode' for more information on Highlight-Changes 16794See `highlight-changes-mode' for more information on Highlight-Changes
16827mode. 16795mode.
16828 16796
@@ -17102,8 +17070,7 @@ inlined into the compiled format versions. This means that if you
17102change its definition, you should explicitly call 17070change its definition, you should explicitly call
17103`ibuffer-recompile-formats'. 17071`ibuffer-recompile-formats'.
17104 17072
17105(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil t) 17073(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil 'macro)
17106(function-put 'define-ibuffer-column 'lisp-indent-function 'defun)
17107(autoload 'define-ibuffer-sorter "ibuf-macs" "\ 17074(autoload 'define-ibuffer-sorter "ibuf-macs" "\
17108Define a method of sorting named NAME. 17075Define a method of sorting named NAME.
17109DOCUMENTATION is the documentation of the function, which will be called 17076DOCUMENTATION is the documentation of the function, which will be called
@@ -17114,9 +17081,7 @@ For sorting, the forms in BODY will be evaluated with `a' bound to one
17114buffer object, and `b' bound to another. BODY should return a non-nil 17081buffer object, and `b' bound to another. BODY should return a non-nil
17115value if and only if `a' is \"less than\" `b'. 17082value if and only if `a' is \"less than\" `b'.
17116 17083
17117(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil t) 17084(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil 'macro)
17118(function-put 'define-ibuffer-sorter 'lisp-indent-function 1)
17119(function-put 'define-ibuffer-sorter 'doc-string-elt 2)
17120(autoload 'define-ibuffer-op "ibuf-macs" "\ 17085(autoload 'define-ibuffer-op "ibuf-macs" "\
17121Generate a function which operates on a buffer. 17086Generate a function which operates on a buffer.
17122OP becomes the name of the function; if it doesn't begin with 17087OP becomes the name of the function; if it doesn't begin with
@@ -17159,9 +17124,7 @@ BODY define the operation; they are forms to evaluate per each
17159marked buffer. BODY is evaluated with `buf' bound to the 17124marked buffer. BODY is evaluated with `buf' bound to the
17160buffer object. 17125buffer object.
17161 17126
17162(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil t) 17127(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING BEFORE AFTER COMPLEX) &rest BODY)" nil 'macro)
17163(function-put 'define-ibuffer-op 'lisp-indent-function 2)
17164(function-put 'define-ibuffer-op 'doc-string-elt 3)
17165(autoload 'define-ibuffer-filter "ibuf-macs" "\ 17128(autoload 'define-ibuffer-filter "ibuf-macs" "\
17166Define a filter named NAME. 17129Define a filter named NAME.
17167DOCUMENTATION is the documentation of the function. 17130DOCUMENTATION is the documentation of the function.
@@ -17176,9 +17139,7 @@ not a particular buffer should be displayed or not. The forms in BODY
17176will be evaluated with BUF bound to the buffer object, and QUALIFIER 17139will be evaluated with BUF bound to the buffer object, and QUALIFIER
17177bound to the current value of the filter. 17140bound to the current value of the filter.
17178 17141
17179(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil t) 17142(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil 'macro)
17180(function-put 'define-ibuffer-filter 'lisp-indent-function 2)
17181(function-put 'define-ibuffer-filter 'doc-string-elt 2)
17182(register-definition-prefixes "ibuf-macs" '("ibuffer-")) 17143(register-definition-prefixes "ibuf-macs" '("ibuffer-"))
17183 17144
17184 17145
@@ -18088,8 +18049,9 @@ Toggle thumbnails in front of marked file names in the Dired buffer.
18088If no file is marked, toggle display of thumbnail on the current file's line. 18049If no file is marked, toggle display of thumbnail on the current file's line.
18089ARG, if non-nil (interactively, the prefix argument), specifies the files 18050ARG, if non-nil (interactively, the prefix argument), specifies the files
18090whose thumbnail display to toggle instead of the marked files: if ARG is an 18051whose thumbnail display to toggle instead of the marked files: if ARG is an
18091integer, use the next ARG (or previous -ARG, if ARG<0) files; any other 18052integer, use the next ARG (or previous -ARG, if ARG<0) files; if ARG is
18092value of ARG means toggle thumbnail display of the current line's file. 18053the symbol `marked', use only the marked files, if any; any other value of
18054ARG means toggle thumbnail display of the current line's file.
18093 18055
18094(fn &optional ARG)" '(dired-mode)) 18056(fn &optional ARG)" '(dired-mode))
18095(autoload 'image-dired-jump-thumbnail-buffer "image-dired-dired" "\ 18057(autoload 'image-dired-jump-thumbnail-buffer "image-dired-dired" "\
@@ -20017,7 +19979,9 @@ keys and associated values are:
20017 files that are concerned by the current operation (using relative names); 19979 files that are concerned by the current operation (using relative names);
20018 `log-edit-diff-function' -- function taking no arguments that 19980 `log-edit-diff-function' -- function taking no arguments that
20019 displays a diff of the files concerned by the current operation. 19981 displays a diff of the files concerned by the current operation.
20020 `vc-log-fileset' -- the VC fileset to be committed (if any). 19982 `vc-log-fileset' -- list of files to be committed, if any
19983 (not a true VC fileset structure as returned by
19984 `vc-deduce-fileset', but only the second element).
20021 19985
20022If BUFFER is non-nil, `log-edit' will switch to that buffer, use it 19986If BUFFER is non-nil, `log-edit' will switch to that buffer, use it
20023to edit the log message and go back to the current buffer when 19987to edit the log message and go back to the current buffer when
@@ -27204,8 +27168,6 @@ evaluate the variable `rectangle-mark-mode'.
27204The mode's hook is called both when the mode is enabled and when it is 27168The mode's hook is called both when the mode is enabled and when it is
27205disabled. 27169disabled.
27206 27170
27207\\{rectangle-mark-mode-map}
27208
27209(fn &optional ARG)" t) 27171(fn &optional ARG)" t)
27210(register-definition-prefixes "rect" '("apply-on-rectangle" "clear-rectangle-line" "delete-" "extract-rectangle-" "killed-rectangle" "ope" "rectangle-" "spaces-string" "string-rectangle-")) 27172(register-definition-prefixes "rect" '("apply-on-rectangle" "clear-rectangle-line" "delete-" "extract-rectangle-" "killed-rectangle" "ope" "rectangle-" "spaces-string" "string-rectangle-"))
27211 27173
@@ -29004,6 +28966,22 @@ disabled.
29004(register-definition-prefixes "semantic/senator" '("semantic-up-reference" "senator-")) 28966(register-definition-prefixes "semantic/senator" '("semantic-up-reference" "senator-"))
29005 28967
29006 28968
28969;;; Generated autoloads from send-to.el
28970
28971(autoload 'send-to-supported-p "send-to" "\
28972Return non-nil for platforms where `send-to' is supported.")
28973(autoload 'send-to "send-to" "\
28974Send file(s) or region text to (non-Emacs) applications or services.
28975
28976Sending is handled by the first supported handler from `send-to-handlers'.
28977
28978ITEMS list is also populated by the resolved handler, but can be
28979explicitly overridden.
28980
28981(fn &optional ITEMS)" t)
28982(register-definition-prefixes "send-to" '("send-to-"))
28983
28984
29007;;; Generated autoloads from mail/sendmail.el 28985;;; Generated autoloads from mail/sendmail.el
29008 28986
29009(defvar mail-from-style 'angles "\ 28987(defvar mail-from-style 'angles "\
@@ -31509,7 +31487,10 @@ either customize it (see the info node `Easy Customization')
31509or call the function `global-subword-mode'.") 31487or call the function `global-subword-mode'.")
31510(custom-autoload 'global-subword-mode "subword" nil) 31488(custom-autoload 'global-subword-mode "subword" nil)
31511(autoload 'global-subword-mode "subword" "\ 31489(autoload 'global-subword-mode "subword" "\
31512Toggle Subword mode in all buffers. 31490Toggle Subword mode in many buffers.
31491Specifically, Subword mode is enabled in all buffers where `(lambda
31492nil (subword-mode 1))' would do it.
31493
31513With prefix ARG, enable Global Subword mode if ARG is positive; 31494With prefix ARG, enable Global Subword mode if ARG is positive;
31514otherwise, disable it. 31495otherwise, disable it.
31515 31496
@@ -31517,9 +31498,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
31517Enable the mode if ARG is nil, omitted, or is a positive number. 31498Enable the mode if ARG is nil, omitted, or is a positive number.
31518Disable the mode if ARG is a negative number. 31499Disable the mode if ARG is a negative number.
31519 31500
31520Subword mode is enabled in all buffers where `(lambda nil
31521(subword-mode 1))' would do it.
31522
31523See `subword-mode' for more information on Subword mode. 31501See `subword-mode' for more information on Subword mode.
31524 31502
31525(fn &optional ARG)" t) 31503(fn &optional ARG)" t)
@@ -31558,7 +31536,10 @@ either customize it (see the info node `Easy Customization')
31558or call the function `global-superword-mode'.") 31536or call the function `global-superword-mode'.")
31559(custom-autoload 'global-superword-mode "subword" nil) 31537(custom-autoload 'global-superword-mode "subword" nil)
31560(autoload 'global-superword-mode "subword" "\ 31538(autoload 'global-superword-mode "subword" "\
31561Toggle Superword mode in all buffers. 31539Toggle Superword mode in many buffers.
31540Specifically, Superword mode is enabled in all buffers where `(lambda
31541nil (superword-mode 1))' would do it.
31542
31562With prefix ARG, enable Global Superword mode if ARG is positive; 31543With prefix ARG, enable Global Superword mode if ARG is positive;
31563otherwise, disable it. 31544otherwise, disable it.
31564 31545
@@ -31566,9 +31547,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
31566Enable the mode if ARG is nil, omitted, or is a positive number. 31547Enable the mode if ARG is nil, omitted, or is a positive number.
31567Disable the mode if ARG is a negative number. 31548Disable the mode if ARG is a negative number.
31568 31549
31569Superword mode is enabled in all buffers where `(lambda nil
31570(superword-mode 1))' would do it.
31571
31572See `superword-mode' for more information on Superword mode. 31550See `superword-mode' for more information on Superword mode.
31573 31551
31574(fn &optional ARG)" t) 31552(fn &optional ARG)" t)
@@ -31693,7 +31671,10 @@ either customize it (see the info node `Easy Customization')
31693or call the function `global-tab-line-mode'.") 31671or call the function `global-tab-line-mode'.")
31694(custom-autoload 'global-tab-line-mode "tab-line" nil) 31672(custom-autoload 'global-tab-line-mode "tab-line" nil)
31695(autoload 'global-tab-line-mode "tab-line" "\ 31673(autoload 'global-tab-line-mode "tab-line" "\
31696Toggle Tab-Line mode in all buffers. 31674Toggle Tab-Line mode in many buffers.
31675Specifically, Tab-Line mode is enabled in all buffers where
31676`tab-line-mode--turn-on' would do it.
31677
31697With prefix ARG, enable Global Tab-Line mode if ARG is positive; 31678With prefix ARG, enable Global Tab-Line mode if ARG is positive;
31698otherwise, disable it. 31679otherwise, disable it.
31699 31680
@@ -31701,9 +31682,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
31701Enable the mode if ARG is nil, omitted, or is a positive number. 31682Enable the mode if ARG is nil, omitted, or is a positive number.
31702Disable the mode if ARG is a negative number. 31683Disable the mode if ARG is a negative number.
31703 31684
31704Tab-Line mode is enabled in all buffers where `tab-line-mode--turn-on'
31705would do it.
31706
31707See `tab-line-mode' for more information on Tab-Line mode. 31685See `tab-line-mode' for more information on Tab-Line mode.
31708 31686
31709(fn &optional ARG)" t) 31687(fn &optional ARG)" t)
@@ -33980,7 +33958,7 @@ If the buffer runs `dired', the buffer is reverted." t)
33980Visit the file or directory named on this line as the superuser. 33958Visit the file or directory named on this line as the superuser.
33981 33959
33982By default this is done using the \"sudo\" Tramp method. 33960By default this is done using the \"sudo\" Tramp method.
33983YOu can customize `tramp-file-name-with-method' to change this. 33961You can customize `tramp-file-name-with-method' to change this.
33984 33962
33985Interactively, with a prefix argument, prompt for a different method." t) 33963Interactively, with a prefix argument, prompt for a different method." t)
33986(register-definition-prefixes "tramp-cmds" '("tramp-" "with-tramp-file-name-with-method")) 33964(register-definition-prefixes "tramp-cmds" '("tramp-" "with-tramp-file-name-with-method"))
@@ -34058,7 +34036,7 @@ Interactively, with a prefix argument, prompt for a different method." t)
34058 34036
34059;;; Generated autoloads from net/trampver.el 34037;;; Generated autoloads from net/trampver.el
34060 34038
34061(push '(tramp 2 8 0) package--builtin-versions) 34039(push '(tramp 2 8 1 -1) package--builtin-versions)
34062(register-definition-prefixes "trampver" '("tramp-")) 34040(register-definition-prefixes "trampver" '("tramp-"))
34063 34041
34064 34042
@@ -35627,6 +35605,7 @@ The merge base is a common ancestor between REV1 and REV2 revisions.
35627(fn FILES REV1 REV2)" t) 35605(fn FILES REV1 REV2)" t)
35628(autoload 'vc-root-diff-incoming "vc" "\ 35606(autoload 'vc-root-diff-incoming "vc" "\
35629Report diff of all changes that would be pulled from REMOTE-LOCATION. 35607Report diff of all changes that would be pulled from REMOTE-LOCATION.
35608When unspecified REMOTE-LOCATION is the place \\[vc-update] would pull from.
35630When called interactively with a prefix argument, prompt for REMOTE-LOCATION. 35609When called interactively with a prefix argument, prompt for REMOTE-LOCATION.
35631In some version control systems REMOTE-LOCATION can be a remote branch name. 35610In some version control systems REMOTE-LOCATION can be a remote branch name.
35632 35611
@@ -35636,6 +35615,7 @@ global binding.
35636(fn &optional REMOTE-LOCATION)" t) 35615(fn &optional REMOTE-LOCATION)" t)
35637(autoload 'vc-root-diff-outgoing "vc" "\ 35616(autoload 'vc-root-diff-outgoing "vc" "\
35638Report diff of all changes that would be pushed to REMOTE-LOCATION. 35617Report diff of all changes that would be pushed to REMOTE-LOCATION.
35618When unspecified REMOTE-LOCATION is the place \\[vc-push] would push to.
35639When called interactively with a prefix argument, prompt for REMOTE-LOCATION. 35619When called interactively with a prefix argument, prompt for REMOTE-LOCATION.
35640In some version control systems REMOTE-LOCATION can be a remote branch name. 35620In some version control systems REMOTE-LOCATION can be a remote branch name.
35641 35621
@@ -35752,12 +35732,12 @@ locked files at or below DIR (but if NAME is empty, locked files are
35752allowed and simply skipped). 35732allowed and simply skipped).
35753If BRANCHP is non-nil (interactively, the prefix argument), switch to the 35733If BRANCHP is non-nil (interactively, the prefix argument), switch to the
35754branch and check out and update the files to their version on that branch. 35734branch and check out and update the files to their version on that branch.
35735In this case NAME may not be empty.
35755This function runs the hook `vc-retrieve-tag-hook' when finished. 35736This function runs the hook `vc-retrieve-tag-hook' when finished.
35756 35737
35757(fn DIR NAME &optional BRANCHP)" t) 35738(fn DIR NAME &optional BRANCHP)" t)
35758(autoload 'vc-switch-branch "vc" "\ 35739(autoload 'vc-switch-branch "vc" "\
35759Switch to the branch NAME in the directory DIR. 35740Switch to the branch NAME in the directory DIR.
35760If NAME is empty, it refers to the latest revision of the current branch.
35761Interactively, prompt for DIR only for VCS that works at file level; 35741Interactively, prompt for DIR only for VCS that works at file level;
35762otherwise use the root directory of the current buffer's VC tree. 35742otherwise use the root directory of the current buffer's VC tree.
35763Interactively, prompt for the NAME of the branch. 35743Interactively, prompt for the NAME of the branch.
@@ -35801,12 +35781,14 @@ The command prompts for the branch whose change log to show.
35801(fn BRANCH)" t) 35781(fn BRANCH)" t)
35802(autoload 'vc-log-incoming "vc" "\ 35782(autoload 'vc-log-incoming "vc" "\
35803Show log of changes that will be received with pull from REMOTE-LOCATION. 35783Show log of changes that will be received with pull from REMOTE-LOCATION.
35784When unspecified REMOTE-LOCATION is the place \\[vc-update] would pull from.
35804When called interactively with a prefix argument, prompt for REMOTE-LOCATION. 35785When called interactively with a prefix argument, prompt for REMOTE-LOCATION.
35805In some version control systems REMOTE-LOCATION can be a remote branch name. 35786In some version control systems REMOTE-LOCATION can be a remote branch name.
35806 35787
35807(fn &optional REMOTE-LOCATION)" t) 35788(fn &optional REMOTE-LOCATION)" t)
35808(autoload 'vc-log-outgoing "vc" "\ 35789(autoload 'vc-log-outgoing "vc" "\
35809Show log of changes that will be sent with a push operation to REMOTE-LOCATION. 35790Show log of changes that will be sent with a push operation to REMOTE-LOCATION.
35791When unspecified REMOTE-LOCATION is the place \\[vc-push] would push to.
35810When called interactively with a prefix argument, prompt for REMOTE-LOCATION. 35792When called interactively with a prefix argument, prompt for REMOTE-LOCATION.
35811In some version control systems REMOTE-LOCATION can be a remote branch name. 35793In some version control systems REMOTE-LOCATION can be a remote branch name.
35812 35794
@@ -35953,6 +35935,34 @@ When invoked interactively in a Log View buffer with
35953marked revisions, use those. 35935marked revisions, use those.
35954 35936
35955(fn ADDRESSEE SUBJECT REVISIONS)" t) 35937(fn ADDRESSEE SUBJECT REVISIONS)" t)
35938(autoload 'vc-add-working-tree "vc" "\
35939Create working tree DIRECTORY with same backing repository as this tree.
35940See Info node `(emacs)Other Working Trees' regarding VCS repositories
35941with multiple working trees.
35942
35943(fn BACKEND DIRECTORY)" t)
35944(autoload 'vc-switch-working-tree "vc" "\
35945Switch to this file or directory's analogue in working tree DIRECTORY.
35946This command switches to the file or directory which has the same path
35947relative to DIRECTORY that this buffer's file or directory has relative
35948to the root of this working tree.
35949DIRECTORY names another working tree with the same backing repository as
35950this tree; see Info node `(emacs)Other Working Trees' for general
35951information regarding VCS repositories with multiple working trees.
35952
35953(fn DIRECTORY)" t)
35954(autoload 'vc-delete-working-tree "vc" "\
35955Delete working tree DIRECTORY with same backing repository as this tree.
35956See Info node `(emacs)Other Working Trees' regarding VCS repositories
35957with multiple working trees.
35958
35959(fn BACKEND DIRECTORY)" t)
35960(autoload 'vc-move-working-tree "vc" "\
35961Relocate a working tree from FROM to TO.
35962See Info node `(emacs)Other Working Trees' regarding VCS repositories
35963with multiple working trees.
35964
35965(fn BACKEND FROM TO)" t)
35956(register-definition-prefixes "vc" '("log-view-vc-prev-" "vc-" "with-vc-properties")) 35966(register-definition-prefixes "vc" '("log-view-vc-prev-" "vc-" "with-vc-properties"))
35957 35967
35958 35968
@@ -37300,7 +37310,10 @@ either customize it (see the info node `Easy Customization')
37300or call the function `global-visual-wrap-prefix-mode'.") 37310or call the function `global-visual-wrap-prefix-mode'.")
37301(custom-autoload 'global-visual-wrap-prefix-mode "visual-wrap" nil) 37311(custom-autoload 'global-visual-wrap-prefix-mode "visual-wrap" nil)
37302(autoload 'global-visual-wrap-prefix-mode "visual-wrap" "\ 37312(autoload 'global-visual-wrap-prefix-mode "visual-wrap" "\
37303Toggle Visual-Wrap-Prefix mode in all buffers. 37313Toggle Visual-Wrap-Prefix mode in many buffers.
37314Specifically, Visual-Wrap-Prefix mode is enabled in all buffers where
37315`visual-wrap-prefix-mode' would do it.
37316
37304With prefix ARG, enable Global Visual-Wrap-Prefix mode if ARG is 37317With prefix ARG, enable Global Visual-Wrap-Prefix mode if ARG is
37305positive; otherwise, disable it. 37318positive; otherwise, disable it.
37306 37319
@@ -37308,9 +37321,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
37308Enable the mode if ARG is nil, omitted, or is a positive number. 37321Enable the mode if ARG is nil, omitted, or is a positive number.
37309Disable the mode if ARG is a negative number. 37322Disable the mode if ARG is a negative number.
37310 37323
37311Visual-Wrap-Prefix mode is enabled in all buffers where
37312`visual-wrap-prefix-mode' would do it.
37313
37314See `visual-wrap-prefix-mode' for more information on 37324See `visual-wrap-prefix-mode' for more information on
37315Visual-Wrap-Prefix mode. 37325Visual-Wrap-Prefix mode.
37316 37326
@@ -37757,7 +37767,10 @@ either customize it (see the info node `Easy Customization')
37757or call the function `global-whitespace-mode'.") 37767or call the function `global-whitespace-mode'.")
37758(custom-autoload 'global-whitespace-mode "whitespace" nil) 37768(custom-autoload 'global-whitespace-mode "whitespace" nil)
37759(autoload 'global-whitespace-mode "whitespace" "\ 37769(autoload 'global-whitespace-mode "whitespace" "\
37760Toggle Whitespace mode in all buffers. 37770Toggle Whitespace mode in many buffers.
37771Specifically, Whitespace mode is enabled in all buffers where
37772`whitespace-turn-on-if-enabled' would do it.
37773
37761With prefix ARG, enable Global Whitespace mode if ARG is positive; 37774With prefix ARG, enable Global Whitespace mode if ARG is positive;
37762otherwise, disable it. 37775otherwise, disable it.
37763 37776
@@ -37765,9 +37778,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
37765Enable the mode if ARG is nil, omitted, or is a positive number. 37778Enable the mode if ARG is nil, omitted, or is a positive number.
37766Disable the mode if ARG is a negative number. 37779Disable the mode if ARG is a negative number.
37767 37780
37768Whitespace mode is enabled in all buffers where
37769`whitespace-turn-on-if-enabled' would do it.
37770
37771See `whitespace-mode' for more information on Whitespace mode. 37781See `whitespace-mode' for more information on Whitespace mode.
37772 37782
37773(fn &optional ARG)" t) 37783(fn &optional ARG)" t)
@@ -38414,7 +38424,10 @@ either customize it (see the info node `Easy Customization')
38414or call the function `global-window-tool-bar-mode'.") 38424or call the function `global-window-tool-bar-mode'.")
38415(custom-autoload 'global-window-tool-bar-mode "window-tool-bar" nil) 38425(custom-autoload 'global-window-tool-bar-mode "window-tool-bar" nil)
38416(autoload 'global-window-tool-bar-mode "window-tool-bar" "\ 38426(autoload 'global-window-tool-bar-mode "window-tool-bar" "\
38417Toggle Window-Tool-Bar mode in all buffers. 38427Toggle Window-Tool-Bar mode in many buffers.
38428Specifically, Window-Tool-Bar mode is enabled in all buffers where
38429`window-tool-bar--turn-on' would do it.
38430
38418With prefix ARG, enable Global Window-Tool-Bar mode if ARG is 38431With prefix ARG, enable Global Window-Tool-Bar mode if ARG is
38419positive; otherwise, disable it. 38432positive; otherwise, disable it.
38420 38433
@@ -38422,9 +38435,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
38422Enable the mode if ARG is nil, omitted, or is a positive number. 38435Enable the mode if ARG is nil, omitted, or is a positive number.
38423Disable the mode if ARG is a negative number. 38436Disable the mode if ARG is a negative number.
38424 38437
38425Window-Tool-Bar mode is enabled in all buffers where
38426`window-tool-bar--turn-on' would do it.
38427
38428See `window-tool-bar-mode' for more information on Window-Tool-Bar 38438See `window-tool-bar-mode' for more information on Window-Tool-Bar
38429mode. 38439mode.
38430 38440
@@ -38643,7 +38653,10 @@ either customize it (see the info node `Easy Customization')
38643or call the function `global-word-wrap-whitespace-mode'.") 38653or call the function `global-word-wrap-whitespace-mode'.")
38644(custom-autoload 'global-word-wrap-whitespace-mode "word-wrap-mode" nil) 38654(custom-autoload 'global-word-wrap-whitespace-mode "word-wrap-mode" nil)
38645(autoload 'global-word-wrap-whitespace-mode "word-wrap-mode" "\ 38655(autoload 'global-word-wrap-whitespace-mode "word-wrap-mode" "\
38646Toggle Word-Wrap-Whitespace mode in all buffers. 38656Toggle Word-Wrap-Whitespace mode in many buffers.
38657Specifically, Word-Wrap-Whitespace mode is enabled in all buffers
38658where `word-wrap-whitespace-mode' would do it.
38659
38647With prefix ARG, enable Global Word-Wrap-Whitespace mode if ARG is 38660With prefix ARG, enable Global Word-Wrap-Whitespace mode if ARG is
38648positive; otherwise, disable it. 38661positive; otherwise, disable it.
38649 38662
@@ -38651,9 +38664,6 @@ If called from Lisp, toggle the mode if ARG is `toggle'.
38651Enable the mode if ARG is nil, omitted, or is a positive number. 38664Enable the mode if ARG is nil, omitted, or is a positive number.
38652Disable the mode if ARG is a negative number. 38665Disable the mode if ARG is a negative number.
38653 38666
38654Word-Wrap-Whitespace mode is enabled in all buffers where
38655`word-wrap-whitespace-mode' would do it.
38656
38657See `word-wrap-whitespace-mode' for more information on 38667See `word-wrap-whitespace-mode' for more information on
38658Word-Wrap-Whitespace mode. 38668Word-Wrap-Whitespace mode.
38659 38669
@@ -38990,9 +39000,9 @@ run a specific program. The program must be a member of
38990(provide 'loaddefs) 39000(provide 'loaddefs)
38991 39001
38992;; Local Variables: 39002;; Local Variables:
39003;; no-byte-compile: t
38993;; version-control: never 39004;; version-control: never
38994;; no-update-autoloads: t 39005;; no-update-autoloads: t
38995;; no-byte-compile: t
38996;; no-native-compile: t 39006;; no-native-compile: t
38997;; coding: utf-8-emacs-unix 39007;; coding: utf-8-emacs-unix
38998;; End: 39008;; End:
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 340a3f28756..93a05412a04 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1415,7 +1415,7 @@ Throw an error if another update process is in progress."
1415 (vc-call-backend 1415 (vc-call-backend
1416 backend 'dir-status-files def-dir nil 1416 backend 'dir-status-files def-dir nil
1417 (lambda (entries &optional more-to-come) 1417 (lambda (entries &optional more-to-come)
1418 ;; ENTRIES is a list of (FILE VC_STATE EXTRA) items. 1418 ;; ENTRIES is a list of (FILE VC-STATE EXTRA) items.
1419 ;; If MORE-TO-COME is true, then more updates will come from 1419 ;; If MORE-TO-COME is true, then more updates will come from
1420 ;; the asynchronous process. 1420 ;; the asynchronous process.
1421 (with-current-buffer buffer 1421 (with-current-buffer buffer
@@ -1520,7 +1520,7 @@ not under version control, prompt for a directory."
1520 (interactive) 1520 (interactive)
1521 (let ((root-dir (vc-root-dir))) 1521 (let ((root-dir (vc-root-dir)))
1522 (if root-dir (vc-dir root-dir) 1522 (if root-dir (vc-dir root-dir)
1523 (call-interactively 'vc-dir)))) 1523 (call-interactively #'vc-dir))))
1524 1524
1525;;;###autoload 1525;;;###autoload
1526(defun vc-dir (dir &optional backend) 1526(defun vc-dir (dir &optional backend)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 44af30b2eb0..680e74d8a6e 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1913,12 +1913,15 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
1913(declare-function vc-read-revision "vc" 1913(declare-function vc-read-revision "vc"
1914 (prompt &optional files backend default initial-input)) 1914 (prompt &optional files backend default initial-input))
1915 1915
1916(defun vc-git--read-start-point (&optional dir)
1917 (let ((branch (car (vc-git-branches))))
1918 (vc-read-revision (format-prompt "Start point" branch)
1919 (list (or dir (vc-git-root default-directory)))
1920 'Git branch)))
1921
1916(defun vc-git-create-tag (dir name branchp) 1922(defun vc-git-create-tag (dir name branchp)
1917 (let ((default-directory dir) 1923 (let ((default-directory dir)
1918 (start-point (when branchp (vc-read-revision 1924 (start-point (and branchp (vc-git--read-start-point dir))))
1919 (format-prompt "Start point"
1920 (car (vc-git-branches)))
1921 (list dir) 'Git (car (vc-git-branches))))))
1922 (and (or (zerop (vc-git-command nil t nil "update-index" "--refresh")) 1925 (and (or (zerop (vc-git-command nil t nil "update-index" "--refresh"))
1923 (y-or-n-p "Modified files exist. Proceed? ") 1926 (y-or-n-p "Modified files exist. Proceed? ")
1924 (user-error (format "Can't create %s with modified files" 1927 (user-error (format "Can't create %s with modified files"
@@ -2340,7 +2343,7 @@ In other modes, call `vc-deduce-fileset' to determine files to stash."
2340 (vc-resynch-buffer (vc-git-root default-directory) t t)) 2343 (vc-resynch-buffer (vc-git-root default-directory) t t))
2341 2344
2342(defun vc-git-stash-list () 2345(defun vc-git-stash-list ()
2343 (when-let* ((out (vc-git--run-command-string nil "stash" "list"))) 2346 (and-let* ((out (vc-git--run-command-string nil "stash" "list")))
2344 (split-string 2347 (split-string
2345 (replace-regexp-in-string 2348 (replace-regexp-in-string
2346 "^stash@" " " out) 2349 "^stash@" " " out)
@@ -2389,6 +2392,63 @@ In other modes, call `vc-deduce-fileset' to determine files to stash."
2389 (interactive "e") 2392 (interactive "e")
2390 (vc-dir-at-event e (popup-menu vc-git-stash-menu-map e))) 2393 (vc-dir-at-event e (popup-menu vc-git-stash-menu-map e)))
2391 2394
2395(defun vc-git--worktrees ()
2396 "Return an alist of alists regarding this repository's worktrees."
2397 (with-temp-buffer
2398 (vc-git-command nil 0 nil "worktree" "prune")
2399 (vc-git-command t 0 nil "worktree" "list" "--porcelain" "-z")
2400 (let (worktrees current-root current-rest)
2401 (goto-char (point-min))
2402 (while
2403 (re-search-forward "\\=\\(\\([a-zA-Z]+\\)\\(?: \\([^\0]+\\)\\)?\\)?\0"
2404 nil t)
2405 (if (match-string 1)
2406 (let ((k (intern (match-string 2)))
2407 (v (or (match-string 3) t)))
2408 (cond ((and (not current-root) (eq k 'worktree))
2409 (setq current-root (file-name-as-directory v)))
2410 ((not (eq k 'worktree))
2411 (push (cons k v) current-rest))
2412 (t
2413 (error "'git worktree' output parse error"))))
2414 (push (cons current-root current-rest) worktrees)
2415 (setq current-root nil current-rest nil)))
2416 (or worktrees
2417 (error "'git worktree' output parse error")))))
2418
2419(defun vc-git-known-other-working-trees ()
2420 (cl-loop with root = (expand-file-name (vc-git-root default-directory))
2421 for (worktree) in (vc-git--worktrees)
2422 unless (equal worktree root)
2423 collect (abbreviate-file-name worktree)))
2424
2425(defun vc-git-add-working-tree (directory)
2426 (letrec ((dir (expand-file-name directory))
2427 (vc-filter-command-function #'list) ; see `vc-read-revision'
2428 (revs (vc-git-revision-table nil))
2429 (table (lazy-completion-table table (lambda () revs)))
2430 (branch (completing-read (format-prompt "New or existing branch"
2431 "latest revision, detached")
2432 table nil nil nil 'vc-revision-history))
2433 (args (cond ((string-empty-p branch)
2434 (list "--detach" dir))
2435 ((member branch revs)
2436 (list dir branch))
2437 (t
2438 (list "-b" branch dir (vc-git--read-start-point))))))
2439 (apply #'vc-git-command nil 0 nil "worktree" "add" args)))
2440
2441(defun vc-git-delete-working-tree (directory)
2442 (vc-git-command nil 0 nil "worktree" "remove" "-f"
2443 (expand-file-name directory)))
2444
2445(defun vc-git-move-working-tree (from to)
2446 ;; 'git worktree move' can't move the main worktree, but moving and
2447 ;; then repairing like this can.
2448 (rename-file from (directory-file-name to) 1)
2449 (let ((default-directory to))
2450 (vc-git-command nil 0 nil "worktree" "repair")))
2451
2392 2452
2393;;; Internal commands 2453;;; Internal commands
2394 2454
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 4e9057db4f9..976c8183efe 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -1217,7 +1217,7 @@ It is based on `log-edit-mode', and has Hg-specific extensions.")
1217(defalias 'vc-hg-async-checkins #'always) 1217(defalias 'vc-hg-async-checkins #'always)
1218 1218
1219(defun vc-hg-checkin (files comment &optional _rev) 1219(defun vc-hg-checkin (files comment &optional _rev)
1220 "Hg-specific version of `vc-backend-checkin'. 1220 "Hg-specific version of `vc-BACKEND-checkin'.
1221REV is ignored." 1221REV is ignored."
1222 (let ((args (nconc (list "commit" "-m") 1222 (let ((args (nconc (list "commit" "-m")
1223 (vc-hg--extract-headers comment)))) 1223 (vc-hg--extract-headers comment))))
@@ -1681,6 +1681,57 @@ Intended for use via the `vc-hg--async-command' wrapper."
1681 (concat "paths." (or remote-name "default"))) 1681 (concat "paths." (or remote-name "default")))
1682 (buffer-substring-no-properties (point-min) (1- (point-max)))))) 1682 (buffer-substring-no-properties (point-min) (1- (point-max))))))
1683 1683
1684(defun vc-hg-known-other-working-trees ()
1685 ;; Mercurial doesn't maintain records of shared repositories.
1686 ;; The first repository knows nothing about shares created from it,
1687 ;; and each share only has a reference back to the first repository.
1688 ;;
1689 ;; Therefore, to support the VC API for other working trees, Emacs
1690 ;; needs to maintain records of its own about other working trees.
1691 ;; Rather than create something new our strategy is to rely on
1692 ;; project.el's knowledge of existing projects.
1693 ;; Note that this relies on code calling `vc-hg-add-working-tree'
1694 ;; registering the resultant working tree with project.el.
1695 (let* ((our-root (vc-hg-root default-directory))
1696 (our-sp (expand-file-name ".hg/sharedpath" our-root))
1697 our-store shares)
1698 (if (file-exists-p our-sp)
1699 (with-temp-buffer
1700 (insert-file-contents-literally our-sp)
1701 (setq our-store (string-trim (buffer-string)))
1702 (push (abbreviate-file-name (file-name-directory our-store))
1703 shares))
1704 (setq our-store (expand-file-name ".hg" our-root)))
1705 (dolist (root (project-known-project-roots))
1706 (when-let* (((not (equal root our-root)))
1707 (sp (expand-file-name ".hg/sharedpath" root))
1708 ((file-exists-p sp)))
1709 (with-temp-buffer
1710 (insert-file-contents-literally sp)
1711 (when (equal our-store (buffer-string))
1712 (push root shares)))))
1713 shares))
1714
1715(defun vc-hg-add-working-tree (directory)
1716 (vc-hg-command nil 0 nil "share"
1717 (vc-hg-root default-directory)
1718 (expand-file-name directory)))
1719
1720(defun vc-hg--shared-p (directory)
1721 (file-exists-p (expand-file-name ".hg/sharedpath" directory)))
1722
1723(defun vc-hg-delete-working-tree (directory)
1724 (if (vc-hg--shared-p directory)
1725 (delete-directory directory t t)
1726 (user-error "\
1727Cannot delete first working tree because this would break other working trees")))
1728
1729(defun vc-hg-move-working-tree (from to)
1730 (if (vc-hg--shared-p from)
1731 (rename-file from (directory-file-name to) 1)
1732 (user-error "\
1733Cannot relocate first working tree because this would break other working trees")))
1734
1684(provide 'vc-hg) 1735(provide 'vc-hg)
1685 1736
1686;;; vc-hg.el ends here 1737;;; vc-hg.el ends here
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index f06736689aa..9fdc7fcf5a9 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -965,7 +965,11 @@ In the latter case, VC mode is deactivated for this buffer."
965 "~" #'vc-revision-other-window 965 "~" #'vc-revision-other-window
966 "R" #'vc-rename-file 966 "R" #'vc-rename-file
967 "x" #'vc-delete-file 967 "x" #'vc-delete-file
968 "!" #'vc-edit-next-command) 968 "!" #'vc-edit-next-command
969 "w c" #'vc-add-working-tree
970 "w w" #'vc-switch-working-tree
971 "w x" #'vc-delete-working-tree
972 "w R" #'vc-move-working-tree)
969(fset 'vc-prefix-map vc-prefix-map) 973(fset 'vc-prefix-map vc-prefix-map)
970(define-key ctl-x-map "v" 'vc-prefix-map) 974(define-key ctl-x-map "v" 'vc-prefix-map)
971 975
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index c4471a55440..6cb03c60919 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -207,6 +207,17 @@
207;; The default implementation deals well with all states that 207;; The default implementation deals well with all states that
208;; `vc-state' can return. 208;; `vc-state' can return.
209;; 209;;
210;; - known-other-working-trees ()
211;;
212;; Return a list of all other working trees known to use the same
213;; backing repository as this working tree. The members of the list
214;; are the abbreviated (with `abbreviate-file-name') absolute file
215;; names of the root directories of the other working trees.
216;; For some VCS, the known working trees will not be all the other
217;; working trees, because other working trees can share the same
218;; backing repository in a way that's transparent to the original
219;; working tree (Mercurial is like this).
220;;
210;; STATE-CHANGING FUNCTIONS 221;; STATE-CHANGING FUNCTIONS
211;; 222;;
212;; * create-repo () 223;; * create-repo ()
@@ -342,6 +353,31 @@
342;; - find-admin-dir (file) 353;; - find-admin-dir (file)
343;; 354;;
344;; Return the administrative directory of FILE. 355;; Return the administrative directory of FILE.
356;;
357;; - add-working-tree (directory)
358;;
359;; Create a new working tree at DIRECTORY that uses the same backing
360;; repository as this working tree.
361;; What gets checked out in DIRECTORY is left to the backend because
362;; while some VCS can check out the same branch in multiple working
363;; trees (e.g. Mercurial), others allow each branch to be checked out
364;; in only one working tree (e.g. Git).
365;; If a new branch should be created then the backend should handle
366;; prompting for this, including prompting for a branch or tag from
367;; which to start/fork the new branch, like `vc-create-branch'.
368;;
369;; - delete-working-tree (directory)
370;;
371;; Remove the working tree, assumed to be one that uses the same
372;; backing repository as this working tree, at DIRECTORY.
373;; This removal should be unconditional with respect to the state of
374;; the working tree: the caller is responsible for checking for
375;; uncommitted work in DIRECTORY.
376;;
377;; - move-working-tree (from to)
378;;
379;; Relocate the working tree, assumed to be one that uses the same
380;; backing repository as this working tree, at FROM to TO.
345 381
346;; HISTORY FUNCTIONS 382;; HISTORY FUNCTIONS
347;; 383;;
@@ -4178,24 +4214,24 @@ to provide the `find-revision' operation instead."
4178 t) 4214 t)
4179 4215
4180(defun vc-default-retrieve-tag (backend dir name update) 4216(defun vc-default-retrieve-tag (backend dir name update)
4181 (if (string= name "") 4217 (if (string-empty-p name)
4182 (progn 4218 (vc-file-tree-walk dir
4183 (vc-file-tree-walk 4219 (lambda (f)
4184 dir 4220 (and (vc-up-to-date-p f)
4185 (lambda (f) (and 4221 (vc-error-occurred
4186 (vc-up-to-date-p f) 4222 (vc-call-backend backend 'checkout f nil "")
4187 (vc-error-occurred 4223 (when update
4188 (vc-call-backend backend 'checkout f nil "") 4224 (vc-resynch-buffer f t t))))))
4189 (when update (vc-resynch-buffer f t t)))))))
4190 (let ((result (vc-tag-precondition dir))) 4225 (let ((result (vc-tag-precondition dir)))
4191 (if (stringp result) 4226 (if (stringp result)
4192 (error "File %s is locked" result) 4227 (error "File %s is locked" result)
4193 (setq update (and (eq result 'visited) update)) 4228 (setq update (and (eq result 'visited) update))
4194 (vc-file-tree-walk 4229 (vc-file-tree-walk dir
4195 dir 4230 (lambda (f)
4196 (lambda (f) (vc-error-occurred 4231 (vc-error-occurred
4197 (vc-call-backend backend 'checkout f nil name) 4232 (vc-call-backend backend 'checkout f nil name)
4198 (when update (vc-resynch-buffer f t t))))))))) 4233 (when update
4234 (vc-resynch-buffer f t t)))))))))
4199 4235
4200(defun vc-default-revert (backend file contents-done) 4236(defun vc-default-revert (backend file contents-done)
4201 (unless contents-done 4237 (unless contents-done
@@ -4301,6 +4337,136 @@ It returns the last revision that changed LINE number in FILE."
4301 (let ((rev (vc-call annotate-extract-revision-at-line file))) 4337 (let ((rev (vc-call annotate-extract-revision-at-line file)))
4302 (if (consp rev) (car rev) rev)))) 4338 (if (consp rev) (car rev) rev))))
4303 4339
4340(defun vc-dir-status-files (directory &optional files backend)
4341 "Synchronously run `dir-status-files' VC backend function for DIRECTORY.
4342FILES is passed to the VC backend function.
4343BACKEND is defaulted by calling `vc-responsible-backend' on DIRECTORY."
4344 ;; The `dir-status-files' API was designed for asynchronous use to
4345 ;; populate *vc-dir* buffers; see `vc-dir-refresh'.
4346 ;; This function provides Lisp programs with synchronous access to the
4347 ;; same information without touching the user's *vc-dir* buffers and
4348 ;; without having to add a new VC backend function.
4349 ;; It is considerably faster than using `vc-file-tree-walk'
4350 ;; (like `vc-tag-precondition' does).
4351 ;; This function is in this file despite its `vc-dir-' prefix to avoid
4352 ;; having to load `vc-dir' just to get access to this simple wrapper.
4353 (let ((morep t) results)
4354 (with-temp-buffer
4355 (setq default-directory directory)
4356 (vc-call-backend (or backend (vc-responsible-backend directory))
4357 'dir-status-files directory files
4358 (lambda (entries &optional more-to-come)
4359 (let (entry)
4360 (while (setq entry (pop entries))
4361 ;; We shouldn't actually get any
4362 ;; `up-to-date' or `ignored' entries back,
4363 ;; but just in case, pass through a filter.
4364 (unless (memq (cadr entry)
4365 '(up-to-date ignored))
4366 (push entry results))))
4367 (setq morep more-to-come)))
4368 (while morep (accept-process-output)))
4369 (nreverse results)))
4370
4371;;;###autoload
4372(defun vc-add-working-tree (backend directory)
4373 "Create working tree DIRECTORY with same backing repository as this tree.
4374See Info node `(emacs)Other Working Trees' regarding VCS repositories
4375with multiple working trees."
4376 (interactive
4377 (list
4378 (vc-responsible-backend default-directory)
4379 (read-directory-name "Location for new working tree: "
4380 (file-name-parent-directory
4381 (or (vc-root-dir)
4382 (error "File is not under version control"))))))
4383 (vc-call-backend backend 'add-working-tree directory)
4384
4385 ;; `vc-switch-working-tree' relies on project.el registration so try
4386 ;; to ensure that both the old and new working trees are registered.
4387 ;; `project-current' should not return nil in either case, but don't
4388 ;; signal an error if it does.
4389 (when-let* ((p (project-current)))
4390 (project-remember-project p))
4391 (when-let* ((p (project-current nil directory)))
4392 (project-remember-project p))
4393
4394 (vc-dir directory backend))
4395
4396(defvar project-current-directory-override)
4397
4398;;;###autoload
4399(defun vc-switch-working-tree (directory)
4400 "Switch to this file's analogue in working tree DIRECTORY.
4401This command switches to the file which has the same path
4402relative to DIRECTORY that this buffer's file has relative
4403to the root of this working tree.
4404DIRECTORY names another working tree with the same backing repository as
4405this tree; see Info node `(emacs)Other Working Trees' for general
4406information regarding VCS repositories with multiple working trees."
4407 ;; FIXME: Switch between directory analogues, too, in Dired buffers.
4408 (interactive
4409 (list
4410 ;; FIXME: This should respect `project-prompter'. See bug#79024.
4411 (completing-read "Other working tree to visit: "
4412 (vc-call-backend (vc-responsible-backend default-directory)
4413 'known-other-working-trees)
4414 nil t)))
4415 (let ((project-current-directory-override directory))
4416 (project-find-matching-file)))
4417
4418;;;###autoload
4419(defun vc-delete-working-tree (backend directory)
4420 "Delete working tree DIRECTORY with same backing repository as this tree.
4421See Info node `(emacs)Other Working Trees' regarding VCS repositories
4422with multiple working trees."
4423 (interactive
4424 (let ((backend (vc-responsible-backend default-directory)))
4425 (list backend
4426 ;; FIXME: This should respect `project-prompter'. See bug#79024.
4427 (completing-read "Delete working tree: "
4428 (vc-call-backend backend 'known-other-working-trees)
4429 nil t))))
4430 ;; We could consider not prompting here, thus always failing when
4431 ;; there is uncommitted work, and requiring the user to review and
4432 ;; revert the uncommitted changes before invoking this command again.
4433 ;; But other working trees are often created as throwaways to quickly
4434 ;; test some changes, so it is more useful to offer to recursively
4435 ;; delete them on the user's behalf.
4436 (when (and (vc-dir-status-files directory nil backend)
4437 (not (yes-or-no-p (format "\
4438%s contains uncommitted work. Continue to recursively delete it?" directory))))
4439 (user-error "Aborted due to uncommitted work in %s" directory))
4440
4441 (project-forget-project directory)
4442 (vc-call-backend backend 'delete-working-tree directory))
4443
4444(autoload 'dired-rename-subdir "dired-aux")
4445;;;###autoload
4446(defun vc-move-working-tree (backend from to)
4447 "Relocate a working tree from FROM to TO.
4448See Info node `(emacs)Other Working Trees' regarding VCS repositories
4449with multiple working trees."
4450 (interactive
4451 (let ((backend (vc-responsible-backend default-directory)))
4452 (list backend
4453 ;; FIXME: This should respect `project-prompter'. See bug#79024.
4454 (completing-read "Relocate working tree: "
4455 (vc-call-backend backend 'known-other-working-trees)
4456 nil t)
4457 (read-directory-name "New location for working tree: "
4458 (file-name-parent-directory (vc-root-dir))))))
4459 (let ((inhibit-message t))
4460 (project-forget-project from))
4461 (vc-call-backend backend 'move-working-tree from to)
4462
4463 ;; Update visited file names for buffers visiting files under FROM.
4464 ;; FIXME: Also update VC-Dir buffers.
4465 (dired-rename-subdir (expand-file-name from) (expand-file-name to))
4466
4467 (when-let* ((p (project-current nil to)))
4468 (project-remember-project p)))
4469
4304 4470
4305 4471
4306;; These things should probably be generally available 4472;; These things should probably be generally available
diff --git a/test/lisp/vc/vc-tests/vc-tests.el b/test/lisp/vc/vc-tests/vc-tests.el
index 82f28cdad3a..9f570ca0dd1 100644
--- a/test/lisp/vc/vc-tests/vc-tests.el
+++ b/test/lisp/vc/vc-tests/vc-tests.el
@@ -44,6 +44,7 @@
44;; - latest-on-branch-p (file) 44;; - latest-on-branch-p (file)
45;; * checkout-model (files) DONE 45;; * checkout-model (files) DONE
46;; - mode-line-string (file) 46;; - mode-line-string (file)
47;; - other-working-trees () DONE
47 48
48;; STATE-CHANGING FUNCTIONS 49;; STATE-CHANGING FUNCTIONS
49;; 50;;
@@ -65,6 +66,9 @@
65;; - modify-change-comment (files rev comment) 66;; - modify-change-comment (files rev comment)
66;; - mark-resolved (files) 67;; - mark-resolved (files)
67;; - find-admin-dir (file) 68;; - find-admin-dir (file)
69;; - add-working-tree (directory) DONE
70;; - delete-working-tree (directory) DONE
71;; - move-working-tree (from to) DONE
68 72
69;; HISTORY FUNCTIONS 73;; HISTORY FUNCTIONS
70;; 74;;
@@ -656,6 +660,103 @@ This checks also `vc-backend' and `vc-responsible-backend'."
656 (ignore-errors 660 (ignore-errors
657 (run-hooks 'vc-test--cleanup-hook)))))) 661 (run-hooks 'vc-test--cleanup-hook))))))
658 662
663(defun vc-test--other-working-trees (backend)
664 "Test other working trees actions."
665 (ert-with-temp-directory tempdir
666 (let ((vc-handled-backends `(,backend))
667 (default-directory
668 (file-name-as-directory
669 (expand-file-name
670 (make-temp-name "vc-test") temporary-file-directory)))
671 (process-environment process-environment)
672 vc-test--cleanup-hook)
673 (unwind-protect
674 (progn
675 ;; Cleanup.
676 (add-hook
677 'vc-test--cleanup-hook
678 (let ((dir default-directory))
679 (lambda ()
680 (delete-directory dir 'recursive)
681 (dolist (name '("first" "second" "first"))
682 (project-forget-project
683 (expand-file-name name default-directory))))))
684
685 (let* ((first (file-name-as-directory
686 (expand-file-name "first" default-directory)))
687 (second (file-name-as-directory
688 (expand-file-name "second" default-directory)))
689 (third (file-name-as-directory
690 (expand-file-name "third" default-directory)))
691 (tmp-name (expand-file-name "foo" first)))
692
693 ;; Set up the first working tree.
694 (make-directory first t)
695 (let ((default-directory first))
696 (vc-test--create-repo-function backend)
697 (write-region "foo" nil tmp-name nil 'nomessage)
698 (vc-register `(,backend (,(file-name-nondirectory tmp-name)))))
699 (with-current-buffer (find-file-noselect tmp-name)
700 (vc-checkin (list (file-name-nondirectory tmp-name)) backend)
701 (insert "Testing other working trees")
702 (let (vc-async-checkin)
703 (log-edit-done))
704
705 ;; Set up the second working tree.
706 ;; For the backends which do additional prompting (as
707 ;; specified in the API for this backend function) we
708 ;; need to stub that out.
709 (cl-ecase backend
710 (Git (cl-letf (((symbol-function 'completing-read)
711 (lambda (&rest _ignore) "")))
712 (vc-add-working-tree backend second)))
713 (Hg (vc-add-working-tree backend second))))
714
715 ;; Test `known-other-working-trees'.
716 (with-current-buffer (find-file-noselect tmp-name)
717 (should
718 (equal (list second)
719 (vc-call-backend backend 'known-other-working-trees)))
720 (let ((default-directory second))
721 (should
722 (equal (list first)
723 (vc-call-backend backend 'known-other-working-trees))))
724
725 ;; Test `move-working-tree'.
726 (vc-move-working-tree backend second third)
727 (should
728 (equal (list third)
729 (vc-call-backend backend 'known-other-working-trees)))
730 (should-not (file-directory-p second))
731 (should (file-directory-p third))
732 ;; Moving the first working tree is only supported
733 ;; for some backends.
734 (cl-ecase backend
735 (Git
736 (let ((default-directory third))
737 (vc-move-working-tree backend first second))
738 (let ((default-directory third))
739 (should
740 (equal (list second)
741 (vc-call-backend backend
742 'known-other-working-trees))))
743 (should-not (file-directory-p first))
744 (should (file-directory-p second))
745 (vc-move-working-tree backend second first))
746 (Hg
747 (let ((default-directory third))
748 (should-error (vc-move-working-tree backend
749 first second)))))
750
751 ;; Test `delete-working-tree'.
752 (let ((default-directory first))
753 (vc-delete-working-tree backend third)
754 (should-not (file-directory-p third))))))
755
756 ;; Save exit.
757 (ignore-errors
758 (run-hooks 'vc-test--cleanup-hook))))))
759
659;; Create the test cases. 760;; Create the test cases.
660 761
661(defun vc-test--rcs-enabled () 762(defun vc-test--rcs-enabled ()
@@ -794,7 +895,23 @@ This checks also `vc-backend' and `vc-responsible-backend'."
794 (eq system-type 'windows-nt) 895 (eq system-type 'windows-nt)
795 noninteractive)) 896 noninteractive))
796 (vc-test--version-diff ',backend)) 897 (vc-test--version-diff ',backend))
797 )))) 898
899 (ert-deftest
900 ,(intern (format "vc-test-%s07-other-working-trees" backend-string)) ()
901 ,(format "Check other working trees functions for the %s backend."
902 backend-string)
903 (skip-unless
904 (ert-test-passed-p
905 (ert-test-most-recent-result
906 (ert-get-test
907 ',(intern
908 (format "vc-test-%s01-register" backend-string))))))
909 (skip-unless (memq ',backend '(Git Hg)))
910 (skip-when
911 (and (eq ',backend 'Hg)
912 (equal (car (process-lines-ignore-status "hg" "share"))
913 "hg: unknown command 'share'")))
914 (vc-test--other-working-trees ',backend))))))
798 915
799(provide 'vc-tests) 916(provide 'vc-tests)
800;;; vc-tests.el ends here 917;;; vc-tests.el ends here