1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-14 01:50:22 -08:00
Commit graph

2050 commits

Author SHA1 Message Date
Sean Whitton
4faebea822 vc-git-registered: Be quieter when Git is not installed
* lisp/vc/vc-git.el (vc-git-registered): If Git is not
installed, don't echo a message about it.
2025-10-19 16:41:11 +01:00
Sean Whitton
b0012cb8e1 vc-rename-file: Make it work regardless of default-directory
* lisp/vc/vc.el (vc-rename-file): Make it work regardless of
default-directory; now the only influence of default-directory
should be resolving OLD and NEW if they are relative file names.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file): Test
the influence of default-directory on vc-rename-file.
2025-10-19 15:39:22 +01:00
Sean Whitton
0b4079ddb6 vc-do-command: Don't print a spurious newline
* lisp/vc/vc-dispatcher.el (vc-do-command): Don't print a
spurious newline.  Don't omit the format string with 'message'.
(Bug#79650)
2025-10-18 17:30:21 +01:00
Eli Zaretskii
521e06d3ef Merge from origin/emacs-30
53aac6aecd ; Improve documentation of commands that split current wi...
2025-10-18 06:15:46 -04:00
Eli Zaretskii
53aac6aecd ; Improve documentation of commands that split current window
* doc/emacs/sending.texi (Sending Mail):
* doc/emacs/dired.texi (Dired Enter, Dired Visiting):
* doc/emacs/maintaining.texi (Old Revisions)
(Change Log Commands, Looking Up Identifiers):
* doc/emacs/windows.texi (Displaying Buffers):
* doc/emacs/files.texi (Visiting): Add cross-references to where
user options are described which control how windows are split.

* lisp/mail/sendmail.el (mail-other-window):
* lisp/gnus/message.el (message-mail-other-window)
(message-news-other-window):
* lisp/replace.el (occur-mode-goto-occurrence-other-window):
* lisp/vc/vc.el (vc-revision-other-window):
* lisp/vc/vc-dir.el (vc-dir-find-file-other-window):
* lisp/progmodes/xref.el (xref-find-definitions-other-window):
* lisp/simple.el (compose-mail-other-window)
(clone-indirect-buffer-other-window):
* lisp/vc/add-log.el (add-change-log-entry-other-window):
* lisp/view.el (view-file-other-window)
(view-buffer-other-window):
* lisp/window.el (switch-to-buffer-other-window):
* lisp/files.el (find-file-other-window)
(find-file-read-only-other-window)
(find-alternate-file-other-window):
* lisp/dired.el (dired-other-window)
(dired-mouse-find-file-other-window)
(dired-find-file-other-window, dired-jump-other-window): Mention
in the doc strings how to control the way the current window is
split.
2025-10-18 10:47:29 +03:00
Sean Whitton
ba8752cae9 Replace recent fix for vc-auto-revert-mode autoload problem
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Wrap references to MODE-variable in bound-and-true-p.
* lisp/vc/vc-hooks.el (auto-revert-mode): Restore to compilation
declaration only.
2025-10-17 15:06:11 +01:00
Juri Linkov
b0078bfa15 Improve color contrast of refine-related diff faces on dark backgrounds
* lisp/vc/diff-mode.el (diff-refine-removed, diff-refine-added):
* lisp/vc/ediff-init.el (ediff-fine-diff-A, ediff-fine-diff-B):
* lisp/vc/smerge-mode.el (smerge-refined-removed, smerge-refined-added):
Lower the dominant component of RGB colors from "aa" to "88" (bug#79633).
2025-10-16 20:05:41 +03:00
Sean Whitton
208241aa83 Update VC-Dir contents upon revert-buffer
* lisp/vc/vc-hooks.el (vc-after-revert): New function.
(after-revert-hook): Add it.
2025-10-16 17:19:43 +01:00
Sean Whitton
d0d6e5ce65 vc-auto-revert-mode: Fix an autoload problem
* lisp/vc/vc-hooks.el (auto-revert-mode): Replace compiler
declaration for this variable with a full defvar-local.
2025-10-16 16:56:47 +01:00
Sean Whitton
aae6a9a740 ; * lisp/vc/vc-dir.el (vc-dir-resynch-file): Use cl-nset-difference. 2025-10-13 16:38:49 +01:00
Sean Whitton
78416e8bed * lisp/vc/vc-dir.el (vc-dir-resynch-file): Use file-in-directory-p.
For better compatibility with MS-Windows.
2025-10-13 16:38:14 +01:00
Sean Whitton
fb58ccfdc4 vc-dir-resynch-file: Be more defensive about default-directory
* lisp/vc/vc-dir.el (vc-dir-resynch-file): Use both
expand-file-name and buffer-local-toplevel-value on
default-directory before using the value.
2025-10-08 12:38:37 +01:00
Sean Whitton
7f925b06ac defvar-keymap: New ':prefix t' abbreviation
* lisp/keymap.el (defvar-keymap): New ':prefix t' abbreviation.
* lisp/emacs-lisp/helper.el (Helper-help-map):
* lisp/vc/pcvs.el (cvs-mode-diff-map):
* lisp/vc/vc-hooks.el (vc-prefix-map):
* lisp/vcursor.el (vcursor-map): Use it.
* doc/lispref/keymaps.texi (Creating Keymaps):
* etc/NEWS: Document it.
2025-10-06 18:34:18 +01:00
Sean Whitton
d3c4679acd VC: Use symbolic names for the working revision
* lisp/vc/vc-hg.el (vc-hg-diff): When OLDVERS is ".", behave the
same as if OLDVERS was the actual working revision.
(vc-hg-previous-revision): Return ".~1" for input ".", ".~3" for
input ".^^" et cetera.
Also, when passed non-symbolic revisions, use "REV~1" instead of
"REV^" for MS-Windows compatibility.
(vc-hg-working-revision-symbol):
* lisp/vc/vc-git.el (vc-git-working-revision-symbol):
* lisp/vc/vc-hooks.el (vc-symbolic-working-revision): New
functions.
(vc-default-mode-line-string):
* lisp/vc/ediff-vers.el (ediff-vc-merge-internal):
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch):
* lisp/vc/vc.el (vc-diff-build-argument-list-internal)
(vc-diff-outgoing, vc-revision-other-window, vc-default-revert):
Call vc-symbolic-working-revision.
(vc-buffer-revision): Specify that this should always be a
revision number/hash, not a symbolic name.
* lisp/vc/vc-git.el (vc-git-previous-revision): Return "HEAD~1"
for input "HEAD", "HEAD~3" for input "HEAD^^" et cetera.
2025-10-05 15:27:07 +01:00
Sean Whitton
9ccef794a8 VC: New commands for cherry-picking (bug#79408)
* lisp/vc/diff-mode.el (diff-buffer-file-names): New function.
* lisp/vc/log-view.el (vc--pick-or-revert)
(vc--prompt-other-working-tree): Autoload.
(vc-parent-buffer-name, vc-log-short-style)
(vc-print-log-internal): Declare.
(log-view--pick-or-revert): New function.
(log-view-revision-cherry-pick, log-view-revision-revert): New
commands.
(log-view-mode-map, log-view-mode-menu): Bind them.
* lisp/vc/vc-dispatcher.el (vc-start-logentry): If
get-file-buffer returns nil, use the current buffer as the
parent buffer.
* lisp/vc/vc.el (diff-buffer-file-names, diff-reverse-direction):
Declare.
(vc--pick-or-revert): New function.
(vc-revision-cherry-pick, vc-revision-revert): New commands.
* lisp/vc/vc-hooks.el (vc-menu-map): Bind them.
* doc/emacs/maintaining.texi (VC Change Log, VC Undo)
(Copying Between Branches):
* etc/NEWS: Document the new commands.
2025-10-04 18:18:48 +01:00
Eli Zaretskii
5ee1e205e1 ; Improve the documentation of the last commit
* lisp/vc/log-view.el (log-view-copy-revision-as-kill):
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Improve wording of last commit.  (Bug#79493)
2025-10-04 17:18:12 +03:00
Sean Whitton
d0c63b8427 Improve log-view-copy-revision-as-kill
* lisp/vc/log-view.el (log-view-copy-revision-as-kill): Signal
user-error if there is no revision at point.
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Shorten docs for the new command.
2025-10-04 14:41:16 +01:00
Timo Myyrä
2ce33b66c5 New command log-view-copy-revision-as-kill
* lisp/vc/log-view.el (log-view-copy-revision-as-kill): New
command.
(log-view-mode-map): Bind it.
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Document it.
2025-10-04 14:40:03 +01:00
Sean Whitton
9deff2926b New command log-view-unmark-all-entries
* lisp/vc/log-view.el (log-view-unmark-all-entries): New
command.
(log-view-mode-map): Bind it.
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Document it.
2025-10-03 20:54:25 +01:00
Sean Whitton
0134d4c4fd vc--prompt-other-working-tree: Better handle no other working trees
* lisp/vc/vc.el (vc--prompt-other-working-tree): If there are no
other working trees but ALLOW-EMPTY is non-nil, it is not an
error.
2025-10-03 15:32:44 +01:00
Sean Whitton
72f3f48d36 Log View marking: Fix lambda lists
* lisp/vc/log-view.el (log-view-mark-entry)
(log-view-unmark-entry): Mark ARG as a required argument, as it
in fact is.
(log-view-toggle-mark-entry): Call them properly.
2025-10-02 21:18:51 +01:00
Sean Whitton
b38e54b667 ; * lisp/vc/vc.el (vc-print-root-log): Use plusp. 2025-10-02 20:20:14 +01:00
Sean Whitton
b5cf0786a2 New command vc-kill-other-working-tree-buffers
* lisp/vc/vc.el (vc-kill-other-working-tree-buffers): New
command.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind it.
* doc/emacs/vc1-xtra.texi (Other Working Trees):
* etc/NEWS: Document it.
2025-10-01 20:51:57 +01:00
Sean Whitton
c24e173c9c vc-add-working-tree: Finish by starting Dired
There won't be any uncommitted changes in the new working tree
yet, so vc-dir is unlikely to be useful.

* lisp/vc/vc.el (vc-add-working-tree): Finish by calling 'dired'
not 'vc-dir'.
* test/lisp/vc/vc-tests/vc-tests.el
(vc-test--other-working-trees): Delete stubbing out 'vc-dir'.
2025-10-01 11:26:18 +01:00
Sean Whitton
6ef6b517aa VC: Allow deleting or moving current working tree
* lisp/progmodes/project.el (project-prompter)
(project-prompt-project-dir, project-prompt-project-name):
* lisp/vc/vc.el (vc--prompt-other-working-tree): New ALLOW-EMPTY
optional argument.
(delete-working-tree, move-working-tree): Specify that callers
must ensure DIRECTORY is not the current working tree.
(vc-delete-working-tree, vc-move-working-tree): Pass ALLOW-EMPTY
non-nil to vc--prompt-other-working-tree.  Bind
'default-directory' to another working tree when operating on
the current working tree.
(vc-delete-working-tree): Extra prompt when asked to delete the
current working tree.  When deleting the current working tree,
call 'bury-buffer' one or more times at the end.
2025-09-30 16:12:14 +01:00
Sean Whitton
4e7cb37b84 VC prepare-patch: New :patch-start & :patch-end plist entries
* lisp/vc/vc.el (prepare-patch): Specify :patch-start and
:patch-end plist entries.
* lisp/vc/vc-git.el (vc-git-prepare-patch): Use -n1 to avoid
passing a revision range to git-format-patch, which is a bit
simpler.  Catch search-failed errors and signal an error with a
more helpful message.  Properly handle Subject: header by
looking for continuation lines.  Return :patch-start and
:patch-end entries in the plist.
* lisp/vc/vc-hg.el (vc-hg-prepare-patch): Always pass --git to
'hg export' for consistency.  Catch search-failed errors and
signal an error with a more helpful message.  Return a
:patch-start entry in the plist.
2025-09-27 21:36:51 +01:00
Sean Whitton
6eaa1d279b ; * lisp/vc/vc-git.el (vc-git-cherry-pick-comment): Fix logic. 2025-09-26 17:25:07 +01:00
Sean Whitton
9a86a093bc vc-git--checkin: Ignore 'git apply --3way' exiting 1
This is expected to happen in some cases.

* lisp/vc/vc-git.el (vc-git--with-apply-temp): New OKSTATUS
parameter.
(vc-git--checkin): Use it to ignore 'git apply --3way' exiting
1.
2025-09-25 18:19:38 +01:00
Sean Whitton
b2e35d1d2c vc-git--checkin: Avoid passing --ours to git-apply
* lisp/vc/vc-git.el (vc-git--with-apply-temp): New BUFFER param.
(vc-git--checkin): Avoid passing --ours to git-apply.
2025-09-25 17:44:30 +01:00
Sean Whitton
19426ea56c VC: New cherry-pick-comment API function
* lisp/vc/vc-git.el (vc-git-cherry-pick-comment):
* lisp/vc/vc-hg.el (vc-hg-cherry-pick-comment):
* lisp/vc/vc.el (vc-default-cherry-pick-comment):
New functions (bug#79408).
2025-09-24 17:24:41 +01:00
Sean Whitton
8368fcb38c vc-git--checkin: Apply PATCH-STRING to working tree
* lisp/vc/vc-git.el
(vc-git--with-apply-temp-to-staging): Rename ...
(vc-git--with-apply-temp): ... to this.  New ARGS parameter.
All uses changes.
(vc-git--checkin): In POST function, apply PATCH-STRING to the
working tree with 'git apply --3way --ours'.
* lisp/vc/vc-hg.el (vc-hg--checkin): Document what the call to
'hg update' is for.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch):
Delete completed FIXME and workaround.
2025-09-24 16:07:51 +01:00
Sean Whitton
190450f4f0 vc-git--checkin: Restore dropping stash of staged changes
* lisp/vc/vc-git.el (vc-git--checkin): Restore dropping stash of
staged changes after applying it.  This was accidentally lost
when factoring out vc-git--with-apply-temp-to-staging.
2025-09-24 15:00:42 +01:00
Sean Whitton
192a0e1773 ; * lisp/vc/vc-git.el (vc-git--checkin): Fix error message. 2025-09-22 17:21:38 +01:00
Andrea Corallo
ec4066d532 Revert "* Clean-up some compilation warnings in vc-hooks.el"
This reverts commit dd622e06e7 as
functions are autoloaded.
2025-09-22 10:28:40 +02:00
Sean Whitton
8310795bab VC checkin-patch: Support extracting commit metadata from patches
* lisp/vc/vc-git.el (vc-git--mailinfo): New function.
(vc-git-checkin-patch): Use it to extract authorship, date and
log message information from patches.
(vc-git--call): New INFILE argument.  All uses changed.
* lisp/vc/vc-hg.el (vc-hg--checkin): When COMMENT is nil, take
authorship, date and log message information from the patch.
* lisp/vc/vc.el (checkin-patch): Specify to use authorship, date
and comment information in PATCH-STRING (bug#79408).
(prepare-patch): Specify that patch should include authorship
identity, date and log message information for REV if supported.
(diff-bounds-of-hunk): Declare.
(vc-default-checkin-patch): Warn if it looks like we will ignore
patch authorship information.
* test/lisp/vc/vc-tests/vc-tests.el (vc-hg-command)
(vc-git--out-str): Declare.
(vc-test--checkin-patch): New function.
(vc-test-git08-checkin-patch, vc-test-hg08-checkin-patch): New
tests.
2025-09-21 21:59:02 +01:00
Sean Whitton
0109b4a758 * lisp/vc/vc-git.el (vc-git--checkin): Validate parameters. 2025-09-21 21:44:28 +01:00
Andrea Corallo
dd622e06e7 * Clean-up some compilation warnings in vc-hooks.el
* lisp/vc/vc-hooks.el(vc-diff-outgoing-base)
(vc-root-diff-outgoing-base, vc-apply-to-other-working-tree)
(vc-apply-root-to-other-working-tree): Declare.
2025-09-18 14:48:59 +02:00
Sean Whitton
d3a2541798 Refactor vc-git checkin functions
* lisp/vc/vc-git.el (vc-git-patch-string): Delete.  All uses
changed.
(vc-git--checkin): Rename vc-git-checkin to this.
(vc-git-checkin-patch, vc-git-checkin): New wrapper functions.
2025-09-18 12:48:32 +01:00
Sean Whitton
0b4fe2628c vc--prompt-other-working-tree: Fail when no other working trees
* lisp/vc/vc.el (vc--prompt-other-working-tree): When there are
no other working trees, signal an error.
2025-09-18 12:33:56 +01:00
Eli Zaretskii
e568f44b54 ; Improve recently-added documentation
* etc/NEWS:
* lisp/vc/vc.el (vc-apply-root-to-other-working-tree):
* doc/emacs/vc1-xtra.texi (Other Working Trees): Fix spelling and
wording of documentation of recent changes to VC.
2025-09-16 19:24:18 +03:00
Sean Whitton
208e80018a New commands to apply changes to other working trees
* lisp/vc/diff-mode.el (diff-apply-buffer): New TEST argument.
* lisp/vc/vc.el (diff-apply-buffer): Declare.
(vc-no-confirm-moving-changes): New user option.
(vc-apply-to-other-working-tree)
(vc-apply-root-to-other-working-tree): New commands.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind them.
* doc/emacs/vc1-xtra.texi (Other Working Trees):
* etc/NEWS: Document them.
2025-09-16 14:30:02 +01:00
Eli Zaretskii
125b3588c9 Merge from origin/emacs-30
4745456677 ; * lisp/dired-x.el (dired-find-subdir): Doc fix (bug#794...
0832e5fec5 ; * lisp/vc/vc.el (vc-print-root-log): Improve docstring ...
2fafcdbf6a ; Minor copyedits in src/editfns.c
2025-09-13 07:23:12 -04:00
James Thomas
0832e5fec5 ; * lisp/vc/vc.el (vc-print-root-log): Improve docstring (bug#79439). 2025-09-13 13:37:13 +03:00
Sean Whitton
4418a37c5d ; log-edit.el: Insert missing required cl-lib. 2025-09-12 15:41:38 +01:00
Sean Whitton
2ee74aca55 Delete obsolete log-edit-beginning-of-line
* lisp/vc/log-edit.el (message): No longer require.
(log-edit-beginning-of-line): Delete.  No longer required now
that Log Edit buffers use fields for headers.  (In combination
with the new fields, this binding led to C-a behaving strangely
for summaries with colons in them.)
(log-edit-mode-map): Unbind it.
2025-09-12 15:40:35 +01:00
Sean Whitton
85b991a62d ; vc-git--log-edit-summary-check: Use and-let*. 2025-09-12 15:32:19 +01:00
Sean Whitton
2817720083 ; vc-prepare-patch: Minor code improvements
* lisp/vc/vc.el (vc-prepare-patch): Use ngettext.  Avoid using
dolist's RESULT for side-effect.
2025-09-12 15:31:56 +01:00
Sean Whitton
1372061200 ; vc-diff-outgoing: Fix calling 'working-revision' backend function. 2025-09-12 15:26:44 +01:00
Sean Whitton
a2d4034242 ; * lisp/vc/vc-hg.el (vc-hg-diff): Pass `Hg' to vc-working-revision. 2025-09-09 14:48:27 +01:00
Sean Whitton
ab83e15d8c ; * lisp/vc/vc-hg.el (vc-hg-diff): Tweak 'and' forms. 2025-09-09 14:46:09 +01:00