Le 8 févr. 2012 à 11:54, Akim Demaille a écrit : > Le 2 févr. 2012 à 16:52, Paul Eggert a écrit : > >> On 02/02/2012 02:49 AM, Akim Demaille wrote: >>> - submit changes to gnulib's quote so that the choice of the default >>> style is left to the actual user of gnulib, and stick to >>> gnulib's quote in Bison. >> >> Sounds good to me; how would that work? > > Hi Paul! > > I'm not sure what the best way to do it yet.
My problem is that there are several default styles used in quote*. There is DEFAULT_QUOTING_STYLE which does not seem to be used (but maybe its purpose is to tell the users of quotearg.h that 0 corresponds to literal_quoting_style?). There is locale_quote_style which is hard coded in quote, and also there is the default_quoting_style that can be modified by the user. So I don't know if you want quote to use the default style (0), or to have its own style. And actually, by style I mean options. The proposal below exposes a new quote_quoting_options, in addition to the default_quoting_options (0), but it is equal to it by default. Because quoting_options are very handy, the exposed API seemed to be too weak, as there is no nice quotearg_* function that takes a quoting_option. So I exposed quotearg_n_options. I did the patch this way to try to preserve some backward compatibility with people who want quote to use locale_quoting_style by default, but at the cost of changing the default style to using it. Is this good enough? My concern here is that I don't think it is up to gnulib to decide what style should be used in the program, and since some gnulib modules use quote, in practice it means that gnulib does make decisions on behalf of the host project. If you have better ideas, I'll take them :) Otherwise, the easiest might be to change the bison wrapper in the tests suite to change the quotes in the output messages :(
0001-quote-allow-the-user-to-override-the-style.patch
Description: Binary data
0001-tests-be-robust-to-quote-style.patch
Description: Binary data
