summaryrefslogtreecommitdiff
path: root/lisp/vc/diff-mode.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Use US spelling docstringPhilip Kaludercic2022-09-111-1/+1
| | | | * lisp/vc/diff-mode.el (diff-add-log-use-relative-names): Update docstring.
* Fix diff-mode.el compilation warningsLars Ingebrigtsen2022-09-101-8/+9
| | | | | * lisp/vc/diff-mode.el (diff-auto-refine-mode): Suppress byte-compile warnings.
* Fix diff-add-log-use-relative-names promptingLars Ingebrigtsen2022-09-081-0/+1
| | | | | * lisp/vc/diff-mode.el (diff-add-log-use-relative-names): Autoload to avoid prompting when set via dir-locals.
* Add new user option 'diff-add-log-use-relative-names'Philip Kaludercic2022-09-081-2/+18
| | | | | | | | * .dir-locals.el: Set new option to t * etc/NEWS: Mention new option. * lisp/vc/diff-mode.el (diff-add-log-use-relative-names): Add new option. (diff-add-log-current-defuns): Use new option. * doc/emacs/maintaining.texi (Log Buffer): Mention new option.
* 'C-x v v' on a diff buffer commits it as a patch (bug#52349)Juri Linkov2022-08-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-vc-deduce-fileset): New function. * lisp/vc/log-edit.el (log-edit-diff-patch): New function. * lisp/vc/vc-dispatcher.el (vc-log-edit): Set log-edit-diff-function to log-edit-diff-patch when vc-patch-string is non-nil. (vc-start-logentry): New optional arg 'patch-string'. Set buffer-local 'vc-patch-string' to 'patch-string'. (vc-dispatcher-browsing): Add (derived-mode-p 'diff-mode). * lisp/vc/vc-git.el (vc-git-checkin-patch): New function. (vc-git-checkin): When vc-git-patch-string is non-nil, use `git apply --cached` to add the patch to the index, then commit the staged changes. * lisp/vc/vc.el: New backend function 'checkin-patch'. (vc-deduce-fileset-1): Call diff-vc-deduce-fileset in diff-mode. (vc-next-action): For model 'patch' call vc-checkin with the diff buffer string. (vc-checkin): New optional arg 'patch-string'. Call backend function 'checkin-patch' when 'patch-string' is non-nil. Call vc-start-logentry with 'patch-string'. (vc-diff-patch-string): New function.
* Make point-at-eol and point-at-bol obsoleteStefan Kangas2022-08-231-1/+1
| | | | | | | * lisp/subr.el (point-at-eol, point-at-bol): Make XEmacs compat aliases obsolete in favor of `pos-bol'/'line-beginning-position' or 'pos-eol'/'line-end-position'. Update callers. Ref: https://lists.gnu.org/r/emacs-devel/2022-08/msg00853.html
* Merge from origin/emacs-28Stefan Kangas2022-08-101-2/+2
|\ | | | | | | | | | | 14833cd9df Improve wording when documenting other TRAMP syntaxes 628df15da5 ; * doc/misc/viper.texi (Rudimentary Changes): Avoid alias. 85de996bbb * lisp/vc/diff-mode.el: Don't mention XEmacs.
| * * lisp/vc/diff-mode.el: Don't mention XEmacs.Stefan Kangas2022-08-081-2/+2
| |
* | Improve 'diff-whitespace-style' user option declarationYugaEgo2022-07-271-2/+5
| | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-whitespace-style): Use ':require'. Minor docstring fix. (top level): Do not require 'whitespace. (whitespace-style, whitespace-trailing-regexp): Add defvars (rollback recent removal). * etc/NEWS: Extend 'diff-whitespace-style' introduction. (Bug#56679) (bug#56679).
* | Add new user option 'diff-whitespace-style'YugaEgo2022-07-241-4/+7
| | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-whitespace-style): New user option. (diff-setup-whitespace): Use it (Bug#56679). (top level): require 'whitespace. (whitespace-style, whitespace-trailing-regexp): Remove defvars.
* | Merge from origin/emacs-28Stefan Kangas2022-07-021-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1c3d107cb5 Fix "C-u C-x =" for SPC 7e33618bbc ; * src/fns.c (Frequire): Fix a typo in the doc string. (... 6908309827 Doc fixes: don't refer to some obsolete items dc3cb749f3 Remove obsolete cust-print from elisp index 9ffbbddf8e * admin/make-tarball.txt: Minor clarifications. f5421104e9 Fix external image conversion on MS-Windows 6f22631a63 * doc/emacs/buffers.texi (Indirect Buffers): Mention modif... # Conflicts: # doc/emacs/buffers.texi # lisp/emacs-lisp/nadvice.el # lisp/image/image-converter.el
| * Doc fixes: don't refer to some obsolete itemsStefan Kangas2022-06-301-1/+1
| | | | | | | | | | | | | | | | * admin/notes/multi-tty: * lisp/chistory.el (command-history): * lisp/emacs-lisp/nadvice.el: * lisp/vc/diff-mode.el: Doc fix; don't refer to obsolete variables and functions.
* | * lisp/vc/diff-mode.el (diff--font-lock-prettify): Fix `diff-buffers` caseStefan Monnier2022-06-291-1/+11
| |
* | Make diff--font-lock-prettify do less if we don't have a left fringeLars Ingebrigtsen2022-05-201-13/+15
| | | | | | | | | | | | * lisp/vc/diff-mode.el (diff--font-lock-prettify): Don't remove insert/deletions from the buffer if we don't have a left fringe (bug#37019).
* | Display file mode information when diff font lock prettify enabledMatthias Meulien2022-04-071-15/+28
| | | | | | | | | | * lisp/vc/diff-mode.el (diff--font-lock-prettify): Make regexp capture file mode information.
* | * lisp/vc/diff-mode.el (diff--font-lock-prettify): Recognize mode changesStefan Monnier2022-02-211-0/+3
| |
* | * lisp/vc/diff-mode.el (diff--font-lock-prettify): bug#54034Stefan Monnier2022-02-211-18/+49
| | | | | | | | | | Handle Git's output when deleting and creating empty files, as well as when the diff is not shown because the file is considered as binary.
* | * lisp/vc/diff-mode.el (diff--font-lock-prettify): Fix mishapsStefan Monnier2022-02-191-23/+26
| | | | | | | | | | | | | | | | | | This reverts the last change so it also applies to non-git diffs again. Instead, we're now more careful not to mis-recognize file headers as addition/removal lines. In addition to that, mark the file header such that it's re-font-locked all at once, and to still recognize it after `diff-reverse-direction`.
* | Fix computation of outline heading level for non-git diffMatthias Meulien2022-02-161-3/+4
| | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-setup-buffer-type): Compute outline heading level using diff-hunk-header-re (bug#51809). (diff--font-lock-prettify): Disable prettify in non-git diff.
* | (with-demoted-errors): Warn on missing `format` argStefan Monnier2022-02-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `format` arg has been mandatory for a while, but the backward compatibility code that handled the case of a missing `format` arg made it hard to notice when using the old calling convention. * lisp/subr.el (with-demoted-errors): Warn on missing `format` arg. * lisp/emacs-lisp/smie.el (smie-indent--separator-outdent): Don't abuse `with-demoted-errors`. (smie-indent-line, smie-auto-fill): * test/lisp/emacs-lisp/ert-tests.el (ert-test-with-demoted-errors): * lisp/vc/vc-hooks.el (vc-refresh-state): * lisp/vc/vc-annotate.el (vc-annotate-background-mode): * lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): * lisp/textmodes/reftex-toc.el (reftex-re-enlarge): * lisp/progmodes/sh-script.el (sh-smie-sh-rules): * lisp/progmodes/octave.el (inferior-octave-startup): * lisp/pcmpl-gnu.el (pcmpl-gnu-make-all-targets): * lisp/org/org-refile.el (org-refile): * lisp/org/org-capture.el (org-capture-store-last-position): * lisp/nxml/nxml-mode.el (nxml-mode): * lisp/notifications.el (notifications-notify): * lisp/gnus/mm-view.el (mm-display-inline-fontify): * lisp/finder.el (finder-unload-function): * lisp/files.el (safe-local-variable-p, backup-buffer-copy * lisp/autorevert.el (auto-revert-notify-handler): Pass `format` arg to `with-demoted-errors`.
* | Remove text mistakenly added to the diff--iterate-hunks doc stringLars Ingebrigtsen2022-01-211-2/+1
| | | | | | | | | | * lisp/vc/diff-mode.el (diff--iterate-hunks): Remove text added by mistake to the doc string.
* | Make diff--iterate-hunks more resilientLars Ingebrigtsen2022-01-211-16/+20
| | | | | | | | | | * lisp/vc/diff-mode.el (diff--iterate-hunks): Ignore malformed hunks instead of signalling errors (bug#53343).
* | Add diff-mode-read-only to enable shorter keys in diff-modeJuri Linkov2022-01-101-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to use outline-minor-mode-cycle keys in diff-mode, outline-minor-mode should be higher in minor-mode-map-alist, and a new variable diff-mode-read-only should be set when the diff-mode buffer is read-only. https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg00740.html * lisp/vc/diff-mode.el: Add diff-mode-read-only to minor-mode-map-alist. (diff-mode-read-only): New buffer-local variable. (diff-mode): Set diff-mode-read-only to t when buffer-read-only is non-nil. Update diff-mode-read-only in read-only-mode-hook. Remove buffer-read-only from minor-mode-overriding-map-alist. Remove view-mode-hook because now view-mode is higher than diff-mode-read-only in minor-mode-map-alist. * lisp/vc/vc-git.el (vc-git-stash-show): * lisp/vc/vc.el (vc-diff-internal): Set buffer-read-only to t before calling diff-mode that will set diff-mode-read-only.
* | Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Revert "Revert "Fix fontification in diff--font-lock-prettify""Tassilo Horn2021-12-291-13/+11
| | | | | | | | This reverts commit 3cadd72673d8095df7eeb8e847db87ae42b5e2f6.
* | Revert "Fix fontification in diff--font-lock-prettify"Tassilo Horn2021-12-291-11/+13
| | | | | | | | This reverts commit 1da392d62d1ae743151f7fda83d0725ec6053686.
* | Fix fontification in diff--font-lock-prettifyMatthias Meulien2021-12-291-13/+11
| | | | | | | | | | | | * lisp/vc/diff-mode.el (diff--font-lock-prettify): Fix diff--font-lock-prettify on created or deleted files (bug#52810).
* | * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Fix typo from 44faf54659Juri Linkov2021-11-181-1/+1
| |
* | Revert VC-related prefix user options to previous valuesLars Ingebrigtsen2021-11-181-4/+3
| | | | | | | | | | | | | | * lisp/vc/smerge-mode.el (smerge-command-prefix): * lisp/vc/pcvs.el (cvs-minor-mode-prefix): * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Revert to previous values, as external packages rely on those values.
* | Adjust `defvar-keymap' and `define-keymap' to the new syntaxLars Ingebrigtsen2021-11-161-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/smerge-mode.el (smerge-basic-map): * lisp/vc/pcvs.el (cvs-mode-map): (cvs-minor-mode-prefix): * lisp/vc/log-view.el (log-view-mode-map): * lisp/vc/log-edit.el (log-edit-mode-map): * lisp/vc/diff-mode.el (diff-mode-shared-map): (diff-minor-mode-prefix): * lisp/vc/cvs-status.el (cvs-status-mode-map): * lisp/simple.el (special-mode-map): * lisp/outline.el (outline--insert-open-button): (outline--insert-close-button): * lisp/net/shr.el (shr-map): * lisp/net/eww.el (eww-link-keymap): (eww-mode-map): (eww-submit-map): (eww-bookmark-mode-map): (eww-history-mode-map): (eww-buffers-mode-map): * lisp/mh-e/mh-speed.el (:keymap): * lisp/mh-e/mh-show.el (:keymap): * lisp/mh-e/mh-search.el (:keymap): * lisp/mh-e/mh-letter.el (:keymap): * lisp/mh-e/mh-folder.el (:keymap): * lisp/international/emoji.el (emoji-list-mode-map): * lisp/gnus/spam.el (:keymap): * lisp/gnus/mml.el (mml-mode-map): * lisp/gnus/message.el (message-mode-map): * lisp/gnus/gnus-undo.el (gnus-undo-mode-map): * lisp/gnus/gnus-topic.el (gnus-topic-mode-map): * lisp/gnus/gnus-sum.el (:keymap): * lisp/gnus/gnus-srvr.el (gnus-server-mode-map): (gnus-browse-mode-map): * lisp/gnus/gnus-salt.el (gnus-pick-mode-map): (gnus-tree-mode-map): * lisp/gnus/gnus-msg.el (:prefix): * lisp/gnus/gnus-ml.el (gnus-mailing-list-mode-map): * lisp/gnus/gnus-kill.el (gnus-kill-file-mode-map): * lisp/gnus/gnus-html.el (gnus-html-displayed-image-map): * lisp/gnus/gnus-group.el (:keymap): * lisp/gnus/gnus-eform.el (gnus-edit-form-mode-map): * lisp/gnus/gnus-draft.el (gnus-draft-mode-map): * lisp/gnus/gnus-dired.el (gnus-dired-mode-map): * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode-map): * lisp/gnus/gnus-art.el (:keymap): (gnus-article-edit-mode-map): * lisp/gnus/gnus-agent.el (gnus-agent-group-mode-map): (gnus-agent-summary-mode-map): (gnus-agent-server-mode-map): (gnus-category-mode-map): Adjust `defvar-keymap' and `define-keymap' to the new syntax.
* | * lisp/vc/diff-mode.el (diff-setup-buffer-type): Move to diff-setup-whitespaceJuri Linkov2021-11-091-15/+15
| | | | | | | | * lisp/vc/vc.el: Add declare-function for diff-setup-buffer-type (bug#51016).
* | Fix local variables overwritten when diff-mode is setMatthias Meulien2021-11-091-10/+16
| | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-mode): (diff-setup-buffer-type): Defun to initialize `diff-buffer-type' * lisp/vc/vc.el (vc-diff-finish): Set `diff-buffer-type' after content inserted (vc-diff-internal): Restore `diff-mode' being set before local variables (bug#51016).
* | Fix 'diff-font-lock-prettify' breaking display of outline headersMatthias Meulien2021-11-051-8/+17
| | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-outline-level): Make hunk headers be at level 2. (diff-mode): Use prettified line as outline header. (diff--outline-level): New function (bug#51016). * lisp/vc/vc.el (vc-diff-internal): Fix diff mode being set before content inserted (bug#51016).
* | Fix diff-mode-shared-mapLars Ingebrigtsen2021-10-191-1/+1
| | | | | | | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map): Fix syntax error in `defvar-keymap' change.
* | Fix possible build issue in pcvs.el and diff-mode.elLars Ingebrigtsen2021-10-181-0/+1
| | | | | | | | | | * lisp/vc/pcvs.el (easy-mmode): * lisp/vc/diff-mode.el (easy-mmode): Require.
* | Convert diff-mode.el from easy-mmode-defmap to define-keymapLars Ingebrigtsen2021-10-181-54/+52
|/ | | | | | * lisp/vc/diff-mode.el (diff-mode-shared-map, diff-mode-map) (diff-minor-mode-map): Convert from easy-mmode-defmap to defvar-keymap.
* Do not count git markers as "deleted lines"Konstantin Kharlamov2021-09-231-1/+5
| | | | | * lisp/vc/diff-mode.el (diff-fixup-modifs): Skip "end of patch" markers that `git-format-patch` leaves around (bug#50761).
* ; More minor docfixes found by checkdocStefan Kangas2021-09-141-1/+1
|
* Filter out -L foo labels in diff-hunk-file-namesLars Ingebrigtsen2021-08-141-5/+5
| | | | | * lisp/vc/diff-mode.el (diff-hunk-file-names): Filter out "-L foo" labels (bug#10160).
* Adjust previous diff-changed-unspecified changeLars Ingebrigtsen2021-08-131-4/+6
| | | | | * lisp/vc/diff-mode.el (diff-changed-unspecified): Adjust the definition to Emacs 28 (bug#26969).
* Add new face diff-changed-unspecifiedLars Ingebrigtsen2021-08-131-4/+15
| | | | | * lisp/vc/diff-mode.el (diff-changed-unspecified): New face. (diff-font-lock-keywords): Use it (bug#26969).
* Ignore file-missing errors during diff-refined font-lockingJim Porter2021-06-241-11/+14
| | | | | * lisp/vc/diff-mode.el (diff--font-lock-refined): Ignore file-missing errors (bug#49197).
* * lisp/vc/diff-mode.el (diff-hunk-text): Test-driven fix for newlines.Juri Linkov2021-05-271-6/+12
| | | | | | | | * lisp/vc/diff-mode.el (diff-hunk-text): Fix handling of newlines to cover all test cases according to new test. * test/lisp/vc/diff-mode-tests.el (diff-mode-test-hunk-text-no-newline): New test to cover cases with no newline at end of file.
* * lisp/vc/diff-mode.el (diff-hunk-text): Handle better "\ No newline at end".Juri Linkov2021-05-201-1/+8
|
* Convert many more links to use HTTPSStefan Kangas2021-03-241-1/+1
|
* * lisp/emacs-lisp/pcase.el: Fix bug#46786Stefan Monnier2021-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Revert commit a218c9861573b5ec4979ff2662f5c0343397e3ff, but in order to avoid the spurious warnings that this commit tried to squash, keep track of the vars used during the match so as to add corresponding annotations to explicitly silence the spurious warnings. To do this, we change the VARS used in `pcase-u` (and throughout the pcase code): they used to hold elements of the form (NAME . VAL) and now they hold elements of the form (NAME VAL . USED). (pcase--expand): Bind all vars instead of only those found via fgrep. (pcase-codegen): Silence "unused var" warnings for those vars that have already been referenced during the match itself. (pcase--funcall, pcase--eval): Record the vars that are used. (pcase--u1): Record the vars that are used via non-linear patterns. * lisp/textmodes/mhtml-mode.el (mhtml-forward): * lisp/vc/diff-mode.el (diff-goto-source): Silence newly discovered warnings. * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-bug46786): New test.
* lisp/vc/*.el: Use lexical-bindings in all the filesStefan Monnier2021-02-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | Also remove some redundant `:group` arguments. * lisp/vc/vc.el (vc-ignore): Autoload. * lisp/vc/pcvs-util.el (cvs-every, cvs-union, cvs-map): Delete functions. * lisp/vc/cvs-status.el: Require `cl-lib` at runtime. (cvs-tree-tags-insert): Use `cl-mapcar` and `cl-every` instead. * lisp/vc/pcvs.el: Require `cl-lib` at runtime. (cvs-do-removal): Use `cl-every` instead. * lisp/vc/ediff-init.el: Require `ediff-util` (for `ediff-cleanup-mess` and `ediff-default-suspend-function`). * lisp/vc/pcvs-info.el (cvs-fileinfo<): Remove unused vars `subtypea` and `subtypeb`. * lisp/vc/vc-git.el: * lisp/vc/vc-bzr.el: Require `vc-dispatcher` at runtime for `vc-do-async-command`.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Prefer setq-local in vc/*.elStefan Kangas2020-12-051-30/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/add-log.el (find-change-log, change-log-mode): * lisp/vc/cvs-status.el (cvs-status-mode): * lisp/vc/diff-mode.el (diff-restrict-view, diff-find-file-name): (diff-mode, diff-setup-whitespace, diff-apply-hunk): * lisp/vc/diff.el (diff-no-select): * lisp/vc/ediff-util.el (ediff-setup): * lisp/vc/log-edit.el (log-edit, log-edit-mode): * lisp/vc/log-view.el (log-view-mode): * lisp/vc/pcvs.el (cvs-temp-buffer, cvs-make-cvs-buffer): (cvs-update-filter, cvs-mode, cvs-mode-commit) (cvs-mode-edit-log, cvs-vc-command-advice): * lisp/vc/smerge-mode.el (smerge-match-conflict): (smerge-ediff, smerge-mode): * lisp/vc/vc-annotate.el (vc-annotate-mode): (vc-annotate, vc-annotate-display): * lisp/vc/vc-bzr.el (vc-bzr-log-view-mode): * lisp/vc/vc-dir.el (vc-dir-mode): * lisp/vc/vc-dispatcher.el (vc-setup-buffer): (vc-compilation-mode, vc-start-logentry): * lisp/vc/vc-git.el (vc-git-log-view-mode): * lisp/vc/vc-hg.el (vc-hg-log-view-mode): * lisp/vc/vc-hooks.el (vc-refresh-state): * lisp/vc/vc-mtn.el (vc-mtn-log-view-mode): * lisp/vc/vc-svn.el (vc-svn-log-view-mode): * lisp/vc/vc.el (vc-register, vc-diff-internal): (vc-find-revision-save, vc-find-revision-no-save): (vc-log-internal-common, vc-region-history): Prefer setq-local.