Subject: With --eval, errors in string-match-p do not produce backtraces (but errors in string-match do?!)

From: Clément Pit--Claudel <[email-masked]>
Date: Fri, 5 Aug 2016 21:56:56 -0400

Hey bug-gnu-emacs,

Is the following a bug?

    # No backtrace?!
    $ emacs -Q  --batch --eval '(setq debug-on-error t)' --eval '(string-match-p nil "A")'
    Wrong type argument: stringp, nil

    # Yes backtrace?!?
    $ emacs -Q  --batch --eval '(setq debug-on-error t)' --eval '(string-match nil "A")'
    Debugger entered--Lisp error: (wrong-type-argument stringp nil)
      string-match(nil "A")
      eval((string-match nil "A"))
      ...

This isn't new, but it behaved differently in Emacs 24.5:

    $ emacs-24.5 -Q  --batch --eval '(setq debug-on-error t)' --eval '(string-match nil "A")'
    Debugger entered--Lisp error: (wrong-type-argument stringp nil)
      string-match(nil "A")
      eval((string-match nil "A"))
      ...

    $ emacs-24.5 -Q  --batch --eval '(setq debug-on-error t)' --eval '(string-match-p nil "A")'
    Args out of range: 0

Clément.

In GNU Emacs 25.1.50.7 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2016-07-20 built on clem-w50-mint
Repository revision: a1a0c208e3e895a6ea0942e8e5c4077faf12c7ad
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
System Description:	Linux Mint 18 Sarah