From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: prin1-to-string noescape parameter Date: Fri, 31 Oct 2014 17:15:45 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1414781392 24927 80.91.229.3 (31 Oct 2014 18:49:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 18:49:52 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 31 19:49:48 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XkHGd-0001AX-Om for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2014 19:49:47 +0100 Original-Received: from localhost ([::1]:41143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkHGc-0005a3-Tt for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2014 14:49:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkErc-0001wY-8m for emacs-devel@gnu.org; Fri, 31 Oct 2014 12:15:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkErb-0000w0-Jd for emacs-devel@gnu.org; Fri, 31 Oct 2014 12:15:48 -0400 Original-Received: from mail-qc0-x236.google.com ([2607:f8b0:400d:c01::236]:51090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkErb-0000vO-87 for emacs-devel@gnu.org; Fri, 31 Oct 2014 12:15:47 -0400 Original-Received: by mail-qc0-f182.google.com with SMTP id m20so6051496qcx.41 for ; Fri, 31 Oct 2014 09:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=yValAmQUd7JwAjAjMUP9whjJU3CGCzjwxD2htyfFoz8=; b=auvXDoKJD9XeoA8z9DN9mpAtC2dVg3SVBGEfXD+Pp/msyDGoDYKRetAeD/7dqT7UTM xBnleA31eJzSTNg3jZdqZghvVfL0Aq2WhNDcP5aiNKaFPgRFGza7OkhoyGJW+Ma3DyZb 5tcWcmtDZVpBcVV/NFD03qTwSVoXQ7Hq2qp+a/iz7AmeqWlLKJ2z4tBUj/4cLkNHypWu VfGd0EAU5u625sJz9Md/enR3CqmAHwg86R/O+ESOPAU3O8CffZix2XRtD5Z4J/9deTMr th6XiEWVQt6TcXVIu3FL8oqEiy8x4X41mvoKEvDI+8dGDJML1bpMURexUfiNElonF6aQ vrtA== X-Received: by 10.140.39.11 with SMTP id u11mr36872661qgu.32.1414772145764; Fri, 31 Oct 2014 09:15:45 -0700 (PDT) Original-Received: by 10.140.101.215 with HTTP; Fri, 31 Oct 2014 09:15:45 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:176134 Archived-At: Hi all, I'm trying to write some code that formats/restructures Elisp source files (a la Paredit). But instead of using text manipulation, I want to read the object in, manipulate it and print it out. One issue that I'm facing is: (prin1-to-string (read "(foo.bar baz?)")) => "(foo\\.bar baz\\?)" I tried to overcome this with: (prin1-to-string (read "(foo.bar baz?)") t) => "(foo.bar baz?)" But another problem resurfaces instead: (prin1-to-string (read "(foo \"bar\")") t) => "(foo bar)" Even worse: (prin1-to-string (read "(foo \";bar\")") t) => "(foo ;bar)" I think a fix to the issue would be to split the `escapeflag' parameter of the `print_object' C function into two parts. Currently a single bool flag decides if to escape strings or not, and if to escape certain characters or not. Any other suggestions to overcome this issue are welcome as well, so far I've tried setting `print-quoted', `print-escape-multibyte', and `print-escape-nonascii'. regards, Oleh