From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Is there something between `prin1-to-string' and `princ'? Date: Wed, 25 Sep 2013 15:23:07 +0200 Message-ID: <8738ott4qs.fsf@gmail.com> References: <87ob7h125c.fsf@informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380115602 5044 80.91.229.3 (25 Sep 2013 13:26:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Sep 2013 13:26:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 25 15:26:45 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1VOp76-0001XD-O1 for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Sep 2013 15:26:44 +0200 Original-Received: from localhost ([::1]:52740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOp76-0001FY-AT for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Sep 2013 09:26:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOp3x-000627-Ft for help-gnu-emacs@gnu.org; Wed, 25 Sep 2013 09:23:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOp3r-00016N-KQ for help-gnu-emacs@gnu.org; Wed, 25 Sep 2013 09:23:29 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:36963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOp3r-000162-Ek for help-gnu-emacs@gnu.org; Wed, 25 Sep 2013 09:23:23 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VOp3q-0007MN-BX for help-gnu-emacs@gnu.org; Wed, 25 Sep 2013 15:23:22 +0200 Original-Received: from g231232115.adsl.alicedsl.de ([92.231.232.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Sep 2013 15:23:22 +0200 Original-Received: from tjolitz by g231232115.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Sep 2013 15:23:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231232115.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:PQq9AGTGJNC5SMJLYZvJrsPnBdk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93566 Archived-At: "Pascal J. Bourguignon" writes: > Thorsten Jolitz writes: > >> Hi List, >> or even better >> >> ,----------------------------------- >> | ... :CATEGORY "tmp2" :title ("C2") ... >> `----------------------------------- >> >> but there seems to be no print command or configuration option that >> gives me strings quoted, but text without properties at the same time? > > I'm afraid, you'll have to strip the properties before printing. > cf.: substring-no-properties > > (defun sexp-remove-string-properties (sexp) > (cond > ((stringp sexp) (substring-no-properties sexp)) > ((atom sexp) sexp) > (t (cons (sexp-remove-string-properties (car sexp)) > (sexp-remove-string-properties (cdr sexp)))))) > > (prin1-to-string > (sexp-remove-string-properties > '(:category "tmp2" :title (#("C2 " 0 3 (:parent nil)))))) > --> "(:category \"tmp2\" :title (\"C2 \"))" Exactly what I need, thank you! -- cheers, Thorsten