GNU bug report logs -
#45897
27.1; python mode font-lock confused by string concatenation
Previous Next
Reported by: Tom Tromey <tom <at> tromey.com>
Date: Fri, 15 Jan 2021 18:05:02 UTC
Severity: normal
Found in version 27.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Jakub Ječmínek wrote:
> kobarity <kobarity <at> gmail.com> writes:
>
> > Thank you for the patch. I tried it and confirmed that the example
> > shown by Tom Tromey is fixed.
> >
> > I think ppss and line-ppss would be the same in this example. Can you
> > give an example of a case where ppss and line-ppss are different?
>
> Well, it would be different in case like this:
>
> #+BEGIN_SRC python
> " # <- forgotten quote
> a = "abc"""
> #+END_SRC
>
> `ppss' would in the context of `python-syntax-stringify' evaluate to
> '(0 nil 8 nil nil nil 0 nil nil nil nil), while `line-ppss' to
> '(0 nil 5 34 nil nil 0 nil 7 nil nil). Note the 3rd and 8th
> element. Here's the snippet to test it:
>
> #+BEGIN_SRC emacs-lisp
> (with-temp-buffer
> (insert "\"
> a = \"abc\"\"\"")
> (backward-char 3)
> (syntax-ppss)
> (parse-partial-sexp (line-beginning-position) (point)))
> #+END_SRC
>
> I was thinking that we want to consider only cases where the quote is on
> the same line but I guess I wanted to solve a problem we don't
> have. I've revised the patch to be more simple, please see attached.
>
> > I noticed an error in the commit-msg hook when applying the patch.
> > CONTRIBUTE states the following:
> >
> > - Lines in ChangeLog entries should preferably be not longer than 63
> > characters, and must not exceed 78 characters, unless they consist
> > of a single word of at most 140 characters; this 78/140 limit is
> > enforced by a commit hook.
>
> Thanks, fixed.
>
> > Also, the indentation still looks wrong to me. It might be better to
> > attach the patch instead of pasting it into the body of the mail.
>
> Please see attached.
>
> > Attached is a patch to add an ERT that identifies this issue. Please
> > add it to your patch if you like.
>
> Thanks, I've added it to my patch and added 'Co-authored-by:' to commit
> description.
Thank you. The revised patch looks good to me.
This bug report was last modified 1 year and 173 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.