aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc/diff-mode.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; diff--revert-kill-hunks: Hoist binding inhibit-read-only.Sean Whitton2026-02-051-1/+1
|
* Bind "u", "@" in diff-mode-read-only-map, not diff-mode-shared-mapSean Whitton2026-02-051-10/+13
| | | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map): Move bindings for "u" and "@" from here ... (diff-mode-read-only-map): ... to here.
* Bind "s" in diff-mode-read-only-map, not diff-mode-shared-mapSean Whitton2026-02-051-6/+8
| | | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map): Move binding for "s" from here ... (diff-mode-read-only-map): ... to here (bug#80330).
* diff-mode-shared-map: Bind '@' to diff-revert-and-kill-hunkSean Whitton2026-02-021-2/+3
| | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map): Bind '@' to diff-revert-and-kill-hunk.
* Make diff-hunk-kill respect an active regionSean Whitton2026-01-301-46/+91
| | | | | | | | | | * lisp/vc/diff-mode.el (diff--revert-kill-hunks): New workhorse routine. (diff-hunk-kill, diff-revert-and-kill-hunk): Call it. (diff-hunk-kill): New BEG and END parameters and interactive form. * doc/emacs/files.texi (Diff Mode): * etc/NEWS: Document the change.
* Bind 's' to diff-split-hunk in read-only diff-modeSean Whitton2026-01-301-0/+1
| | | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map): Bind 's' to 'diff-split-hunk'. * etc/NEWS: Document the change.
* ; Fix/improve two comments.Sean Whitton2026-01-291-1/+1
|
* Disable diff-restrict-view by defaultSean Whitton2026-01-171-0/+1
| | | | | * lisp/vc/diff-mode.el (diff-restrict-view): Disable it. * etc/NEWS: Announce the change.
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* * lisp/vc/diff-mode.el (diff-undo): New obsolete function alias.Sean Whitton2026-01-011-0/+2
|
* Factor out undo-ignore-read-only (bug#80049)Sean Whitton2025-12-311-7/+1
| | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-undo): Rename to undo-ignore-read-only. (diff-mode-shared-map): Update "<remap> <undo>" binding. * lisp/simple.el (undo-ignore-read-only): Rename from diff-undo. * lisp/dired.el (dired-undo): * lisp/proced.el (proced-undo): Call it. New numeric prefix argument to specify a repeat count. * doc/emacs/dired.texi (Marks vs Flags): * etc/NEWS: Document the change.
* Split diff-mode-shared-map into two mapsSean Whitton2025-12-311-15/+22
| | | | | | | | | | | This is easier to understand and easier to customize. * lisp/vc/diff-mode.el (diff-mode-shared-map): Move bindings for "W", "w", "A", "r" and "R" from here ... (diff-mode-read-only-map): ... to here, a new map. (diff-mode-map): Bind diff-mode-shared-map to "ESC". (diff-read-only-map): Make a composed map from diff-mode-read-only-map instead of diff-mode-shared-map.
* track-changes.el (track-changes-undo-only): New varStefan Monnier2025-12-281-1/+2
| | | | | | | | | | | | | * lisp/emacs-lisp/track-changes.el (track-changes-undo-only): New var. (track-changes-fetch): Bind it. (track-changes--state): New slot `undo`. (track-changes--after): Set it. * lisp/vc/diff-mode.el (diff--track-changes-function): Use the new var. * doc/lispref/text.texi (Tracking changes): Mention `track-changes-undo-only`.
* December 2025 spelling fixesPaul Eggert2025-12-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the fixes are to continue to use American rather than British spelling. * doc/misc/modus-themes.org (my-modus-themes-engraved-faces): Fix misspelled ‘:foreground’s. * etc/themes/modus-themes.el (modus-themes-faces): Fix misspelled ‘modus-themes-bold’. * lisp/emacs-lisp/rx.el (rx--normalize-char-pattern): Rename from rx--normalise-char-pattern. (rx--optimize-or-args): Rename from rx--optimise-or-args. * lisp/frame.el (frame--special-parameters): Fix misspelled "right-divider-width". * lisp/net/tramp.el (tramp-fingerprint-prompt-regexp): Use American spelling “centered”, to match current libfprintf. * lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers): Rename from org-fold-core--optimise-for-huge-buffers. (org-fold-core-update-optimization): Rename from org-fold-core-update-optimisation, leaving an alias behind. (org-fold-core-remove-optimization): Rename from org-fold-core-remove-optimisation, leaving an alias behind. * lisp/org/org.el (org-advertized-archive-subtree): This alias is now obsolete. * lisp/play/zone.el (zone-ignored-buffers): Fix misspelling of ‘zone--buffer-encrypted-p’. * lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces): Fix misspelling of ‘csharp’ group. * lisp/vc/vc.el (vc-clonable-backends-custom-type): Rename from vc-cloneable-backends-custom-type, leaving an alias behind. * test/lisp/emacs-lisp/bytecomp-tests.el: (bytecomp-tests--warn-arity-non-compiled-callee): Rename from bytecomp-tests--warn-arity-noncompiled-callee. (bytecomp-test-defface-spec): Reword a deliberate misspelling of “default” that is so common I don’t want it to pollute the spelling dictionary. * test/lisp/emacs-lisp/package-vc-tests.el: (package-vc-tests-preserve-artifacts): Rename from package-vc-tests-preserve-artifacts. * test/lisp/eshell/em-prompt-tests.el: (em-prompt-test/forward-backward-paragraph-1): Reword a deliberate misspelling of “goodbye” that is so common I don’t want it to pollute the spelling dictionary.
* diff-sanity-check-hunk: Better handle incomplete lines (bug#80040)Sean Whitton2025-12-211-0/+1
| | | | | * lisp/vc/diff-mode.el (diff-sanity-check-hunk): Better handle incomplete lines (bug#80040).
* New 'R' code letter for 'interactive' formsSean Whitton2025-12-081-8/+4
| | | | | | | | | | | | | | | | | | | * src/callint.c (callint_argfuns): Add use-region-beginning and use-region-end. (syms_of_callint): Protect use-region-beginning and use-region-end. Add DEFSYM for Quse_region_p. (Fcall_interactively): New 'R' code letter. * lisp/textmodes/paragraphs.el (repunctuate-sentences): * lisp/vc/diff-mode.el (diff-delete-other-hunks, diff-apply-hunk) (diff-revert-and-kill-hunk, diff-apply-buffer): * lisp/vc/log-view.el (log-view-mark-entry) (log-view-unmark-entry): Use it. * doc/lispref/commands.texi (Interactive Codes): * doc/lispref/markers.texi (The Region): * etc/NEWS: * lisp/simple.el (use-region-beginning, use-region-end) (use-region-p): * src/callint.c (Finteractive): Document it.
* * lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): Fix finding END.Sean Whitton2025-12-051-1/+2
|
* * lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): Fix killing.Sean Whitton2025-12-041-14/+12
|
* * lisp/vc/diff-mode.el (diff-filename-drop-dir): Match backslashes.Sean Whitton2025-11-291-1/+1
|
* Handle copying additions & removals between working treesSean Whitton2025-11-291-4/+22
| | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-file-kill): New optional DELETE parameter. (diff-kill-creations-deletions): * lisp/vc/vc.el (vc--fileset-by-state): New functions. (diff-kill-creations-deletions, diff-filename-drop-dir) (diff-hunk-file-names, diff-file-next, diff-hunk-header-re) (vc-dir-resynch-file): Declare. (vc--apply-to-other-working-tree): Handle copying and moving files in the added, removed, missing and unregistered states. * test/lisp/vc/vc-tests/vc-tests.el (vc-test--apply-to-other-working-tree): New test.
* Make diff-revert-and-kill-hunk consider an active regionSean Whitton2025-11-251-7/+35
| | | | | | | * lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): When the region is active, operate on all hunks it overlaps. * doc/emacs/files.texi (Diff Mode): * etc/NEWS: Document the change.
* ; * lisp/vc/diff-mode.el (diff-goto-source): Revise docstring again.Sean Whitton2025-11-251-6/+8
|
* Make diff-apply-hunk consider an active regionSean Whitton2025-11-251-69/+100
| | | | | | | | | | * lisp/vc/diff-mode.el (diff-apply-buffer): New 'no-save' meaning for fourth optional argument. Reserve other non-nil values for this argument. Use ngettext for one message. (diff-apply-hunk): If the region is active, apply all hunks that the region overlaps, like diff-apply-buffer. * doc/emacs/files.texi (Diff Mode): * etc/NEWS: Document the change to diff-apply-hunk.
* ; diff-mode-el: Improve docstrings re diff-jump-to-old-file.Sean Whitton2025-11-251-10/+28
|
* New commands to rewind decentralized VCS branchesSean Whitton2025-11-231-1/+2
| | | | | | | | | | | * lisp/vc/vc.el (vc--remove-revisions-from-end): New function. (vc-uncommit-revisions-from-end, vc-delete-revisions-from-end): * lisp/vc/log-view.el (log-view-uncommit-revisions-from-end) (log-view-delete-revisions-from-end): New commands (bug#79408). (log-view-mode-map): Bind them. * doc/emacs/maintaining.texi (VC Change Log): * doc/emacs/vc1-xtra.texi (VC Auto-Reverting): * etc/NEWS: Document them.
* diff-apply-hunk: Avoid display-buffer-overriding-actionSean Whitton2025-11-181-4/+4
| | | | | * lisp/vc/diff-mode.el (diff-apply-hunk): Use ACTION argument to display-buffer instead of display-buffer-overriding-action.
* diff-apply-hunk: Don't display BUF in the selected windowSean Whitton2025-11-141-1/+3
| | | | | * lisp/vc/diff-mode.el (diff-apply-hunk): Don't display BUF in the selected window.
* Revised bindings for diff-revert-and-kill-hunkSean Whitton2025-11-131-2/+9
| | | | | | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map): Bind diff-revert-and-kill-hunk to 'u'. (diff-mode-map): Replace binding for diff-revert-and-kill-hunk with 'C-c M-u'. * doc/emacs/files.texi (Diff Mode): * etc/NEWS: Document the change.
* * lisp/vc/diff-mode.el (diff-changed-unspecified): Restore old colors.Juri Linkov2025-11-091-3/+3
| | | | | | Restore yellow colors previously used in the 'diff-changed' face. Copy color values from 'smerge-base'. This will distinguish them from grey 'diff-file-header' and 'diff-hunk-header' in context diffs.
* (diff-refine-threshold): New custom var (bug#79546)Stefan Monnier2025-11-071-7/+31
| | | | | | | | | | | Avoid getting stuck waiting for `diff` to refine big hunks. * lisp/vc/diff-mode.el (diff-refine-threshold): New custom var. (diff--refine-hunk): Add arg `skip-if-large` and use that new var if the arg says so. (diff-refine-hunk): Add arg `skip-if-large`. (diff-auto-refine-mode, diff-next/prevhunk, diff--font-lock-refined): Use it.
* Improve color contrast of refine-related diff faces on dark backgroundsJuri Linkov2025-10-161-2/+2
| | | | | | | * 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).
* VC: New commands for cherry-picking (bug#79408)Sean Whitton2025-10-041-0/+15
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* New commands to apply changes to other working treesSean Whitton2025-09-161-22/+28
| | | | | | | | | | | * 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.
* Make C-x v w w work in Log View mode, to change working directorySean Whitton2025-09-081-23/+4
| | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-find-matching-buffer): Rename ... * lisp/progmodes/project.el (project-change-to-matching-directory): ... to here. All uses changed. * lisp/vc/log-view.el (project-change-to-matching-directory): Declare. (log-view-mode): Use it. * doc/emacs/vc1-xtra.texi (Other Working Trees): Document the change.
* New project-find-matching-buffer-function for diff-modeSean Whitton2025-09-011-0/+23
| | | | | | | | * lisp/vc/diff-mode.el (project-root): Declare. (diff-find-matching-buffer): New function. (diff-mode): Use it. * doc/emacs/vc1-xtra.texi (Other Working Trees): Document 'C-x v w w' in diff-mode buffers.
* (diff--font-lock-prettify): Fix fringe width testjohn muhl2025-08-161-3/+6
| | | | | | * 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.
* Include shorter bindings in diff-mode docstringSean Whitton2025-07-191-9/+18
| | | | | | | * 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).
* Merge from origin/emacs-30Sean Whitton2025-07-161-2/+3
|\ | | | | | | | | | | 24db9b79623 ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'. 756e7e52439 ; * lisp/window.el (window-state-put): Fix a typo (bug#79... 0fb20adf8e7 ; define-globalized-minor-mode: Fix info node link in doc...
| * ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'.Sean Whitton2025-07-161-2/+3
| |
| * Update copyright year to 2025Stefan Kangas2025-01-021-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | ; * lisp/vc/diff-mode.el (diff-mode-shared-map): Document.Sean Whitton2025-05-131-0/+4
| |
* | diff-mode-shared-map: Don't inherit from special-mode-mapSean Whitton2025-05-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map): No longer inherit from special-mode-map. (diff-mode-map): Tidy up list of unbindings now that we no longer need to override any bindings from special-mode-map. (minor-mode-map-alist): <diff-mode-read-only>: Ensure that the minor mode keymap continues to inherit from special-mode-map by calling make-composed-keymap here. Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
* | diff-mode-map: Unhide some additional M-<foo>Sean Whitton2025-05-111-1/+2
| | | | | | | | | | * lisp/vc/diff-mode.el (diff-mode-map): Don't inherit M-?, M-SPC, M-DEL and M-S-SPC bindings through from special-mode-map.
* | Update the default value of 'diff-outline-regexp'.Juri Linkov2025-05-071-3/+4
| | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-outline-regexp): Change the default value to match the diff command name in recursive diff. Move after 'diff-hunk-header-re' variable definition used in the new value. (diff-setup-buffer-type): Change setq of 'diff-outline-regexp' to buffer-local (bug#78269).
* | Don't ignore errors in diff-syntax-fontify-hunk.Juri Linkov2025-05-071-5/+1
| | | | | | | | | | | | | | | | * lisp/nxml/nxml-mode.el (nxml-extend-region): Protect against error "Invalid search bound (wrong side of point)". * lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): Use 'with-demoted-errors' instead of 'ignore-errors'.
* | * lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): Add 'ignore-errors'.Juri Linkov2025-05-051-1/+6
| |
* | Teach diff-apply-hunk to handle hunks with empty contextTomas Nordin2025-03-151-3/+5
| | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-find-source-location): Consider the case when there is no diff context above or below edited lines. (bug#72556) * test/lisp/vc/diff-mode-tests.el: Add tests for undoing hunks from diffs with addtions only in the beginning or end of the source file.
* | diff-apply-buffer: Operate on region, add prefix argumentSean Whitton2025-03-111-4/+10
| | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-apply-buffer): Interactively, operate on an active region. Reverse-apply hunks with a prefix argument, like C-u C-c C-a already does.
* | Fix fontification outside hunks in Git patchesStefan Kangas2025-03-031-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-font-lock-keywords): Don't fontify lines in Git patches starting with + or - as added/removed, if they are either before the first hunk, or in the email signature. (Bug#75884) (diff-buffer-type): Move definition up. (diff--indicator-added-re, diff--indicator-removed-re): New variables. (diff--git-preamble-end, diff--git-footer-start) (diff--indicator-matcher-helper, diff--indicator-added-matcher) (diff--indicator-removed-matcher): New functions. * test/lisp/vc/diff-mode-tests.el (diff-mode-test-git-patch) (diff-mode-test-git-patch/before-first-hunk) (diff-mode-test-git-patch/signature): New tests. * test/lisp/vc/diff-mode-resources/git.patch: New file.
* | Don't enable minor modes in diff-add-log-current-defunsStefan Kangas2025-02-261-1/+2
| | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-add-log-current-defuns): Don't run mode hooks when enabling major mode hooks. That fails if, for example, paredit-mode is on emacs-lisp-mode-hook and it signaled due to unbalanced parens.