summaryrefslogtreecommitdiff
path: root/lisp/vc/diff-mode.el
Commit message (Collapse)AuthorAgeFilesLines
* diff-mode auto-refines only after a successful motionDima Kogan2016-12-241-18/+21
| | | | | | | | | | | | | | Prior to this patch (if enabled) auto-refinement would kick in after all hunk navigation commands, even if the motion failed. This would result in a situation where the hunk navigation would signal an error and beep, but yet still accomplish potentially useful work, by auto-refining. This patch moves the auto-refinement code to only run when a motion was successful * lisp/vc/diff-mode.el (diff--internal-hunk-next, diff--internal-hunk-prev): Removed auto-refinement-triggering code * lisp/vc/diff-mode.el (diff--wrap-navigation): Added auto-refinement-triggering code
* diff-mode is able to better handle file headersDima Kogan2016-12-241-1/+1
| | | | | | | | | | | | | | | | | | This fixes a regression introduced in http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=commit;h=2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085 This bug was filed in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25105 Patches generated from a VCS such as git contain a patch message at the start, and diff-mode is now once-again able to properly able to ignore this message when issuing navigation commands around the message. * lisp/vc/diff-mode.el (diff-beginning-of-file-and-junk): More thoroughly ignore the header when looking for a beginning of file diffs.
* ; Spelling fixesPaul Eggert2016-12-221-1/+1
|
* Fix previous commitNoam Postavsky2016-11-291-5/+4
| | | | | * lisp/vc/diff-mode.el (diff-refine-hunk): Make sure to go to beginning of hunk before calling `diff-hunk-style'.
* * lisp/vc/diff-mode.el (diff-refine-hunk): Remove redundant variable.Noam Postavsky2016-11-291-1/+0
|
* Improve diff-mode navigation/manipulationDima Kogan2016-11-281-13/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is Bug #17544. Navigation and use of diff buffers had several annoying corner cases that this patch fixes. These corner cases were largely due to inconsistent treatment of file headers. Say you have a diff such as this: --- aaa +++ bbb @@ -52,7 +52,7 @@ hunk1 @@ -74,7 +74,7 @@ hunk2 --- ccc +++ ddd @@ -608,6 +608,6 @@ hunk3 @@ -654,7 +654,7 @@ hunk4 The file headers here are the '---' and '+++' lines. With the point on such a line, hunk operations would sometimes refer to the next hunk and sometimes to the previous hunk. Most of the time it would be the previous hunk, which is not what the user would expect. This patch consistently treats such headers as the next hunk. So with this patch, if the point is on the '--- ccc' line, the point is seen as referring to hunk3. Specific behaviors this fixes are: 1. It should be possible to place the point in the middle of a diff buffer, and press M-k repeatedly to kill hunks in the order they appear in the buffer. With the point on hunk1, M-k M-k would kill hunk1 then hunk2. With the point on hunk3, it would kill hunk3 then hunk4; this is fine. However, with the point on hunk2, it'd kill hunk2 then hunk1. This is fixed by this patch. 2. Similarly, it should be possible to apply hunks in order. Previously with the point at the start, C-c C-a would apply the hunk1, then move the point to the first @@ header, and thus C-c C-a would try to apply the same hunk again. * lisp/vc/diff-mode.el (diff--wrap-navigation): New function to add better navigation logic to diff-{hunk,file}-{next,prev}. (diff-hunk-next, diff-hunk-prev): (diff-file-next, diff-file-prev): Better navigation logic if skip-hunk-start is true, which happens when called interactively. (diff-bounds-of-hunk, diff-find-source-location): (diff-apply-hunk, diff-current-defun, diff-refine-hunk): Small tweaks to improve hunk navigation.
* ; Fix breakage from previous commitStephen Berman2016-06-271-16/+16
|
* Remove some face aliases obsoleted in 22.1Mark Oteiza2016-06-231-46/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/faces.el (modeline-inactive, modeline-highlight, modeline-buffer-id): * lisp/hilit-chg.el (highlight-changes-face, highlight-changes-delete-face): * lisp/info.el (Info-title-1-face, Info-title-2-face, Info-title-3-face, Info-title-4-face, info-menu-5): * lisp/obsolete/old-whitespace.el (whitespace-highlight-face): * lisp/paren.el (show-paren-match-face, show-paren-mismatch-face): * lisp/progmodes/make-mode.el (makefile-space-face): * lisp/textmodes/texinfo.el (texinfo-heading-face): Remove. (texinfo-font-lock-keywords): Use texinfo-heading face. * lisp/vc/add-log.el (change-log-date-face, change-log-name-face, change-log-email-face, change-log-file-face, change-log-list-face, change-log-conditionals-face, change-log-function-face, change-log-acknowledgement-face): * lisp/vc/diff-mode.el (diff-header-face, diff-file-header-face, diff-index-face, diff-hunk-header-face, diff-removed-face, diff-added-face, diff-changed-face, diff-function-face, diff-context-face, diff-nonexistent-face): Remove. (diff-use-changed-face, diff-font-lock-keywords): Use non-obsolete face symbols. (diff-hunk-file-names): Fix comment. (diff-refine-change): Remove. (diff-refine-removed, diff-refine-added, diff-refine-hunk): Use non-obsolete face. * lisp/vc/log-view.el (log-view-file-face, log-view-message-face): Remove. (log-view-font-lock-keywords): Use non-obsolete face names. * lisp/vc/pcvs-info.el (cvs-header-face, cvs-filename-face, cvs-unknown-face, cvs-handled-face, cvs-need-action-face, cvs-marked-face, cvs-msg-face): * lisp/wid-edit.el (widget-documentation-face, widget-button-face, widget-field-face, widget-single-line-field-face, widget-inactive-face, widget-button-pressed-face): * lisp/woman.el (woman-italic-face, woman-bold-face, woman-unknown-face, woman-addition-face): Remove.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* ; Fix warningsDmitry Gutov2015-11-141-1/+1
| | | | | * lisp/vc/diff-mode.el (diff-kill-applied-hunks): Fix unused variable warnings.
* Backslash cleanup in Elisp source filesPaul Eggert2015-09-171-2/+2
| | | | | | | | | | | This patch should not change behavior. It typically omits backslashes where they are redundant (e.g., in the string literal "^\$"). In a few places, insert backslashes where they make regular expressions clearer: e.g., replace "^\*" (equivalent to "^*") with "^\\*", which has the same effect as a regular expression. Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs, and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with RCS IDs, as that makes it clearer that the backslash is intended.
* Fix minor text quoting in calc, calendar, vcPaul Eggert2015-08-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/calc/calc-ext.el (calc-shift-Z-prefix-help): * lisp/calc/calc-help.el (calc-j-prefix-help): * lisp/calc/calc-misc.el (calc-help): * lisp/calc/calc.el (calc-algebraic-mode, calc-mode): Escape an apostrophe in a docstring. * lisp/calc/calc-forms.el (calc-hms-notation): * lisp/calc/calc-mode.el (calc-display-raw, calc-algebraic-mode): Escape an apostrophe in a diagnostic. * lisp/calc/calc-misc.el (calc-help): * lisp/calendar/diary-lib.el (diary-include-files): * lisp/calendar/todo-mode.el (todo-prefix, todo-item-mark): * lisp/vc/diff-mode.el (diff-delete-trailing-whitespace): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/ediff-merg.el (ediff-re-merge): * lisp/vc/ediff-ptch.el (ediff-patch-file-internal): * lisp/vc/ediff-util.el (ediff-test-save-region) (ediff-status-info): * lisp/vc/ediff.el (ediff-merge-revisions) (ediff-merge-revisions-with-ancestor): * lisp/vc/pcvs.el (cvs-mode-checkout, cvs-vc-command-advice): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): Respect text quoting style in doc string or diagnostic. * lisp/calc/calc-prog.el (calc-kbd-push, calc-kbd-pop): * lisp/vc/add-log.el (change-log-goto-source): Avoid double-formatting. * lisp/vc/ediff-init.el (format-message): New backward-compatibility alias.
* (diff-hunk-file-names): Don't require a TAB after the file nameGustav Hållberg2015-04-081-1/+1
| | | | Fixes: debbugs:20276
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* * lisp/vc/diff-mode.el (diff-kill-applied-hunks): New command.Stefan Monnier2014-12-011-0/+10
| | | | * lisp/vc/smerge-mode.el (smerge-swap): New command.
* Rename 24.5 to 25.1Stefan Monnier2014-09-291-2/+2
| | | | Except where we expect to backport the corresponding change.
* Handle missing space marker in unified diff during header fixupAndreas Schwab2014-08-161-0/+3
| | | | | * vc/diff-mode.el (diff-fixup-modifs): Handle empty line in context of unified diff.
* * lisp/vc/diff-mode.el (diff-changed): Empty face definitionJuri Linkov2014-06-181-8/+7
| | | | | | | | to use `diff-removed' and `diff-added' on tty as well. (diff-context): Use darker color on light background and lighter color on dark background. Fixes: debbugs:10181
* * lisp/vc/diff-mode.el (diff-refine-changed): Rename fromJuri Linkov2014-06-181-1/+2
| | | | | | | | | | | `diff-refine-change' for consistency with `diff-changed'. (diff-refine-change): Add obsolete face alias. * lisp/vc/smerge-mode.el (smerge-refined-changed): Rename from `smerge-refined-change'. (smerge-refined-change): Add obsolete face alias. Fixes: debbugs:10181
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * vc/diff-mode.el (diff-mode): Tiny change re diff-default-read-onlyIvan Shmakov2013-11-221-1/+2
| | | | | | Only allow diff-default-read-only to set buffer-read-only to t, never to nil. Fixes: debbugs:15938
* * lisp/vc/diff-mode.el (diff-mode-shared-map): Unbind "/".Dmitry Gutov2013-03-231-1/+0
| | | | Fixes: debbugs:14034
* * lisp/vc/diff-mode.el (diff-hunk-file-names): Handle filenames with spaces.Sam Steingold2013-02-281-3/+6
| | | | See <http://stackoverflow.com/questions/14720205>.
* Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-021-1/+1
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
| |
* | * lisp/vc/diff-mode.el (diff-post-command-hook): Don't ignore changes at theStefan Monnier2012-12-191-1/+1
| | | | | | | | very beginning of a hunk (e.g. killing the first line).
* | * lisp/vc/diff-mode.el (diff-hunk): Don't make useless timers.Stefan Monnier2012-11-191-13/+15
|/
* Rewrite and rename diff-delete-trailing-whitespace.Chong Yidong2012-11-091-30/+66
| | | | | | | | * lisp/vc/diff-mode.el (diff-delete-trailing-whitespace): Rewrite, and rename from diff-remove-trailing-whitespace (Bug#12831). * files.texi (Diff Mode): Doc fixes for diff-delete-trailing-whitespace.
* Document diff-remove-trailing-whitespaceGlenn Morris2012-11-081-6/+6
| | | | | | | | * doc/emacs/files.texi (Diff Mode): Trailing whitespace updates. * lisp/vc/diff-mode.el (diff-remove-trailing-whitespace): Doc fix. * etc/NEWS: Related markup.
* * lisp/vc/diff-mode.el (diff-context->unified): Don't get confused by "hunkStefan Monnier2012-10-291-6/+8
| | | | | | header comments". (diff-unified->context, diff-context->unified) (diff-reverse-direction, diff-fixup-modifs): Use `use-region-p'.
* * lisp/vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol".Stefan Monnier2012-10-261-7/+16
| | | | | | (diff-refine-hunk): Similarly, handle the "no LF at eol". Fixes: debbugs:12584
* * lisp/vc/diff-mode.el (diff-hunk): `save-excursion' while refining.Stefan Monnier2012-10-231-2/+3
| | | | Fixes: debbugs:12671
* * lisp/vc/diff-mode.el (diff--auto-refine-data): New var.Stefan Monnier2012-10-011-2/+20
| | | | | (diff-hunk): Use it to delay refinement. (diff-mode): Remove overlays when we turn off font-lock.
* * lisp/facemenu.el (list-colors-sort): Add option "Luminance".Juri Linkov2012-09-301-1/+1
| | | | | | | | | | | (list-colors-sort-key): Implement it. * lisp/vc/diff-mode.el (diff-refine-removed): * lisp/vc/ediff-init.el (ediff-fine-diff-A): * lisp/vc/smerge-mode.el (smerge-refined-removed): Change background color "#ffaaaa" to "#ffbbbb". Fixes: debbugs:10181
* * vc/diff-mode.el (diff-mode-menu): diff-remove-trailing-whitespace.Dan Nicolaescu2012-09-101-0/+2
|
* Replace version 24.2 with 24.3 where appropriate (hopefully)Glenn Morris2012-08-151-2/+2
|
* * lisp/color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000):Stefan Monnier2012-08-131-30/+19
| | | | | | | Prefer pcase-let over destructuring-bind. * lisp/vc/diff-mode.el (diff-remove-trailing-whitespace): Same. Also, remove whitespace as we go, rather than after accumulating the various places.
* * vc/diff-mode.el (diff-remove-trailing-whitespace): New function.Oscar Fuentes2012-08-081-0/+41
|
* Reduce use of (require 'cl).Stefan Monnier2012-07-101-92/+99
| | | | | | | | | | | | | | | | | | | | | | | | * admin/bzrmerge.el: Use cl-lib. * leim/quail/hangul.el: Don't require CL. * leim/quail/ipa.el: Use cl-lib. * vc/smerge-mode.el, vc/pcvs.el, vc/pcvs-util.el, vc/pcvs-info.el: * vc/diff-mode.el, vc/cvs-status.el, uniquify.el, scroll-bar.el: * register.el, progmodes/sh-script.el, net/gnutls.el, net/dbus.el: * msb.el, mpc.el, minibuffer.el, international/ucs-normalize.el: * international/quail.el, info-xref.el, imenu.el, image-mode.el: * font-lock.el, filesets.el, edmacro.el, doc-view.el, bookmark.el: * battery.el, avoid.el, abbrev.el: Use cl-lib. * vc/pcvs-parse.el, vc/pcvs-defs.el, vc/log-view.el, vc/log-edit.el: * vc/diff.el, simple.el, pcomplete.el, lpr.el, comint.el, loadhist.el: * jit-lock.el, international/iso-ascii.el, info.el, frame.el, bs.el: * emulation/crisp.el, electric.el, dired.el, cus-dep.el, composite.el: * calculator.el, autorevert.el, apropos.el: Don't require CL. * emacs-bytecomp.el (byte-recompile-directory, display-call-tree) (byte-compile-unfold-bcf, byte-compile-check-variable): * emacs-byte-opt.el (byte-compile-trueconstp) (byte-compile-nilconstp): * emacs-autoload.el (make-autoload): Use pcase. * face-remap.el (text-scale-adjust): Simplify pcase patterns.
* Use the same diff color scheme as in modern VCSes (bug#10181).Juri Linkov2012-05-251-26/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-header, diff-file-header): Remove "green" to avoid confusion with `diff-added' that now uses green colors. (diff-removed): Use shades of red. (diff-added): Use shades of green. (diff-changed): Leave just the yellow color. (diff-use-changed-face): New variable. (diff-font-lock-keywords): Use `diff-use-changed-face' to decide how to highlight context diff changes. (diff-refine-change): Use shades of yellow. (diff-refine-removed): New face that uses shades of red. (diff-refine-added): New face that uses shades of green. (diff-refine-hunk): Use `diff-refine-change', `diff-refine-added', `diff-refine-removed' in the call to `smerge-refine-subst' depending on the value of `diff-use-changed-face'. * lisp/vc/ediff-init.el (ediff-current-diff-A, ediff-fine-diff-A): Add face condition `min-colors 88' with shades of red. (ediff-current-diff-B, ediff-fine-diff-B): Add face condition `min-colors 88' with shades of green. (ediff-current-diff-C, ediff-fine-diff-C): Add face condition `min-colors 88' with shades of yellow. * lisp/vc/smerge-mode.el (smerge-mine): Use shades of red. (smerge-other): Use shades of green. (smerge-base): Use shades of yellow. (smerge-refined-change): Empty face. (smerge-refined-removed): New face that uses shades of red. (smerge-refined-added): New face that uses shades of green. (smerge-refine-subst): Rename arg `props' to `props-c'. Add new args `props-r' and `props-a', and use them. Doc fix. (smerge-refine): Evaluate `smerge-use-changed-face' and depending on its value use different faces `smerge-refined-change', `smerge-refined-removed', `smerge-refined-added' in the call to `smerge-refine-subst'.
* Fixes for diff-hunk-kill.Chong Yidong2012-04-261-47/+71
| | | | | | | | | | | | | * lisp/vc/diff-mode.el (diff-beginning-of-hunk): Return a meaningful value, for symmetry with diff-end-of-hunk. (diff-split-hunk, diff-find-source-location) (diff-ignore-whitespace-hunk, diff-refine-hunk): Use it. (diff-bounds-of-hunk, diff-bounds-of-file): New functions. (diff-restrict-view, diff-hunk-kill, diff-file-kill): Use them to compute the relevant hunk or file properly. (diff-file-junk-re): Add bzr's "modified file" tag. Fixes: debbugs:6041 debbugs:6005
* Allow undoing in read-only diff-mode buffers.Chong Yidong2012-04-261-17/+11
| | | | | | | * lisp/vc/diff-mode.el (diff-undo): New command. (diff-mode-shared-map): Bind it to / and [remap undo]. Fixes: debbugs:5302
* Fix whitespace highlighting of context diffs.Chong Yidong2012-04-251-5/+17
| | | | | | | | | | | * lisp/vc/diff-mode.el (diff-setup-whitespace): New function. (diff-mode): Use it. * lisp/vc/diff.el (diff-sentinel): * lisp/vc/vc.el (vc-diff-finish): Call diff-setup-whitespace to assign Whitespace mode variables based on diff style. Fixes: debbugs:8612
* * lisp/vc/diff-mode.el (diff-file-prev/next): Fix typo.Leo Liu2012-04-141-1/+1
|
* Standardize possessive apostrophe usage in manuals, docs, and commentsGlenn Morris2012-02-281-3/+3
| | | | Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00649.html
* Rename condition-case-no-debug to condition-case-unless-debugLeo Liu2012-02-101-2/+2
|
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* * vc/diff-mode.el (diff-find-file-name): Make `read-file-name'Michael Albinus2011-11-291-3/+5
| | | | aware of remote file names. (Bug#10124)
* Prevent Diff Mode from stealing M-z binding.Eli Zaretskii2011-11-281-1/+1
| | | | | lisp/vc/diff-mode.el (diff-mode-map): Don't inherit 'z' => 'M-z' from special-mode-map.
* Fix more minor mode docstrings.Chong Yidong2011-10-191-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emulation/cua-base.el (cua-mode): * lisp/mail/footnote.el (footnote-mode): * lisp/mail/mailabbrev.el (mail-abbrevs-mode): * lisp/net/xesam.el (xesam-minor-mode): * lisp/progmodes/bug-reference.el (bug-reference-mode): * lisp/progmodes/cap-words.el (capitalized-words-mode): * lisp/progmodes/compile.el (compilation-minor-mode) (compilation-shell-minor-mode): * lisp/progmodes/gud.el (gud-tooltip-mode): * lisp/progmodes/hideif.el (hide-ifdef-mode): * lisp/progmodes/idlw-shell.el (idlwave-shell-electric-debug-mode): * lisp/progmodes/subword.el (subword-mode): * lisp/progmodes/vhdl-mode.el (vhdl-electric-mode, vhdl-stutter-mode): * lisp/progmodes/which-func.el (which-function-mode): * lisp/term/tvi970.el (tvi970-set-keypad-mode): * lisp/term/vt100.el (vt100-wide-mode): * lisp/textmodes/flyspell.el (flyspell-mode): * lisp/textmodes/ispell.el (ispell-minor-mode): * lisp/textmodes/nroff-mode.el (nroff-electric-mode): * lisp/textmodes/paragraphs.el (use-hard-newlines): * lisp/textmodes/refill.el (refill-mode): * lisp/textmodes/reftex.el (reftex-mode): * lisp/textmodes/rst.el (rst-minor-mode): * lisp/textmodes/sgml-mode.el (html-autoview-mode) (sgml-electric-tag-pair-mode): * lisp/textmodes/tex-mode.el (latex-electric-env-pair-mode): * lisp/vc/diff-mode.el (diff-auto-refine-mode, diff-minor-mode): * lisp/emulation/crisp.el (crisp-mode): * lisp/emacs-lisp/eldoc.el (eldoc-mode): * lisp/emacs-lisp/checkdoc.el (checkdoc-minor-mode): Doc fixes for new minor mode behavior. * lisp/erc/erc-fill.el (erc-fill-mode): * lisp/erc/erc-track.el (erc-track-minor-mode): Doc fix. * lisp/erc/erc.el (define-erc-module): Fix autogenerated docstring to reflect Emacs 24 minor mode changes. * lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Doc fix (in Emacs 24, calling a minor mode from Lisp with nil arg enables it, so we have to make the working a bit ambiguous here).