Menu

#7 py-beginning-of-def-or-class looks inside strings

open
nobody
None
5
2003-11-01
2003-11-01
No

[I mistakenly submitted this to the python project first as bug 830374. Sorry...]

Using python-mode.el 4.6 and gnu emacs 21.1.

To demonstrate this problem:

1. Open the attached file with emacs.

2. Position point at the "#" on the last line.

3. Type `M-C-a', py-beginning-of-def-or-class.

Point will now be inside the docstring for class x.

py-b-o-d-o-c uses regexps to look backwards for def or class lines. When it finds a candidate line, should it maybe use partial-parse-sexp to decide if it's in a string or not?

Discussion

  • Anonymous

    Anonymous - 2003-11-01

    file to demonstrate bug

     
  • Anonymous

    Anonymous - 2003-11-01

    Logged In: YES
    user_id=895011

    Attach a patch fixing the problem.
    The patch also fixes an incorrect call to py-beginning-o-d-o-c in py-end-o-d-o-c.

     
  • Anonymous

    Anonymous - 2003-11-01

    patch for thsi bug

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.