Commit graph

1370 commits

Author SHA1 Message Date
Lars Ingebrigtsen
a5e8da4fa2 Add new user option `diff-entire-buffers'
* lisp/vc/diff.el (diff-entire-buffers): New user option (bug#54060).
(diff-file-local-copy): Use it.
(diff-buffers): Mention it in the doc string.
2022-03-21 19:28:14 +01:00
Lars Ingebrigtsen
e07a36f267 Show SVN status on "." directories, too
* lisp/vc/vc-svn.el (vc-svn-after-dir-status): Allow tracking
state of the "." directory, too, since they may have modified
properties (bug#7861).
2022-03-07 03:47:13 +01:00
Stefan Monnier
8e90216389 * lisp/vc/diff-mode.el (diff--font-lock-prettify): Recognize mode changes 2022-02-21 18:53:05 -05:00
Stefan Monnier
89f399324b * lisp/vc/diff-mode.el (diff--font-lock-prettify): bug#54034
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.
2022-02-21 17:22:38 -05:00
Stefan Monnier
910cdcf8c3 * lisp/vc/diff-mode.el (diff--font-lock-prettify): Fix mishaps
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`.
2022-02-19 13:45:04 -05:00
Matthias Meulien
a1617f070b Don't prefix bookmark name with VC backend name
* lisp/vc/vc-dir.el (vc-dir-bookmark-make-record): Remove prefix from
bookmark name.
2022-02-17 12:58:12 +01:00
Matthias Meulien
7c99526435 Extend bookmark menu with with handler type column
* lisp/bookmark.el (bookmark-bmenu--revert): Extend table entries with
handler type.
(bookmark-bmenu-mode): Add handler type column.
* lisp/doc-view.el (doc-view-bookmark-jump): Set bookmark handler type.
* lisp/help-mode.el (help-bookmark-jump): Set bookmark handler type.
* lisp/image-dired.el (image-dired-bookmark-jump): Set bookmark handler type.
* lisp/info.el (Info-bookmark-jump): Set bookmark handler type.
* lisp/net/eww.el (eww-bookmark-jump): Set bookmark handler type.
* lisp/vc/vc-dir.el (vc-dir-bookmark-jump): Set bookmark handler type.
* lisp/woman.el (woman-bookmark-jump): Set bookmark handler type.
2022-02-17 12:58:12 +01:00
Matthias Meulien
b299c04201 Fix computation of outline heading level for non-git diff
* 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.
2022-02-16 21:19:45 +02:00
Lars Ingebrigtsen
130cd70d9b Improve the ediff-diff-options documentation
* lisp/vc/ediff-diff.el (ediff-diff-options):
* doc/misc/ediff.texi (Patch and Diff Programs): Note that setting
this variable directly is probably the wrong thing to do (bug#6512).
2022-02-07 04:58:49 +01:00
Stefan Monnier
d52c929e31 (with-demoted-errors): Warn on missing format arg
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`.
2022-02-04 19:39:53 -05:00
Juri Linkov
70f994f6d0 * lisp/vc/vc.el (vc-diff-internal): Assume revert-buffer is in current buffer.
Support the case when reverting is in the buffer with a name other than
the default name "*vc-diff*".  Then don't try to switch to the buffer
"*vc-diff*" with an assumption that revert-buffer is always performed
in the current buffer (bug#28852).
2022-01-31 20:46:06 +02:00
Charles A. Roelli
a836e8bf0c Make revert-buffer ('g') keep point in VC diff buffers
* lisp/vc/vc.el (vc-diff-restore-buffer): New function.
(vc-diff-finish): Update its calling convention to include an
optional 'oldbuf' parameter, and handle it.
(vc-diff-internal): Pass a clone of the incumbent vc-diff
buffer to 'vc-diff-finish' (bug#28852).
2022-01-29 16:47:52 +01:00
Lars Ingebrigtsen
0a51a85b5d Make smerge-refine-ignore-whitespace into defcustom
* lisp/vc/smerge-mode.el (smerge-refine-ignore-whitespace): Make
into defcustom (bug#12585).
2022-01-26 18:57:29 +01:00
Lars Ingebrigtsen
fb16a6c124 Improve how change-log-mode fills all-file-name lines
* lisp/vc/add-log.el (change-log-fill-file-list): New function to
improve how we fill all-file-name ChangeLog lines (bug#19341).
(change-log-indent): Use it.
2022-01-25 23:41:07 +01:00
Lars Ingebrigtsen
1edde2fc7a Mark nil vc-follow-symlinks as safe
* lisp/vc/vc-hooks.el (vc-follow-symlinks): A nil value should be
safe for file-local (bug#33264).
2022-01-22 16:44:25 +01:00
Lars Ingebrigtsen
8d4fffb643 Remove text mistakenly added to the diff--iterate-hunks doc string
* lisp/vc/diff-mode.el (diff--iterate-hunks): Remove text added by
mistake to the doc string.
2022-01-21 14:31:11 +01:00
Lars Ingebrigtsen
502dbd1f7c Make diff--iterate-hunks more resilient
* lisp/vc/diff-mode.el (diff--iterate-hunks): Ignore malformed
hunks instead of signalling errors (bug#53343).
2022-01-21 12:07:04 +01:00
Stefan Monnier
0f558e3be9 VC: Fix tests for SCCS and Mtn
* test/lisp/vc/vc-tests.el: Prefer closures to `(lambda ...).
(vc-test-mtn05-rename-file, vc-test-mtn06-version-diff): Skip.

* lisp/vc/vc.el (vc-responsible-backend): Fix vc-test--register on SCCS.
2022-01-18 16:42:19 -05:00
Stefan Monnier
525dc6e5c4 * pcvs-info.el (cvs-mode-toggle-mark): Typo 2022-01-15 09:31:55 -05:00
Stefan Monnier
0e20d76a38 pcvs-info.el: Prefer declare-function over autoload
* lisp/vc/pcvs-info.el (cvs-mode-toggle-mark): Use `declare-function`
to silence the byte-compiler warning.
2022-01-14 15:28:21 -05:00
Lars Ingebrigtsen
d63d647c11 Fix byte-compilation warning in pcvs-info
* lisp/vc/pcvs-info.el (cvs-mode-toggle-mark): Fix
byte-compilation warning.
2022-01-14 07:10:26 +01:00
Stefan Kangas
53dba32022 Prefer defvar-keymap to easy-mmode-defmap
* lisp/progmodes/gud.el (gud-minibuffer-local-map):
* lisp/vc/pcvs-info.el (cvs-status-map): Use defvar-keymap.

* lisp/emacs-lisp/easy-mmode.el (easy-mmode-defmap): Document as
deprecated.
2022-01-13 23:24:25 +01:00
Juri Linkov
c8ea3f09e0 * lisp/vc/vc.el (vc-shrink-buffer-window): New function (bug#51062).
(vc-diff-finish-functions): New variable.
(vc-diff-finish): Use it.
(vc-log-finish-functions): New variable.
(vc-log-internal-common): Use it.
2022-01-11 19:34:54 +02:00
Juri Linkov
97806bc7de Add diff-mode-read-only to enable shorter keys in diff-mode
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.
2022-01-10 20:29:53 +02:00
Lars Ingebrigtsen
0a51652f6d Fix typo in cvs-status-mode-map keymap
* lisp/vc/cvs-status.el (cvs-status-mode-map): Fix typo in keymap
definition.
2022-01-05 17:07:07 +01:00
Stefan Kangas
d763c12796 Merge from origin/emacs-28
e7aa3ece52 Fix vc-git with old Git over Tramp and cygwin-mount.el
c0cfbca311 * lisp/emacs-lisp/checkdoc.el (bytecomp): Add missing require

# Conflicts:
#	etc/NEWS
2022-01-05 06:30:39 +01:00
Dmitry Gutov
e7aa3ece52 Fix vc-git with old Git over Tramp and cygwin-mount.el
* lisp/vc/vc-git.el (vc-git-use-literal-pathspecs): New variable.
(vc-git-command, vc-git--call): Use it to determine whether to set
GIT_LITERAL_PATHSPECS=1 (bug#51497).
(vc-git--literal-pathspec, vc-git--literal-pathspecs): Remove.
Update all callers.  This reverts the previous solution for bug#39452.

* lisp/progmodes/project.el (project--vc-list-files):
Use the new variable.
2022-01-05 04:08:10 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
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
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Tassilo Horn
7715fb3eff Revert "Revert "Fix fontification in diff--font-lock-prettify""
This reverts commit 3cadd72673.
2021-12-29 18:00:52 +01:00
Tassilo Horn
3cadd72673 Revert "Fix fontification in diff--font-lock-prettify"
This reverts commit 1da392d62d.
2021-12-29 18:00:30 +01:00
Matthias Meulien
1da392d62d Fix fontification in diff--font-lock-prettify
* lisp/vc/diff-mode.el (diff--font-lock-prettify): Fix
diff--font-lock-prettify on created or deleted files
(bug#52810).
2021-12-29 17:25:35 +01:00
Juri Linkov
a17a11df04 * lisp/vc/vc.el (vc-revert): Use generate-new-buffer, not just new buffer name 2021-12-28 10:46:40 +02:00
Stefan Kangas
c167009400 Make some variable aliases obsolete
* lisp/progmodes/make-mode.el (makefile-query-one-target-method):
* lisp/skeleton.el (skeleton-transformation, skeleton-filter):
* lisp/textmodes/artist.el (artist-text-renderer):
* lisp/textmodes/bibtex.el (bibtex-autokey-name-case-convert):
(bibtex-autokey-titleword-case-convert):
* lisp/textmodes/ispell.el (ispell-format-word):
* lisp/textmodes/sgml-mode.el (sgml-transformation):
* lisp/vc/add-log.el (change-log-time-zone-rule): Make variable
aliases obsolete.
2021-12-20 22:16:24 +01:00
Eli Zaretskii
469fe6a040 ; * lisp/vc/vc-dispatcher.el (vc-command-messages): Doc fix. 2021-12-16 22:01:06 +02:00
Juri Linkov
e726a00381 * lisp/vc/vc-dispatcher.el (vc-command-messages): Add choice 'log'.
(vc-do-command): Don't display messages but only write them to the *Messages*
buffer when vc-command-messages is 'log' (bug#52518).
2021-12-16 21:16:50 +02:00
Stefan Kangas
e7a6d6a546 Merge from origin/emacs-28
1e578267fb Fix control buffer window height in 'ediff-setup-control-b...
2021-12-16 06:31:48 +01:00
Martin Rudalics
1e578267fb Fix control buffer window height in 'ediff-setup-control-buffer' (Bug#49277)
* lisp/vc/ediff-util.el (ediff-setup-control-buffer): Emulate
original 'shrink-window-if-larger-than-buffer' call by calling
'fit-window-to-buffer' with an appropriate maximum height
argument (Bug#49277).
2021-12-15 18:53:49 +01:00
Lars Ingebrigtsen
9a1e87ba44 Add vc-git-stash-pop to vc-dir-git-mode
* lisp/vc/vc-git.el (vc-dir-git-mode-map): Add vc-git-stash-pop
(bug#52158).
2021-12-07 08:06:16 +01:00
Lars Ingebrigtsen
0dca455d14 Make the Git stash commands available in vc-dir Git buffers
* lisp/vc/vc-dir.el (vc-dir): Call the backend-specific minor mode
if it exists.
* lisp/vc/vc-git.el (vc-dir-git-mode-map): New map.
(vc-dir-git-mode): New minor mode.
2021-12-06 06:41:25 +01:00
Justin Schell
e6a0cfaad5 vc-git--program-version to support Git for macOS version string
`git version` on macOS returns e.g., "git version 2.30.1 (Apple
Git-130)" and `vc-git--program-version` currently returns "0" instead
of "2.30.1".

* lisp/vc/vc-git.el (vc-git--program-version): Ignore text after
the version number when parsing git versions (bug#52172).

Copyright-paperwork-exempt: yes
2021-12-06 02:27:52 +01:00
Dmitry Gutov
824d31e3bf Remove empty lines from stash read prompt
* lisp/vc/vc-git.el (vc-git-stash-read): Pass OMIT-NULLS (bug#52119).
(vc-git-stash-list): Simplify.
2021-11-26 16:03:30 +03:00
Stefan Kangas
4a3ba8528b Use substitute-command-keys for literal key sequences
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-help-for-help):
* lisp/calc/calc-mode.el (calc-auto-why):
* lisp/calc/calc.el (calc-do):
* lisp/calculator.el (calculator-mode):
* lisp/dired-aux.el (dired-create-files)
(dired-do-create-files-regexp, dired-create-files-non-directory):
* lisp/dired-x.el (dired-virtual):
* lisp/dired.el (dired-mark-region, dired-unmark-all-files):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/epa-ks.el (epa-ks--display-keys):
* lisp/erc/erc.el (erc-toggle-debug-irc-protocol):
* lisp/files.el (save-some-buffers):
* lisp/gnus/gnus-dired.el (gnus-dired-find-file-mailcap)
(gnus-dired-print):
* lisp/gnus/gnus-group.el (gnus-keep-same-level):
* lisp/gnus/gnus-score.el (gnus-score-find-trace):
* lisp/gnus/gnus.el (to-list):
* lisp/gnus/message.el (message--send-mail-maybe-partially):
* lisp/mail/supercite.el (sc-set-variable):
* lisp/minibuffer.el (minibuffer-inactive-mode):
* lisp/progmodes/etags.el (select-tags-table):
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode)
(idlwave-shell-char-mode-loop):
* lisp/replace.el (query-replace-help):
* lisp/simple.el (set-variable):
* lisp/subr.el (read-char-from-minibuffer):
* lisp/textmodes/ispell.el (ispell-help, ispell-message):
* lisp/textmodes/reftex-global.el (reftex-find-duplicate-labels):
* lisp/textmodes/reftex-vars.el
(reftex-toc-include-file-boundaries)
(reftex-toc-include-labels, reftex-toc-include-index-entries)
(reftex-toc-include-context, reftex-toc-follow-mode)
(reftex-index-include-context, reftex-index-follow-mode)
(reftex-enable-partial-scans)
(reftex-auto-update-selection-buffers)
(reftex-highlight-selection):
* lisp/time.el (display-time-update):
* lisp/vc/ediff-help.el (ediff-help-for-quick-help):
* lisp/vc/ediff-init.el (ediff-keep-variants):
* lisp/vc/ediff-ptch.el (ediff-fixup-patch-map)
(ediff-patch-file-internal):
* lisp/windmove.el (windmove-delete-default-keybindings): Use
'substitute-command-keys' for literal key sequences.

* lisp/userlock.el (userlock--fontify-key): Remove function.
(ask-user-about-lock, ask-user-about-lock-help)
(ask-user-about-supersession-threat)
(ask-user-about-supersession-help): Use 'substitute-command-keys' for
literal key sequences.

* lisp/ibuffer.el (ibuffer-unmark-all): Use 'substitute-command-keys'
for command.
2021-11-22 12:04:19 +01:00
Juri Linkov
71f237d668 * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Fix typo from 44faf54659 2021-11-18 19:13:48 +02:00
Lars Ingebrigtsen
44faf54659 Revert VC-related prefix user options to previous values
* 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.
2021-11-18 12:11:35 +01:00
Stefan Kangas
0fbe543bc1 Use substitute-command-keys in some messages
* lisp/dired.el (dired-get-file-for-visit):
* lisp/doc-view.el (doc-view-buffer-message):
* lisp/help.el (help-window-setup):
* lisp/ibuf-ext.el (ibuffer-do-kill-lines):
* lisp/vc/ediff.el (ediff-documentation): Use 'substitute-command-keys'.
2021-11-17 14:29:15 +01:00
Lars Ingebrigtsen
2daffe3550 Adjust defvar-keymap' and define-keymap' to the new syntax
* 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.
2021-11-16 08:26:24 +01:00
Lars Ingebrigtsen
06632fbaf8 Fix previous -responsible-p change
* lisp/vc/vc-sccs.el (vc-sccs-responsible-p):
* lisp/vc/vc-rcs.el (vc-rcs-responsible-p):
* lisp/vc/vc-cvs.el (vc-cvs-responsible-p): Make the previous
change work with relative file names, too.
2021-11-14 09:41:22 +01:00
Lars Ingebrigtsen
ad442b8887 Make all vc-*-responsible-p functions return a string
* lisp/vc/vc-sccs.el (vc-sccs-responsible-p):
* lisp/vc/vc-rcs.el (vc-rcs-responsible-p):
* lisp/vc/vc-dav.el (vc-dav-responsible-p):
* lisp/vc/vc-cvs.el (vc-cvs-responsible-p): Return a file name
instead of t when we get a match (which is what
vc-backend-for-registration expects) (bug#51800).
2021-11-14 02:38:48 +01:00
Manuel Giraud
439a3094ff Find most specific backend for `vc-backend-for-registration'.
* lisp/vc/vc.el (vc-backend-for-registration): Count file name
components instead of the length of the file name string (bug#50572).
2021-11-14 01:54:46 +01:00