GNU bug report logs -
#24882
25.1; edebug-defun fails when lparen in string at BOL
Previous Next
Reported by: David Bremner <david <at> tethera.net>
Date: Sat, 5 Nov 2016 13:34:01 UTC
Severity: normal
Tags: fixed
Found in version 25.1
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 24882 <at> debbugs.gnu.org (full text, mbox):
John Mastro <john.b.mastro <at> gmail.com> writes:
> David Bremner <david <at> tethera.net> 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
Indeed this heuristic appears to be intentional, justified by an apeal
to efficiency. The Emacs manual uses an example very similar to
`edebug-fail' above as a "what not to do" case:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Left-Margin-Paren.html
David, if you agree with this rationale, mind closing the bug?
This bug report was last modified 7 years and 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.