commit 448cacc85c5cc7b017437e71962168ed03d21ab6 (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Tue May 19 08:50:36 2015 +0200 In w32heap.c bump DUMPED_HEAP_SIZE to 19/12 MB * emacs-git/quick/src/w32heap.c (DUMPED_HEAP_SIZE): Bump to 19/12 MB. diff --git a/src/w32heap.c b/src/w32heap.c index ee0eb16..47ffec1 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -115,9 +115,9 @@ typedef struct _RTL_HEAP_PARAMETERS { to build only the first bootstrap-emacs.exe with the large size, and reset that to a lower value afterwards. */ #if defined _WIN64 || defined WIDE_EMACS_INT -# define DUMPED_HEAP_SIZE (18*1024*1024) +# define DUMPED_HEAP_SIZE (19*1024*1024) #else -# define DUMPED_HEAP_SIZE (11*1024*1024) +# define DUMPED_HEAP_SIZE (12*1024*1024) #endif static unsigned char dumped_data[DUMPED_HEAP_SIZE]; commit 18e4eb6bd66cf2799156b3a6c3ab93cadc75a2ba Author: Glenn Morris Date: Mon May 18 21:43:01 2015 -0400 ; * CONTRIBUTE: Fix typo in previous. diff --git a/CONTRIBUTE b/CONTRIBUTE index 526d8da..7e697dd 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -96,7 +96,7 @@ messages: - Commit messages should not contain the "Signed-off-by:" lines that are used in some other projects. -- Any lines of the the commit message that start with "; " are omitted +- Any lines of the commit message that start with "; " are omitted from the generated ChangeLog. - Explaining the rationale for a design choice is best done in comments commit 314244aac44525a32dc9ea0a3ec94f77f055d332 Author: Glenn Morris Date: Mon May 18 21:41:03 2015 -0400 Add option to ignore commit lines matching a pattern in ChangeLog. * build-aux/gitlog-to-changelog: Add --ignore-line option. * build-aux/gitlog-to-emacslog: Ignore lines matching '^; '. ; * CONTRIBUTE: Mention this. diff --git a/CONTRIBUTE b/CONTRIBUTE index bf23155..526d8da 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -96,6 +96,9 @@ messages: - Commit messages should not contain the "Signed-off-by:" lines that are used in some other projects. +- Any lines of the the commit message that start with "; " are omitted + from the generated ChangeLog. + - Explaining the rationale for a design choice is best done in comments in the source code. However, sometimes it is useful to describe just the rationale for a change; that can be done in the commit message diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index ad7c273..9abb693 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' if 0; # Convert git log output to ChangeLog format. -my $VERSION = '2015-05-08 06:05'; # UTC +my $VERSION = '2015-05-19 01:37'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook @@ -74,6 +74,7 @@ OPTIONS: the default is to convert all log entries. --until=DATE convert only the logs older than DATE. --ignore-matching=PAT ignore commit messages whose first lines match PAT. + --ignore-line=PAT ignore lines of commit messages that match PAT. --format=FMT set format string for commit subject and body; see 'man git-log' for the list of format metacharacters; the default is '%s%n%b%n' @@ -228,6 +229,7 @@ sub git_dir_option($) my $append_dot = 0; my $cluster = 1; my $ignore_matching; + my $ignore_line; my $strip_tab = 0; my $strip_cherry_pick = 0; my $srcdir; @@ -242,6 +244,7 @@ sub git_dir_option($) 'append-dot' => \$append_dot, 'cluster!' => \$cluster, 'ignore-matching=s' => \$ignore_matching, + 'ignore-line=s' => \$ignore_line, 'strip-tab' => \$strip_tab, 'strip-cherry-pick' => \$strip_cherry_pick, 'srcdir=s' => \$srcdir, @@ -349,6 +352,12 @@ sub git_dir_option($) if (! (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/)) { + if (defined $ignore_line && @line) + { + @line = grep ! /$ignore_line/, @line; + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + # Record whether there are two or more paragraphs. my $multi_paragraph = grep /^\s*$/, @line; diff --git a/build-aux/gitlog-to-emacslog b/build-aux/gitlog-to-emacslog index aa42060..d1b1af9 100755 --- a/build-aux/gitlog-to-emacslog +++ b/build-aux/gitlog-to-emacslog @@ -58,7 +58,7 @@ test -d .git || { # Use Gnulib's packaged ChangeLog generator. ./build-aux/gitlog-to-changelog --ignore-matching='^; ' \ - --format='%B' \ + --ignore-line='^; ' --format='%B' \ "$gen_origin.." >"ChangeLog.tmp" || exit if test -s "ChangeLog.tmp"; then commit 88e4dfaadb1daf6f1ce0e80442af5a2dae7853bc Author: Paul Eggert Date: Mon May 18 18:05:26 2015 -0700 Don't skip new etags tests on non-UTF-8 hosts Problem reported by Eli Zaretskii for MS-Windows. * test/etags/Makefile (UTF8_LOCALE, UTF8_ENCODING): Remove. (LC_ALL): Set to C if the current locale isn't UTF-8. (.PHONY): Remove ediff_1 thru ediff_5. (check): Always run. diff --git a/test/etags/Makefile b/test/etags/Makefile index 3f4ad7b..4a01c28 100644 --- a/test/etags/Makefile +++ b/test/etags/Makefile @@ -44,31 +44,24 @@ ARGS=- < srclist infiles = $(filter-out ${NONSRCS},${SRCS}) srclist regexfile -# This test requires a UTF-8 locale. Use the current locale if it is UTF-8, -# else $(UTF8_LOCALE) if it works, else skip this test. -UTF8_LOCALE = en_US.utf8 -UTF8_ENCODING = yes +# Although this test uses UTF-8 data, some platforms lack UTF-8 locales. +# If the current locale isn't known to use UTF-8, fall back on the C locale. +# Although the C locale in theory is not safe for UTF-8 data, in practice +# it should be good enough. ifneq ($(shell locale -k charmap), charmap="UTF-8") - ifeq ($(shell LC_ALL=$(UTF8_LOCALE) locale -k charmap), charmap="UTF-8") - export LC_ALL = $(UTF8_LOCALE) - else - UTF8_ENCODING = no - endif + export LC_ALL = C endif -.PHONY: check ediff_1 ediff_2 ediff_3 ediff_4 ediff_5 cdiff ETAGS CTAGS +.PHONY: check cdiff ETAGS CTAGS +# Can't make ediff_1 through ediff_5 .PHONY, as they're implicit. check: - ifeq ($(UTF8_ENCODING), yes) @$(MAKE) OPTIONS='--no-members' ediff_1 @$(MAKE) OPTIONS='--declarations --no-members' ediff_2 @$(MAKE) OPTIONS='--members' ediff_3 @$(MAKE) OPTIONS='--regex=@regexfile --no-members' ediff_4 @$(MAKE) OPTIONS='nonexistent --members --declarations --regex=@regexfile' ediff_5 @$(MAKE) cdiff - else - : 'No locale with UTF-8 found; skipping check' - endif ediff%: ETAGS.good% ETAGS ${infiles} diff -u --suppress-common-lines --width=80 ETAGS.good$* ETAGS commit d464818ca2fdae2655a312c0f3fa8b66481c6522 Author: Glenn Morris Date: Mon May 18 20:54:24 2015 -0400 * lisp/calculator.el (calculator-funcall): * lisp/textmodes/artist.el (artist-spray-random-points): Use standard degree/radian conversion utilities. diff --git a/lisp/calculator.el b/lisp/calculator.el index 0aef07b..4027887 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -1203,10 +1203,10 @@ arguments." ;; f is an expression (let ((TX (and X (calculator-truncate X))) (TY (and Y (calculator-truncate Y))) - (DX (if (and X calculator-deg) (/ (* X pi) 180) X)) + (DX (if (and X calculator-deg) (degrees-to-radians X) X)) (L calculator-saved-list) (fF `(calculator-funcall ',f x y)) - (fD `(if calculator-deg (/ (* x 180) float-pi) x))) + (fD `(if calculator-deg (* radians-to-degrees x) x))) (eval `(cl-flet ((F (&optional x y) ,fF) (D (x) ,fD)) (let ((X ,X) (Y ,Y) (DX ,DX) (TX ,TX) (TY ,TY) (L ',L)) ,f)) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 930c39c..7352160 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -2958,7 +2958,7 @@ Blanks in the rendered text overwrite any text in the buffer." Returns a list of points. Each point is on the form (X1 . Y1)." (let ((points)) (while (> n 0) - (let* ((angle (* (random 359) (/ float-pi 180))) + (let* ((angle (degrees-to-radians (random 359))) (dist (random radius)) (point (cons (round (* dist (cos angle))) (round (* dist (sin angle)))))) commit d13f8874480e8687976f4a5ce4f5c9633233c782 Author: Glenn Morris Date: Mon May 18 20:53:11 2015 -0400 ; * lisp/mail/mailabbrev.el: Comment. diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 2f349b9..f974f20 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -603,7 +603,7 @@ In other respects, this behaves like `end-of-buffer', which see." (eval-after-load "sendmail" '(progn (define-key mail-mode-map "\C-c\C-a" 'mail-abbrev-insert-alias) - (define-key mail-mode-map "\e\t" ; like lisp-complete-symbol + (define-key mail-mode-map "\e\t" ; like completion-at-point 'mail-abbrev-complete-alias))) ;;(define-key mail-mode-map "\C-n" 'mail-abbrev-next-line) commit f42ceab546c12534190ef0aac6db9de23c7a3e1a Author: Glenn Morris Date: Mon May 18 20:51:47 2015 -0400 Further lisp-complete-symbol related cleanup. * lisp/emacs-lisp/lisp.el (lisp-complete-symbol): Unadvertise non-functional argument. Replace obsolete alias. diff --git a/etc/NEWS b/etc/NEWS index c040186..c4c9d77 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -734,6 +734,10 @@ a typographically-correct documents. * Incompatible Lisp Changes in Emacs 25.1 +** The optional `predicate' argument of `lisp-complete-symbol' no longer +has any effect. (This change was made in Emacs 24.4 but was not +advertised at the time.) + ** `indirect-function' does not signal `void-function' any more. This is mostly a bug-fix, since this change was missed back in 24.4 when symbol-function was changed not to signal `void-function' any more. diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index d401b31..7b7b48c 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -746,9 +746,10 @@ The context determines which symbols are considered. If the symbol starts just after an open-parenthesis, only symbols with function definitions are considered. Otherwise, all symbols with function definitions, values or properties are considered." - (declare (obsolete completion-at-point "24.4")) + (declare (obsolete completion-at-point "24.4") + (advertised-calling-convention () "25.1")) (interactive) - (let* ((data (lisp-completion-at-point)) + (let* ((data (elisp-completion-at-point)) (plist (nthcdr 3 data))) (if (null data) (minibuffer-message "Nothing to complete") diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el index b167671..a19ff32 100644 --- a/lisp/hippie-exp.el +++ b/lisp/hippie-exp.el @@ -99,10 +99,10 @@ ;; from the kill ring. May be good if you don't know how far up in ;; the kill-ring the required entry is, and don't want to mess with ;; "Choose Next Paste". -;; `try-complete-lisp-symbol' : like `lisp-complete-symbol', but goes +;; `try-complete-lisp-symbol' : like `elisp-completion-at-point', but goes ;; through all possibilities instead of completing what is unique. ;; Might be tedious (usually a lot of possible completions) and -;; since its function is much like `lisp-complete-symbol', which +;; since its function is much like `completion-at-point', which ;; already has a key of its own, you might want to remove this. ;; `try-complete-lisp-symbol-partially' : To insert in the list just ;; before `try-complete-lisp-symbol' for those who first want to get diff --git a/lisp/ses.el b/lisp/ses.el index e986015..3336769 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -172,7 +172,7 @@ Each function is called with ARG=1." "\C-c\C-s" ses-insert-ses-range [S-mouse-3] ses-insert-range-click [C-S-mouse-3] ses-insert-ses-range-click - "\M-\C-i" lisp-complete-symbol)) + "\M-\C-i" lisp-complete-symbol)) ; FIXME obsolete (newmap (make-sparse-keymap))) (set-keymap-parent newmap minibuffer-local-map) (while keys commit 941ae9f2578ccd2760090dcd3f450339893b9492 Author: Dmitry Gutov Date: Tue May 19 00:02:39 2015 +0300 Add a test case for Maven warning ouput * test/automated/compile-tests.el (compile-tests--test-regexps-data): Add a case for Maven warning ouput. (compile--test-error-line): Check the compilation message type, if it's specified in the test data. diff --git a/test/automated/compile-tests.el b/test/automated/compile-tests.el index 24c4fde..0c383f7 100644 --- a/test/automated/compile-tests.el +++ b/test/automated/compile-tests.el @@ -204,9 +204,11 @@ ("makepp: bla bla `/foo/bar.c' and `/foo/bar.h'" 35 nil nil "/foo/bar.h") ;; maven ("FooBar.java:[111,53] no interface expected here" - 1 53 111 "FooBar.java") + 1 53 111 "FooBar.java" 2) (" [ERROR] /Users/cinsk/hello.java:[651,96] ';' expected" - 15 96 651 "/Users/cinsk/hello.java") ;Bug#11517. + 15 96 651 "/Users/cinsk/hello.java" 2) ;Bug#11517. + ("[WARNING] /foo/bar/Test.java:[27,43] unchecked conversion" + 11 43 27 "/foo/bar/Test.java" 1) ;Bug#20556 ;; mips-1 mips-2 ("TrimMask (255) in solomon.c may be indistinguishable from TrimMasks (93) in solomo.c due to truncation" 11 nil 255 "solomon.c") @@ -335,6 +337,7 @@ END-LINE, if that matched.") (col (nth 2 test)) (line (nth 3 test)) (file (nth 4 test)) + (type (nth 5 test)) end-col end-line) (if (consp col) (setq end-col (cdr col) col (car col))) @@ -342,13 +345,15 @@ END-LINE, if that matched.") (setq end-line (cdr line) line (car line))) (and (equal (compilation--loc->col loc) col) (equal (compilation--loc->line loc) line) - (or (not file) + (or (not file) (equal (caar (compilation--loc->file-struct loc)) file)) (or (null end-col) (equal (car (cadr (nth 2 (compilation--loc->file-struct loc)))) end-col)) (equal (car (nth 2 (compilation--loc->file-struct loc))) - (or end-line line))))))) + (or end-line line)) + (or (null type) + (equal type (compilation--message->type msg)))))))) (ert-deftest compile-test-error-regexps () "Test the `compilation-error-regexp-alist' regexps. commit 1c785a599affc186db1a72b93698bf47630418b9 Author: Paul Pogonyshev Date: Tue May 19 00:00:09 2015 +0300 Update Maven compilation-mode entry to distinguish warnings * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Update Maven entry to distinguish warnings (bug#20556). diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 9d36e91..a58e393 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -216,7 +216,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) ;; due to matching filenames via \\(.*?\\). This might be faster. (maven ;; Maven is a popular free software build tool for Java. - "\\([^ \n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\] " 1 2 3) + "\\(\\[WARNING\\] *\\)?\\([^ \n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\] " 2 3 4 (1)) (jikes-line "^ *\\([0-9]+\\)\\.[ \t]+.*\n +\\(<-*>\n\\*\\*\\* \\(?:Error\\|Warnin\\(g\\)\\)\\)" commit 505f2070895a75ac041c7b568063e85c1c6218d4 Author: Przemysław Wojnowski Date: Sun May 17 21:49:05 2015 +0200 * test/automated/sgml-mode-tests.el: New file. diff --git a/test/automated/sgml-mode-tests.el b/test/automated/sgml-mode-tests.el new file mode 100644 index 0000000..eeb5c7d --- /dev/null +++ b/test/automated/sgml-mode-tests.el @@ -0,0 +1,135 @@ +;;; sgml-mode-tests.el --- Tests for sgml-mode + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: Przemysław Wojnowski +;; Keywords: tests + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'sgml-mode) +(require 'ert) + +(defmacro sgml-with-content (content &rest body) + "Insert CONTENT into a temporary `sgml-mode' buffer and execute BODY on it. +The point is set to the beginning of the buffer." + `(with-temp-buffer + (sgml-mode) + (insert ,content) + (goto-char (point-min)) + ,@body)) + +;;; sgml-delete-tag + +(ert-deftest sgml-delete-tag-should-not-delete-tags-when-wrong-args () + "Don't delete tag, when number of tags to delete is not positive number." + (let ((content "

Valar Morghulis

")) + (sgml-with-content + content + (sgml-delete-tag -1) + (should (string= content (buffer-string))) + (sgml-delete-tag 0) + (should (string= content (buffer-string)))))) + +(ert-deftest sgml-delete-tag-should-delete-tags-n-times () + ;; Delete only 1, when 1 available: + (sgml-with-content + "
" + (sgml-delete-tag 1) + (should (string= "" (buffer-string)))) + ;; Delete from position on whitespaces before tag: + (sgml-with-content + " \t\n
" + (sgml-delete-tag 1) + (should (string= "" (buffer-string)))) + ;; Delete from position on tag: + (sgml-with-content + "
" + (goto-char 3) + (sgml-delete-tag 1) + (should (string= "" (buffer-string)))) + ;; Delete one by one: + (sgml-with-content + "

You know nothing, Jon Snow.

" + (sgml-delete-tag 1) + (should (string= "

You know nothing, Jon Snow.

" (buffer-string))) + (sgml-delete-tag 1) + (should (string= "You know nothing, Jon Snow." (buffer-string)))) + ;; Delete 2 at a time, when 2 available: + (sgml-with-content + "

You know nothing, Jon Snow.

" + (sgml-delete-tag 2) + (should (string= "You know nothing, Jon Snow." (buffer-string))))) + +(ert-deftest sgml-delete-tag-should-delete-unclosed-tag () + (sgml-with-content + "
  • Keep your stones connected.
" + (goto-char 5) ; position on "li" tag + (sgml-delete-tag 1) + (should (string= "
    Keep your stones connected.
" (buffer-string))))) + +(ert-deftest sgml-delete-tag-should-signal-error-for-malformed-tags () + (let ((content "

Drakaris!

")) + ;; Delete outside tag: + (sgml-with-content + content + (sgml-delete-tag 1) + (should (string= "

Drakaris!

" (buffer-string)))) + ;; Delete inner tag: + (sgml-with-content + content + (goto-char 5) ; position the inner tag + (sgml-delete-tag 1) + (should (string= "

Drakaris!

" (buffer-string)))))) + +(ert-deftest sgml-delete-tag-should-signal-error-when-deleting-too-much () + (let ((content "Drakaris!")) + ;; No tags to delete: + (sgml-with-content + "Drakaris!" + (should-error (sgml-delete-tag 1) :type 'error) + (should (string= "Drakaris!" (buffer-string)))) + ;; Trying to delete 2 tags, when only 1 available: + (sgml-with-content + content + (should-error (sgml-delete-tag 2) :type 'error) + (should (string= "Drakaris!" (buffer-string)))) + ;; Trying to delete a tag, but not on/before a tag: + (sgml-with-content + content + (goto-char 7) ; D in Drakaris + (should-error (sgml-delete-tag 1) :type 'error) + (should (string= content (buffer-string)))) + ;; Trying to delete a tag from position outside tag: + (sgml-with-content + content + (goto-char (point-max)) + (should-error (sgml-delete-tag 1) :type 'error) + (should (string= content (buffer-string)))))) + +(ert-deftest sgml-delete-tag-bug-8203-should-not-delete-apostrophe () + :expected-result :failed + (sgml-with-content + "Winter is comin'" + (sgml-delete-tag 1) + (should (string= "Winter is comin'" (buffer-string))))) + +(provide 'sgml-mode-tests) +;;; sgml-mode-tests.el ends here commit 69d24b40d2ed3cdfa7e79da4c729bddd381c8231 Author: Dmitry Gutov Date: Mon May 18 15:49:13 2015 +0300 Improve handling of the first Git revision * lisp/vc/log-view.el (log-view-toggle-entry-display): When there's no next entry, delete until the end of the buffer. (log-view-end-of-defun-1): Stop at eob. * lisp/vc/vc-annotate.el (vc-annotate-show-diff-revision-at-line-internal): Don't give up when previous-revision is nil. * lisp/vc/vc-git.el (vc-git-expanded-log-entry): End the arguments with `--' to avoid ambiguity. (vc-git-annotate-extract-revision-at-line): Exclude `^' from the returned revision string. (vc-git-annotate-time): Expect `^' before the first revision. * lisp/vc/vc-git.el (vc-git-diff): Diff against an empty tree if REV1 is nil, and REV2 is not. * lisp/vc/vc.el: Update the description of the `diff' function. diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el index 042ea13..19bbc45 100644 --- a/lisp/vc/log-view.el +++ b/lisp/vc/log-view.el @@ -404,7 +404,9 @@ This calls `log-view-expanded-log-entry-function' to do the work." (unless (and pos (log-view-inside-comment-p pos)) (error "Broken markup in `log-view-toggle-entry-display'")) (delete-region pos - (next-single-property-change pos 'log-view-comment)) + (or + (next-single-property-change pos 'log-view-comment) + (point-max))) (put-text-property beg (1+ beg) 'log-view-entry-expanded nil) (if (< opoint pos) (goto-char opoint))) @@ -469,7 +471,10 @@ It assumes that a log entry starts with a line matching ((looking-back "Show 2X entries Show unlimited entries" (line-beginning-position)) (setq looping nil) - (forward-line -1)))))) + (forward-line -1)) + ;; There are no buttons if we've turned on unlimited entries. + ((eobp) + (setq looping nil)))))) (defun log-view-end-of-defun (&optional arg) "Move forward to the next Log View entry. diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index d369c90..3a50c9b 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -582,17 +582,15 @@ the file in question, search for the log entry required and move point." (setq prev-rev (vc-call-backend vc-annotate-backend 'previous-revision (if filediff fname nil) rev)) - (if (not prev-rev) - (message "Cannot diff from any revision prior to %s" rev) - (vc-diff-internal - t - ;; The value passed here should follow what - ;; `vc-deduce-fileset' returns. - (list vc-annotate-backend - (if filediff - (list fname) - nil)) - prev-rev rev)))))) + (vc-diff-internal + t + ;; The value passed here should follow what + ;; `vc-deduce-fileset' returns. + (list vc-annotate-backend + (if filediff + (list fname) + nil)) + prev-rev rev))))) (defun vc-annotate-show-diff-revision-at-line () "Visit the diff of the revision at line from its previous revision." diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index cbf3da3..e3cd5d4 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -960,14 +960,13 @@ or BRANCH^ (where \"^\" can be repeated)." (defun vc-git-expanded-log-entry (revision) (with-temp-buffer - (apply 'vc-git-command t nil nil (list "log" revision "-1")) + (apply 'vc-git-command t nil nil (list "log" revision "-1" "--")) (goto-char (point-min)) (unless (eobp) ;; Indent the expanded log entry. (indent-region (point-min) (point-max) 2) (buffer-string)))) - (defun vc-git-region-history (file buffer lfrom lto) (vc-git-command buffer 'async nil "log" "-p" ;"--follow" ;FIXME: not supported? (format "-L%d,%d:%s" lfrom lto (file-relative-name file)))) @@ -1019,12 +1018,18 @@ or BRANCH^ (where \"^\" can be repeated)." (defun vc-git-diff (files &optional rev1 rev2 buffer async) "Get a difference report using Git between two revisions of FILES." - (let (process-file-side-effects) + (let (process-file-side-effects + (command "diff-tree")) + (if rev2 + ;; Diffing against the empty tree. + (unless rev1 (setq rev1 "4b825dc642cb6eb9a060e54bf8d69288fbee4904")) + (setq command "diff-index") + (unless rev1 (setq rev1 "HEAD"))) (if vc-git-diff-switches (apply #'vc-git-command (or buffer "*vc-diff*") (if async 'async 1) files - (if (and rev1 rev2) "diff-tree" "diff-index") + command "--exit-code" (append (vc-switches 'git 'diff) (list "-p" (or rev1 "HEAD") rev2 "--"))) @@ -1033,7 +1038,7 @@ or BRANCH^ (where \"^\" can be repeated)." (concat "diff " (mapconcat 'identity (vc-switches nil 'diff) " ")) - (or rev1 "HEAD") rev2 "--")))) + rev1 rev2 "--")))) (defun vc-git-revision-table (_files) ;; What about `files'?!? --Stef @@ -1061,7 +1066,7 @@ or BRANCH^ (where \"^\" can be repeated)." (declare-function vc-annotate-convert-time "vc-annotate" (&optional time)) (defun vc-git-annotate-time () - (and (re-search-forward "^[0-9a-f]+[^()]+(.*?\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\(:?\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\\)? *[0-9]+) " nil t) + (and (re-search-forward "^[0-9a-f^]+[^()]+(.*?\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\(:?\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\\)? *[0-9]+) " nil t) (vc-annotate-convert-time (apply #'encode-time (mapcar (lambda (match) (if (match-beginning match) @@ -1072,7 +1077,7 @@ or BRANCH^ (where \"^\" can be repeated)." (defun vc-git-annotate-extract-revision-at-line () (save-excursion (beginning-of-line) - (when (looking-at "\\([0-9a-f^][0-9a-f]+\\) \\(\\([^(]+\\) \\)?") + (when (looking-at "\\^?\\([0-9a-f]+\\) \\(\\([^(]+\\) \\)?") (let ((revision (match-string-no-properties 1))) (if (match-beginning 2) (let ((fname (match-string-no-properties 3))) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index d5d0abe..1bd04e1 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -367,7 +367,8 @@ ;; BUFFER is nil. If ASYNC is non-nil, run asynchronously. If REV1 ;; and REV2 are non-nil, report differences from REV1 to REV2. If ;; REV1 is nil, use the working revision (as found in the -;; repository) as the older revision; if REV2 is nil, use the +;; repository) as the older revision if REV2 is nil as well; +;; otherwise, diff against an empty tree. If REV2 is nil, use the ;; current working-copy contents as the newer revision. This ;; function should pass the value of (vc-switches BACKEND 'diff) to ;; the backend command. It should return a status of either 0 (no