1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-06 22:31:13 -07:00
Commit graph

1969 commits

Author SHA1 Message Date
john muhl
ff05a689e3 (diff--font-lock-prettify): Fix fringe width test
* lisp/vc/diff-mode.el (diff--font-lock-prettify):
Use 'window-fringes' instead of the 'left-fringe' frame parameter
since the former returns an integer on both GUI and TTY frames.
2025-08-16 04:59:49 -04:00
Sean Whitton
fb5e6c6bb7 vc-git-modify-change-comment: Bind c-s-f-w for command arguments too
* lisp/vc/vc-git.el (vc-git-modify-change-comment): Bind
coding-system-for-write to locale-coding-system around the call
to vc-git-command on MS-Windows.  The temporary file name could
contain non-ASCII, e.g. the user's username.
2025-08-14 14:56:07 +01:00
Sean Whitton
ea7aee894d vc-buffer-sync-fileset: Reorder some checks for speed (bug#79137)
* lisp/vc/vc.el (vc-buffer-sync-fileset): Check whether a
buffer's file is in one of our directories before checking
whether it exists on disk.  This should mean far fewer system
calls overall (bug#79137).
2025-08-14 14:50:09 +01:00
Sean Whitton
02f5a075dc vc-hg-checkin-patch: Fix several issues
* lisp/vc/vc-hg.el (vc-hg-checkin-patch): Use
make-nearby-temp-file.  Protect the async process with
vc-wait-for-process-before-save.  Don't call vc-checkin-hook
here, instead return a (async . #<process>) list so that
vc-finish-logentry does it.
2025-08-14 11:54:33 +01:00
Sean Whitton
e48592ef3b * lisp/vc/vc-hg.el (vc-hg-checkin): Pass '-A' to 'hg commit'. 2025-08-12 20:27:09 +01:00
Sean Whitton
c75c95ad58 vc-buffer-sync-fileset: Optimization when NOT-ESSENTIAL is non-nil
* lisp/vc/vc.el (vc-buffer-sync-fileset): When NOT-ESSENTIAL is
non-nil, use string-prefix-p instead of file-in-directory-p
(bug#79137).
2025-08-12 16:01:12 +01:00
Sean Whitton
81aa814e59 vc-do-command: In batch mode, print the output of failed commands
* lisp/vc/vc-dispatcher.el (vc-do-command): In batch mode, when
the command fails, print its output.
2025-08-12 14:34:45 +01:00
Sean Whitton
66eead6fd0 Fix some 'git worktree' compatibility issues
* lisp/vc/vc-git.el (vc-git-delete-working-tree): Reimplement to
avoid requiring 'git worktree remove'.
(vc-git-move-working-tree): Use 'git worktree move' if 'git
worktree repair' is not available.  Give a more informative
error message if we don't even have that.
* test/lisp/vc/vc-tests/vc-tests.el (vc-git--program-version):
Declare.
(vc-test--other-working-trees): Skip vc-move-working-tree tests
with Git old enough to lack 'git worktree move'.
2025-08-10 13:25:41 +01:00
Sean Whitton
11d521e6e4 ; Fix capitalization of VC-Dir. 2025-08-10 12:20:42 +01:00
Sean Whitton
38c5742cba New command vc-working-tree-switch-project (bug#79024)
* lisp/vc/vc.el (vc-working-tree-switch-project): New command.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind it to C-x v w s.
* doc/emacs/vc1-xtra.texi (Other Working Trees):
* etc/NEWS: Document it.
2025-08-10 12:20:42 +01:00
Sean Whitton
e79f38b662 New project-find-matching-buffer-function for VC-Dir
* lisp/vc/vc-dir.el (vc-dir-find-matching-buffer): New function.
(vc-dir-mode): Use it as project-find-matching-buffer-function.
2025-08-10 12:20:42 +01:00
Eli Zaretskii
d76fe5f31f Merge from origin/emacs-30
f2d3659cf5 Handle remote file names in cmuscheme.el
d1ab95b175 * lisp/vc/vc.el (vc-register): Fix interactive spec (bug#...
f58b738042 ; windows installer: set x64 registry keys (tiny change)
2025-08-09 09:33:20 -04:00
Michael Albinus
1fc4bb1fea Rename variables *-in-progress-p to *-in-progress
* doc/lispref/backups.texi (Reverting): Fix variable names
revert-buffer-in-progress and auto-revert-buffer-in-progress.

* etc/NEWS: Fix variable names revert-buffer-in-progress and
auto-revert-buffer-in-progress.
Presentational fixes and improvements.

* lisp/autorevert.el (auto-revert-buffer-in-progress): Rename.
(auto-revert-handler, auto-revert-buffer): Use renamed variables.

* lisp/dired-x.el (dired-omit-expunge):
Use `auto-revert-buffer-in-progress'.

* lisp/files.el (revert-buffer-in-progress): Rename.
(revert-buffer-in-progress-p): Declare obsolete.
(after-find-file, revert-buffer):
* lisp/saveplace.el (save-place-find-file-hook)
(save-place-dired-hook):
* lisp/vc/vc-git.el (vc-git-command, vc-git--out-ok):
* lisp/vc/vc.el (vc-diff-internal):
Use `revert-buffer-in-progress'.

* lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Suppress warning.
2025-08-09 14:21:23 +02:00
Sean Whitton
6ffa926f90 vc-move-working-tree: Improve updating VC-Dir buffers
* lisp/vc/vc.el (vc-move-working-tree): Check entries in
vc-dir-buffers for liveness.  Don't hardcode "*vc-dir*"; instead
call uniquify-buffer-base-name.  Call uniquify-rename-buffer,
not rename-buffer, so that the buffer is not marked unmanaged.
2025-08-09 11:15:31 +01:00
Sean Whitton
4dd67e5d73 VC: Do move new working trees to the beginning of the project list
* lisp/vc/vc.el (vc-add-working-tree, vc-move-working-tree):
Have project-remember-project move the new working trees to the
front of the list of projects.  Suggested by Dmitry Gutov
<dmitry@gutov.dev>.
2025-08-09 10:39:19 +01:00
Sean Whitton
12354bcfdc VC other working trees: avoid reordering project--list
* lisp/progmodes/project.el (project--remember-dir)
(project-remember-project): New STABLE argument.
* lisp/vc/vc.el (vc-add-working-tree)
(vc--prompt-other-working-tree, vc-move-working-tree): Use it.
2025-08-08 13:30:41 +01:00
Sean Whitton
560aee2fb2 vc-move-working-tree: Also update VC-Dir buffers
* lisp/vc/vc.el (vc-move-working-tree): Also update VC-Dir
buffers to follow the working tree move.
2025-08-08 11:47:00 +01:00
Sean Whitton
74cbe6d740 vc-buffer-sync-fileset: Bind 'non-essential' (bug#79137)
* lisp/vc/vc.el (vc-buffer-sync-fileset):
Bind 'non-essential' (bug#79137).
2025-08-08 11:20:33 +01:00
Sean Whitton
c501ed7dc1 Generalize finding project matching files to other major modes
* lisp/progmodes/project.el
(project-find-matching-buffer-function): New variable.
(project-find-matching-file): Delete.
(dired-current-directory): Declare.
(project-find-matching-file-or-directory): New function.  Like
the old 'project-find-matching-file', but also handle Dired
buffers (bug#79126).  When matching file/directory does not
exist, try going up in the directory tree until we find
something that does.
(project-find-matching-buffer): New command.
* lisp/vc/vc.el (vc-switch-working-tree): Use it (bug#79126).
* etc/NEWS: Announce new command and new variable.
2025-08-08 11:17:53 +01:00
Sean Whitton
d950ca8ccd * lisp/vc/vc-hg.el (vc-hg-print-log): Revise log-outgoing revset. 2025-08-06 16:06:13 +01:00
Sean Whitton
d1ab95b175 * lisp/vc/vc.el (vc-register): Fix interactive spec (bug#79183). 2025-08-06 15:15:57 +01:00
Dmitry Gutov
65c110b913 vc-annotate-warp-revision: Fix going through renames
* lisp/vc/vc-annotate.el (vc-annotate--file-name-change):
New function (bug#26345).
(vc-annotate-warp-revision): Use it here.

Co-Authored-By: Jakub Ječmínek <kuba@kubajecminek.cz>
2025-08-05 04:07:40 +03:00
Sean Whitton
e01b9bd69a ; * lisp/vc/vc.el (vc--prompt-other-working-tree): Reorder.
In fact, calling project-current or project-remember-project
will ensure that project-prompter is loaded.  But let's not rely
on that.
2025-08-04 21:08:49 +01:00
Sean Whitton
0df9731ec9 vc--prompt-other-working-tree: Remember all the working trees
* lisp/vc/vc.el (vc--prompt-other-working-tree): Call
'project-remember-project' on all the known working trees.
2025-08-04 21:07:14 +01:00
Sean Whitton
9e48d1f49a project-prompter: New PREDICATE and REQUIRE-KNOWN arguments
* lisp/progmodes/project.el (project-prompter)
(project-prompt-project-dir, project-prompt-project-name): New
PREDICATE and REQUIRE-KNOWN optional arguments.
* lisp/vc/vc.el (project-prompter): Declare.
(vc--prompt-other-working-tree): New function.
(vc-switch-working-tree, vc-delete-working-tree)
(vc-move-working-tree): Use it to prompt for the other working
tree in a way that respects 'project-prompter' (bug#79024).
* etc/NEWS: Announce all three optional arguments.  Rework
description of new optional argument to 'project-current'.
2025-08-04 20:59:02 +01:00
Mattias Engdegård
1811cb294e Fix vc-git worktrees and vc-tests for directories with symlinks
* lisp/vc/vc-git.el (vc-git-known-other-working-trees):
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--other-working-trees):
Tolerate directories with symlinks in them, such as the standard
temporary dirs on MacOS.  'git worktree list' outputs expanded names.
2025-08-04 10:55:25 +01:00
Mattias Engdegård
f9e0c06875 * lisp/vc/vc-git.el (vc-git--worktrees): Don't pass -z to older Git.
The -z option for 'git worktree list --porcelain' appeared in 2.36.
2025-08-04 10:54:34 +01:00
Sean Whitton
9f28f12ad5 vc-git-modify-change-comment: Error out for merge commits
* lisp/vc/vc-git.el (vc-git-modify-change-comment): Don't try to
modify merge commit comments.
2025-07-27 20:05:08 +01:00
Sean Whitton
e104c06e6a ; * lisp/vc/vc.el (vc-switch-working-tree): Improve docstring. 2025-07-27 08:46:22 +01:00
Sean Whitton
8897c15251 vc-do-command: Fix last part of 'full-command'
* lisp/vc/vc-dispatcher.el (vc-do-command): Don't append " ." to
'full-command' when FILES is nil because the command we actually
run doesn't have "." as a final argument in that case.
2025-07-26 13:25:27 +01:00
Sean Whitton
fcdf2061ea ; VC: Improve documentation of other working trees features. 2025-07-26 13:06:51 +01:00
Sean Whitton
88337345f5 * lisp/vc/vc.el (vc-dir-status-files): Fix filtering on VC status. 2025-07-26 13:05:44 +01:00
Sean Whitton
50ffb29d0b 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.
2025-07-25 19:34:04 +01:00
Sean Whitton
09e205fe60 Bind vc-rename-file to C-x v R
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind vc-rename-file to
C-x v R.
* doc/emacs/files.texi (Copying and Naming):
* doc/emacs/vc1-xtra.texi (VC Delete/Rename, Revision Tags):
* etc/NEWS (bindings): Document the new binding.
2025-07-25 18:45:59 +01:00
Sean Whitton
d381a7e799 * lisp/vc/vc-git.el (vc-git-diff): Don't pass --textconv.
This reverts this change:

    Author:     Sean Whitton <spwhitton@spwhitton.name>
    AuthorDate: Mon Jul 21 09:26:59 2025 +0100

      * lisp/vc/vc-git.el (vc-git-diff): Pass --textconv (bug#79050).
2025-07-22 11:34:44 +01:00
Sean Whitton
0a0ff03839 ; * lisp/vc/vc-cvs.el (vc-cvs-file-to-string): Simplify slightly. 2025-07-21 11:04:34 +01:00
Sean Whitton
90fc061fd2 * lisp/vc/vc-git.el (vc-git-diff): Pass --textconv (bug#79050). 2025-07-21 09:26:59 +01:00
Stefan Monnier
e35e18ac18 lisp/vc: Try and avoid quoting lambdas
* lisp/vc/pcvs.el (cvs-menu, cvs-minor-mode-map):
* lisp/vc/vc-hg.el (vc-hg--extract-headers):
* lisp/vc/vc-git.el (vc-git-show-stash): Don't quote lambdas.
2025-07-19 14:42:28 -04:00
Sean Whitton
c56c56b3c6 Include shorter bindings in diff-mode docstring
* lisp/vc/diff-mode.el (diff-read-only-map): New keymap,
factored out of code modifying minor-mode-map-alist.
(diff-mode): Include bindings from diff-read-only-map in
docstring (bug#34080).
2025-07-19 11:17:25 +01:00
Sean Whitton
0ac1fe8d73 VC: Tighten up switching branches
* lisp/vc/vc.el: Require backend 'create-tag' functions to
prompt for the starting point of the branch.
(vc-retrieve-tag, vc-switch-branch): Accept empty NAME only when
not switching branches: it doesn't make sense to switch to the
current branch.  Plain 'C-x v r' can still be used to check out
the latest revisions on the current branch.
2025-07-18 14:53:43 +01:00
Sean Whitton
94b2a0b2fc Merge from origin/emacs-30
24db9b7962 ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'.
756e7e5243 ; * lisp/window.el (window-state-put): Fix a typo (bug#79...
0fb20adf8e ; define-globalized-minor-mode: Fix info node link in doc...
2025-07-16 11:18:41 +01:00
Sean Whitton
24db9b7962 ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'. 2025-07-16 11:17:58 +01:00
Sean Whitton
48b3363ac4 ; vc-revert-buffer-internal: Capitalization fix. 2025-07-16 11:00:46 +01:00
Sean Whitton
aec5c5f037 vc-git-diff: Fix case where REV1 & REV2 are nil and no commits yet
* lisp/vc/vc-git.el (vc-git--empty-tree): New constant.
(vc-git-diff): When REV1 and REV2 are both nil and there are no
commits yet, diff against the empty tree object (bug#78987).
2025-07-16 09:55:54 +01:00
Sean Whitton
e4ea991ed9 vc-resynch-window: Check whether auto-revert-mode is bound
* lisp/vc/vc-dispatcher.el (auto-revert-mode): Delete
declaration.
(vc-resynch-window): Check whether auto-revert-mode is bound.
2025-07-15 10:18:52 +01:00
Sean Whitton
9d750c7e80 New global minor mode vc-auto-revert-mode
* lisp/vc/vc-hooks.el (auto-revert-mode): Declare.
(vc-auto-revert-mode): New global minor mode.
(vc-turn-on-auto-revert-mode-for-tracked-files): New function.
* lisp/vc/vc-dispatcher.el (auto-revert-mode)
(auto-revert-buffers): Declare.
(vc-resynch-window): Don't call vc-revert-buffer-internal when
auto-revert-mode will revert the buffer.  Call
auto-revert-buffers to ensure that this reversion happens in a
timely manner.
* lisp/vc/vc.el (vc-register): Apply vc-auto-revert-mode to
buffers visiting newly registered files.
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Improve the generated docstring.
* doc/emacs/vc1-xtra.texi (VC Auto-Reverting):
* etc/NEWS: Document the new minor mode.
2025-07-13 12:51:04 +01:00
Sean Whitton
24bd93b35b vc-register: Fix setting backup-inhibited
* lisp/vc/vc.el (vc-register): Delete unreachable code trying to
use 'buffer-file-name' as one of the file names.  Properly set
'backup-inhibited' in any file-visiting buffers.
2025-07-13 12:51:04 +01:00
Sean Whitton
423c6a4dc0 ; Delete unnecessary global autoload from last change. 2025-07-12 14:07:58 +01:00
Stephen Berman
b406c44c82 dired-vc-deduce-fileset: Call vc-backend-for-registration
* lisp/vc/vc.el (vc-backend-for-registration):
* lisp/dired-aux.el (vc-backend-for-registration): Autoload.
(dired-vc-deduce-fileset): Call vc-backend-for-registration when
vc-responsible-backend returns nil (bug#78987).
2025-07-12 11:34:31 +01:00
Sean Whitton
8ff6e7fe58 ; vc-git-find-revision: Fix last change to this function. 2025-07-11 11:08:10 +01:00