Subject: bug#24882: 25.1; edebug-defun fails when lparen in string at BOL

From: John Mastro <[email-masked]>
Date: Sat, 5 Nov 2016 17:05:17 -0700

David Bremner <[email-masked]> wrote:
> 1) save the following definitions into a file edebug-fail.el
>
> (defun edebug-fail ()
>   "blah"
>   (glub "foo
> (bar)"))
>
> (defun edebug-success ()
>   "blah"
>   (glub "foo (bar)"))
>
> 2) emacs -Q edebug-defun.el
>
> 3) place the point after the defun for edebug fail
>
> 4) run M-x edebug-defun ; observe the next defun, for edebug-success is
> evaled.
>
> 5) Add a space before (bar), repeat step 4. Observe the correct function
> definition is evaluated

This is caused by the heuristic that an open paren in column zero
indicates the beginning of a defun, via end-of-defun. If you set
open-paren-in-column-0-is-defun-start to nil the recipe will work as
expected (i.e. edebug-defun will evaluate edebug-fail).

Not sure if there's anything that can be reasonably done to improve this
(other than changing the default for o-p-i-c-0-i-d-s).

        John