Subject: bug#40109: 27.0.90; simple-delete-trailing-whitespace--bug-21766 fails if Git isn't installed

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 28 Jan 2021 09:45:55 +0100

Philipp Stephani <[email-masked]> writes:

> Make sure that git isn't installed, e.g. by running 'apt remove git' on
> a Debian system.  Then, in the Emacs source test directory:
>
> $ make lisp/simple-tests SELECTOR=simple-delete-trailing-whitespace--bug-21766
> make[1]: Entering directory '/emacs/test'
>   GEN      lisp/simple-tests.log
> Running 1 tests (2020-03-17 18:07:31+0100, selector `simple-delete-trailing-whitespace--bug-21766')
> Test simple-delete-trailing-whitespace--bug-21766 backtrace:
>   call-process("git" nil (t nil) nil "rev-parse" "--abbrev-ref" "HEAD"

I'm unable to reproduce the error with the current emacs-27 branch (or
on the trunk).  I "apt remove git" first, and then:

larsi@xo:~/src/emacs/emacs-27/test$ make lisp/simple-tests SELECTOR=simple-delete-trailing-whitespace--bug-21766
make[1]: Entering directory '/home/larsi/src/emacs/emacs-27/test'
  ELC      lisp/simple-tests.elc
  GEN      lisp/simple-tests.log
Running 1 tests (2021-01-28 09:43:24+0100, selector `simple-delete-trailing-whitespace--bug-21766')
   passed  1/1  simple-delete-trailing-whitespace--bug-21766 (0.089470 sec)

Ran 1 tests, 1 results as expected, 0 unexpected (2021-01-28 09:43:24+0100, 0.089821 sec)

make[1]: Leaving directory '/home/larsi/src/emacs/emacs-27/test'

[...]

> Ah, the problem is that with-demoted-errors uses
> condition-case-unless-debug.  More minimal example:
>
> $ emacs -Q -batch -eval '(let ((debug-on-error t)) (ignore-errors
> (with-demoted-errors "%S" (error "foo"))))'
> Debugger entered--Lisp error: (error "foo")
> […]
>
> I think this behavior is very confusing. Both version.el and
> trampver.el try to do the right thing, but that breaks in such a
> situation.

It is somewhat confusing, yes, but it's also pretty convenient in some
circumstances.

In any case, are you still seeing the reported test problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no