From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] Strip text properties from string code block arguments Date: Sun, 12 Jan 2014 09:35:27 -0700 Message-ID: <87r48dnoog.fsf@gmail.com> References: <52CC38B1.7060107@gmail.com> <87wqia1lmi.fsf@bzg.ath.cx> <52CD8A77.1060908@gmail.com> <871u0g3n5d.fsf@Rainer.invalid> <87zjn1juha.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2O2O-0005bs-UJ for emacs-orgmode@gnu.org; Sun, 12 Jan 2014 11:37:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2O2K-0006TR-Rm for emacs-orgmode@gnu.org; Sun, 12 Jan 2014 11:37:24 -0500 In-Reply-To: <87zjn1juha.fsf@bzg.ath.cx> (Bastien's message of "Sun, 12 Jan 2014 12:43:45 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Achim Gratz , emacs-orgmode@gnu.org Bastien writes: > Achim Gratz 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