summaryrefslogtreecommitdiff
path: root/lisp/vc/diff-mode.el
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/vc/diff-mode.el (diff-font-lock-prettify): New varStefan Monnier2018-07-131-0/+35
| | | | | (diff--font-lock-prettify): New function. (diff-font-lock-keywords): Use it.
* * lisp/vc/diff-mode.el: Perform hunk refinement from font-lockStefan Monnier2018-07-101-91/+115
| | | | | | | | | | Remove redundant :group arguments. (diff-font-lock-refine): New var. (diff--refine-hunk): New function, extracted from diff-refine-hunk. (diff-refine-hunk): Use it. (diff--font-lock-refine--refresh): New function. (diff--font-lock-refined): New function. (diff-font-lock-keywords): Use it.
* Optionally add argument description in minor mode DOC (bug#10754)John Shahid2018-07-011-6/+0
| | | | | | | | | | | Add a paragraph to minor mode's docstring documenting the mode's ARG usage if the supplied docstring doesn't already contain the word "ARG". * easy-mmode.el (easy-mmode--arg-docstring): New const. (easy-mmode--arg-docstring): New function. (define-minor-mode): Use them. Remove argument documentation from all minor modes.
* Use next-error-found to set next-error-last-buffer.Juri Linkov2018-04-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00207.html * lisp/simple.el (next-error-buffer): New buffer-local variable instead of making buffer-local next-error-last-buffer. (Bug#20489) (next-error-found-function): New defcustom. (next-error-buffer-on-selected-frame): Use t for avoid-current arg of next-error-buffer-p. (next-error-find-buffer): Add second rule for using the current next-error-buffer if it's not visited by other navigation. (next-error, next-error-internal): Call next-error-found. (next-error-found): New function with body extracted mostly from next-error. * lisp/vc/add-log.el (change-log-goto-source-internal): New function with body from change-log-goto-source. (change-log-goto-source): Call change-log-goto-source-internal and next-error-found. (change-log-next-error): Call change-log-goto-source-internal instead of change-log-goto-source. (change-log-mode): Don't set next-error-last-buffer. (Bug#28864) * lisp/vc/diff-mode.el (diff-goto-source): Call next-error-found. * lisp/progmodes/xref.el (xref-goto-xref): Call next-error-found. * lisp/replace.el (occur-mode-goto-occurrence) (occur-mode-goto-occurrence-other-window) (occur-mode-display-occurrence): Call next-error-found. (occur-next-error): Remove unnecessary with-current-buffer. (Bug#27362, bug#30646)
* * lisp/vc/diff-mode.el (diff-wiggle): New command.Stefan Monnier2018-02-181-16/+64
|
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Small fixes prompted by make check-declareGlenn Morris2017-12-141-6/+3
| | | | | | | | * lisp/frame.el (x-focus-frame): Update declaration. (ns-mouse-absolute-pixel-position): Fix declaration. * lisp/vc/diff-mode.el (diff-refine-hunk): Use smerge-refine-regions rather than obsolete alias. (smerge-refine-subst): Remove declaration, no longer relevant.
* maint: shorten https://lists.gnu.org/archive/html/... linksPaul Eggert2017-11-251-1/+1
|
* Prefer HTTPS to HTTP for gnu.orgPaul Eggert2017-10-011-1/+1
| | | | | | | | | This fixes some URLs I omitted from my previous pass, notably those in lists.gnu.org. Although lists.gnu.org does not yet support TLS 1.1, TLS 1.0 is better than nothing. * lisp/erc/erc.el (erc-official-location): * lisp/mail/emacsbug.el (report-emacs-bug): Use https:, not http:.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Fix 'diff-goto-source' when buffer is narrowed (Bug#21262)Charles A. Roelli2017-08-271-45/+47
| | | | | | | | * lisp/vc/diff-mode.el (diff-find-file-name): Save the current narrowing, and widen the buffer before searching for the name of the file corresponding to the diff. With thanks to Noam Postavsky.
* epatch: Save right backups in Git multipatchesTino Calancha2017-03-211-1/+1
| | | | | | | | | | Multipatches on N Git files save wrong backups for N-1 files; only the last one has a correct backup (Bug#26084). * lisp/vc/diff-mode.el (diff-file-junk-re): Add 'Prereq: ' * lisp/vc/ediff-ptch.el (ediff-map-patch-buffer): Use 'diff-file-junk-re'. * test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug25010): Rename from ibuffer-test-bug25010. (ediff-ptch-test-bug26084): New test.
* Check if there are hunks before kill or refine a hunkTino Calancha2017-02-021-74/+85
| | | | | * lisp/vc/diff-mode.el (diff--some-hunks-p): New predicate. (diff-hunk-kill, diff-file-kill, diff-refine-hunk): Use it (Bug#25571).
* Ignore error after kill last file or hunkTino Calancha2017-02-021-2/+3
| | | | | | * lisp/vc/diff-mode.el (diff-hunk-kill): Go to beginning of hunk before kill. Ignore error after kill last hunk (Bug#25570). (diff-file-kill): Idem.
* Handle patch terminators produced by git and bzr patch exportDima Kogan2017-01-311-9/+17
| | | | | | | Patch by Juri Linkov posted in the #9597 bug report * lisp/vc/diff-mode.el (diff-sanity-check-hunk): Find and ignore terminator (Bug #9597, #5302)
* Fix Bug#25524Tino Calancha2017-01-291-2/+4
| | | | | | * lisp/vc/diff-mode.el (diff-beginning-of-hunk): Return position at the beginning off the hunk. (diff-file-junk-re): Add SVN keywords.
* diff-hunk-kill independent of point inside headersTino Calancha2017-01-211-18/+49
| | | | | | | | | | | | | | | | | | | | | Make diff-apply-hunk and diff-hunk-kill independent of the point position in a diff header (Bug#17544). This change allows to apply hunks in order. It also makes possible to press M-k repeatedly to kill hunks in the order they appear in the buffer. See discussion on #Bug25105. * lisp/vc/diff-mode.el (diff-file-junk-re): Move definition before it's used. (diff--at-diff-header-p): New predicate; return non-nil when point is inside a hunk header, a file header, or within a line matching diff-file-junk-re. (diff-beginning-of-hunk): Use it. Check if the point is inside a diff header, in the middle of a hunk, or before the first hunk. (diff-apply-hunk): Call diff-beginning-of-hunk with non-nil arg before apply the hunk. (diff-hunk-kill, diff-file-kill): Call diff-beginning-of-hunk with non-nil arg after kill the hunks. (diff-post-command-hook): Call diff-beginning-of-hunk with non-nil argument.
* ; Revert "Improve diff-mode navigation/manipulation"Tino Calancha2017-01-211-140/+34
| | | | | | | | | | | | | | This reverts commit 2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085. This change causes regressions: https://lists.gnu.org/archive/html/emacs-devel/2016-11/msg00738.html The following related commits are reverted as well: 61c6a10e3110490dadac4577cc540053341ff25c a283d655db88cdcc8cb53d8e2578e1cdf751c84b 6b6abe0dba6a9a2e5f78aac3814421886e7a184f e5ef59b87da5c2ddfa22f7342efe29b3eea6ed97 73349822cbd6e50526eda9c75453584d73dfca83 Fixes: debbugs:25105, 25400.
* Avoid inefficient regex in diff-refine-hunk (Bug#25410)Noam Postavsky2017-01-181-10/+21
| | | | | | * lisp/vc/diff-mode.el (diff--forward-while-leading-char): New function. (diff-refine-hunk): Use it instead of trying to match multiple lines with a single lines.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | 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.