[patch] textbox/naughy: behave nicer when incorrect markup is received

2010-07-16 Thread Gregor Best
Hi people, the attached two patches fix a little issue some people had with naughty. When a notification with broken markup was received, naughty only displayed a little empty box and issued a warning about broken pango markup on stderr. The first patch adds a new read-only textbox property

Re: [patch] textbox/naughy: behave nicer when incorrect markup is received

2010-07-16 Thread Uli Schlachter
Am 16.07.2010 12:34, Gregor Best wrote: Hi people, the attached two patches fix a little issue some people had with naughty. When a notification with broken markup was received, naughty only displayed a little empty box and issued a warning about broken pango markup on stderr. The first patch

Re: [patch] textbox/naughy: behave nicer when incorrect markup is received

2010-07-16 Thread Uli Schlachter
Am 16.07.2010 13:52, Uli Schlachter wrote: textbox.text = foo if textbox.text == do print(foo is invalid) end Anyone wants to test if this already works? If yes, we can make that expected behavior and (ab)use it for this. A quick google for the documentation of pango_parse_markup() found

Re: [patch] textbox/naughy: behave nicer when incorrect markup is received

2010-07-16 Thread Julien Danjou
On Fri, Jul 16 2010, Uli Schlachter wrote: (Also, according to the docs, print(textbox.text) will return the text with all attributes stripped. Does this qualify as a bug?) Yes. -- Julien Danjou // ᐰ jul...@danjou.info http://julien.danjou.info pgpSoWYhwKpl6.pgp Description: PGP

Re: [patch] textbox/naughy: behave nicer when incorrect markup is received

2010-07-16 Thread Julien Danjou
On Fri, Jul 16 2010, Uli Schlachter wrote: I don't really like this approach, but I guess it works... Neither do I. I think we should raise a Lua error if `textbox.text = foo' cannot be parsed by Pango. Looks possible, doesn't it? -- Julien Danjou // ᐰ jul...@danjou.info

Re: [patch] textbox/naughy: behave nicer when incorrect markup is received

2010-07-16 Thread Uli Schlachter
Am 16.07.2010 13:59, Julien Danjou wrote: On Fri, Jul 16 2010, Uli Schlachter wrote: I don't really like this approach, but I guess it works... Neither do I. I think we should raise a Lua error if `textbox.text = foo' cannot be parsed by Pango. Looks possible, doesn't it? +1 That might

Re: [patch] textbox/naughy: behave nicer when incorrect markup is received

2010-07-16 Thread Uli Schlachter
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Am 16.07.2010 13:59, Julien Danjou wrote: On Fri, Jul 16 2010, Uli Schlachter wrote: I don't really like this approach, but I guess it works... Neither do I. I think we should raise a Lua error if `textbox.text = foo' cannot be parsed by