On Monday 14 February 2005 11:38, Angus Leeming wrote: > Jose' Matos wrote: > > This patch fixes bug 1816. > > > > I don't understand why the pextra_widthp argument goes in a separate > > line, but if it happens then this patch takes that into account. > > > > The patch seems clean, and safe, so I will apply it it. Any objection? > > No objection, but a couple of suggestions.
Thanks for the tips. > It might make sense to protect the regex with a '^', meaning "if the line > starts with "\\pextra_width" ? > > +pextra_widthp = re.compile(r"^\s*\\pextra_widthp\s+\S*") It makes sense, but I don't care. :-) Any pextra_widthp must be dealt somewhere, and this is the only right place where it is processed and eliminated. So if for some reason it appears in the next line then bring it back. > Also, don't you want to guarantee that the length itself exists? > '\S*' will match any number of non-whitespace characters (including none > at all). That is not a problem. If you look into the other regular expression that analyzes the merged line, there is there a conditional regular expression to deal with this case. But then you are right, the "\s+\S*" substring is superfluous. Following your suggestion I will change the regular expression to pextra_widthp = re.compile(r"\\pextra_widthp") since this is really what I am testing for. Thanks. -- José Abílio