diff options
| author | Stefan Monnier | 2012-10-26 11:51:42 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-10-26 11:51:42 -0400 |
| commit | a2be03575f558aa741e40cd96fbe208092c3a1e7 (patch) | |
| tree | f55caebff8382e8dafc8c71f43d8ee1e892ee00f | |
| parent | 00323fb326b63bed91aadbef861a234f9299cdbc (diff) | |
| download | emacs-a2be03575f558aa741e40cd96fbe208092c3a1e7.tar.gz emacs-a2be03575f558aa741e40cd96fbe208092c3a1e7.zip | |
* lisp/vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol".
(diff-refine-hunk): Similarly, handle the "no LF at eol".
Fixes: debbugs:12584
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/vc/diff-mode.el | 23 |
2 files changed, 22 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 75fbaa13b92..3c1638fd6f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * vc/diff-mode.el (diff-end-of-hunk): Also skip potential "no LF at eol". | ||
| 4 | (diff-refine-hunk): Similarly, handle the "no LF at eol" (bug#12584). | ||
| 5 | |||
| 1 | 2012-10-26 Martin Rudalics <rudalics@gmx.at> | 6 | 2012-10-26 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * mouse.el (mouse-drag-line): Move last form into preceding when | 8 | * mouse.el (mouse-drag-line): Move last form into preceding when |
| @@ -8,7 +13,7 @@ | |||
| 8 | 2012-10-25 David Engster <deng@randomsample.de> | 13 | 2012-10-25 David Engster <deng@randomsample.de> |
| 9 | 14 | ||
| 10 | * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression): | 15 | * emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression): |
| 11 | Removed. This feature is already integrated in imenu. | 16 | Remove. This feature is already integrated in imenu. |
| 12 | 17 | ||
| 13 | * emacs-lisp/eieio-opt.el: Remove require for `button' since it is | 18 | * emacs-lisp/eieio-opt.el: Remove require for `button' since it is |
| 14 | always loaded. Require `speedbar' unconditionally. | 19 | always loaded. Require `speedbar' unconditionally. |
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index cdcc7ca4745..bbe31205c0e 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el | |||
| @@ -478,11 +478,13 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html") | |||
| 478 | (let* ((nold (string-to-number (or (match-string 2) "1"))) | 478 | (let* ((nold (string-to-number (or (match-string 2) "1"))) |
| 479 | (nnew (string-to-number (or (match-string 4) "1"))) | 479 | (nnew (string-to-number (or (match-string 4) "1"))) |
| 480 | (endold | 480 | (endold |
| 481 | (save-excursion | 481 | (save-excursion |
| 482 | (re-search-forward (if diff-valid-unified-empty-line | 482 | (re-search-forward (if diff-valid-unified-empty-line |
| 483 | "^[- \n]" "^[- ]") | 483 | "^[- \n]" "^[- ]") |
| 484 | nil t nold) | 484 | nil t nold) |
| 485 | (line-beginning-position 2))) | 485 | (line-beginning-position |
| 486 | ;; Skip potential "\ No newline at end of file". | ||
| 487 | (if (looking-at ".*\n\\\\") 3 2)))) | ||
| 486 | (endnew | 488 | (endnew |
| 487 | ;; The hunk may end with a bunch of "+" lines, so the `end' is | 489 | ;; The hunk may end with a bunch of "+" lines, so the `end' is |
| 488 | ;; then further than computed above. | 490 | ;; then further than computed above. |
| @@ -490,7 +492,9 @@ See http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html") | |||
| 490 | (re-search-forward (if diff-valid-unified-empty-line | 492 | (re-search-forward (if diff-valid-unified-empty-line |
| 491 | "^[+ \n]" "^[+ ]") | 493 | "^[+ \n]" "^[+ ]") |
| 492 | nil t nnew) | 494 | nil t nnew) |
| 493 | (line-beginning-position 2)))) | 495 | (line-beginning-position |
| 496 | ;; Skip potential "\ No newline at end of file". | ||
| 497 | (if (looking-at ".*\n\\\\") 3 2))))) | ||
| 494 | (setq end (max endold endnew))))) | 498 | (setq end (max endold endnew))))) |
| 495 | ;; We may have a first evaluation of `end' thanks to the hunk header. | 499 | ;; We may have a first evaluation of `end' thanks to the hunk header. |
| 496 | (unless end | 500 | (unless end |
| @@ -1972,8 +1976,13 @@ For use in `add-log-current-defun-function'." | |||
| 1972 | (goto-char beg) | 1976 | (goto-char beg) |
| 1973 | (pcase style | 1977 | (pcase style |
| 1974 | (`unified | 1978 | (`unified |
| 1975 | (while (re-search-forward "^\\(?:-.*\n\\)+\\(\\)\\(?:\\+.*\n\\)+" | 1979 | (while (re-search-forward |
| 1976 | end t) | 1980 | (eval-when-compile |
| 1981 | (let ((no-LF-at-eol-re "\\(?:\\\\.*\n\\)?")) | ||
| 1982 | (concat "^\\(?:-.*\n\\)+" no-LF-at-eol-re | ||
| 1983 | "\\(\\)" | ||
| 1984 | "\\(?:\\+.*\n\\)+" no-LF-at-eol-re))) | ||
| 1985 | end t) | ||
| 1977 | (smerge-refine-subst (match-beginning 0) (match-end 1) | 1986 | (smerge-refine-subst (match-beginning 0) (match-end 1) |
| 1978 | (match-end 1) (match-end 0) | 1987 | (match-end 1) (match-end 0) |
| 1979 | nil 'diff-refine-preproc props-r props-a))) | 1988 | nil 'diff-refine-preproc props-r props-a))) |