Subject: bug#20707: [PROPOSED PATCH] Use curved quoting in C-generated errors

From: Alan Mackenzie <[email-masked]>
Date: Tue, 2 Jun 2015 20:44:23 +0000

Hello again, Paul.

On Tue, Jun 02, 2015 at 05:07:24PM +0000, Alan Mackenzie wrote:

> As I've suggested before, why don't you make --with-curly-quotes a
> configuration option?

All you would need (at least, in the C files) would be a macro
declaration like this:

    #ifdef WITH_CURLY_QUOTES
    #define Q(s) "?" #s "?"
    #else
    #define Q(s) "`" #s "'"
    #endif

, and a typical use of Q would look like this:

    error ("Buffer name " Q(%s) " is in use", SDATA (name));

.  The preprocessor produces either this:

    error ("Buffer name " "`" "%s" "'" " is in use", SDATA (name));

, or this

    error ("Buffer name " "?" "%s" "?" " is in use", SDATA (name));

, depending on whether WITH_CURLY_QUOTES is defined.

-- 
Alan Mackenzie (Nuremberg, Germany).