From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Roehler Newsgroups: gmane.emacs.devel Subject: Re: Unmentioned "stringify" aspect in docu buffer-substring-no-properties Date: Fri, 23 Jun 2006 08:38:43 +0200 Message-ID: <449B8C73.8060300@easy-emacs.de> References: <449AFC62.8030404@online.de> <85ejxhkk9t.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1151047180 21209 80.91.229.2 (23 Jun 2006 07:19:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Jun 2006 07:19:40 +0000 (UTC) Cc: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 23 09:19:36 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ftfwz-0006xy-7c for ged-emacs-devel@m.gmane.org; Fri, 23 Jun 2006 09:19:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ftfwy-0000Wp-Kw for ged-emacs-devel@m.gmane.org; Fri, 23 Jun 2006 03:19:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FtfBl-0007Mi-UG for emacs-devel@gnu.org; Fri, 23 Jun 2006 02:30:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FtfBj-0007Li-Q7 for emacs-devel@gnu.org; Fri, 23 Jun 2006 02:30:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FtfBj-0007LZ-IQ for emacs-devel@gnu.org; Fri, 23 Jun 2006 02:30:43 -0400 Original-Received: from [212.227.126.177] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FtfMq-0001qz-4m; Fri, 23 Jun 2006 02:42:12 -0400 Original-Received: from [84.190.131.186] (helo=[192.168.178.23]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis), id 0MKxQS-1FtfBS0aNr-0008T9; Fri, 23 Jun 2006 08:30:40 +0200 User-Agent: Thunderbird 1.5.0.4 (X11/20060516) Original-To: emacs-devel In-Reply-To: <85ejxhkk9t.fsf@lola.goethe.zz> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:62d13292e0fce6aaed56aaadcb96352d X-Mailman-Approved-At: Fri, 23 Jun 2006 03:18:37 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56106 Archived-At: David Kastrup schrieb: > Andreas Roehler writes: > > >> Richard Stallman schrieb: >> >>> Would people please check those files for accuracy one more time? >>> They are the files listed in FOR-RELEASE with just one name. >>> >>> text.texi >>> >> IMO: >> Unmentioned "stringify" aspect in >> `buffer-substring-no-properties'; also concerns >> `buffer-substring' >> >> AFAIU there are two different meanings of string, which >> are mixed up in naming and function of >> >> `buffer-substring-no-properties': >> >> 1) it takes a portion of the buffer, but not necessary >> of a type `string', so `substring' might mislead >> here (nonetheless, would not ask for changing this >> name for compatiblity reasons) >> > > Uh what? Of course the type is `string'. > > >> 2) it stringifies these portion, changes the type of it >> > > It does nothing of the sort. > > >> ;;; check the following examples in a buffer starting >> with it, in order to have the Start-End-Entries >> set as given >> >> (defun foo () >> " " >> (interactive "*") >> ) >> >> (buffer-substring-no-properties 34 37)"e \"" >> > > There is no "stringification" done by buffer-substring-no-properties. > The Lisp reader prints the result of the evaluation in string syntax, > that is all. > > >> It happened to be a discussion in de.comp.editoren, >> concerning a stringify function >> >> The (still disputed) result exploits just the >> mentioned quality. >> > > It doesn't. > > >> (defun region2string (start end) >> "Make a string from the chars of a region. >> Doublequotes inside will be quoted therefor. >> >> baz --> \"baz\" >> >> baz \"bar\" --> \"baz \\\"bar\\\"\"" >> (interactive "r*") >> (goto-char end) >> (prin1 (buffer-substring-no-properties start end) (current-buffer)) >> (delete-region start end)) >> > > The string quotes get added by prin1, not by > buffer-substring-no-properties. You should really try reading up some > basics in the Emacs Lisp tutorial. > > Please look at the example given above (setq baz (buffer-substring-no-properties 34 37)) baz"e \"" there was no prin1 between, AFAIS. The behavior of prin1 BTW was not the item.