[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] Strip text properties from string code block arguments
From: |
Eric Schulte |
Subject: |
Re: [O] [PATCH] Strip text properties from string code block arguments |
Date: |
Sun, 12 Jan 2014 09:35:27 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Bastien <address@hidden> writes:
> Achim Gratz <address@hidden> writes:
>
>> Daniel Gerber writes:
>>> Not quite. I thought %S was not a typo because it escapes characters
>>> more nicely. E.g. with %s the buffer should contain \"\"\" to mean """
>>> in python.
>>
>> If that's the intention, then %S is arguably a latent bug, since the
>> escaping it applies can only by accident be compatible with the targeted
>> language. I don't know if something like shell-quote arguments exists
>> for arbitrary programming languages.
>
> Maybe we should simply use %s (downcase) and escape quotes manually.
> If feels less random to me.
>
> What do you think?
I think using %S with strip-properties will address the great majority
of cases, and is certainly a better interim solution than the current
use of %s with no escaping. I find string escaping is *normally* very
consistent between languages.
Then if someone wants to read the python spec, and implement custom
string escaping that would be useful, but it isn't immediately required.
Alternately maybe python's long-form """ strings should be used in all
cases?
--
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D