From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: set-text-properties, remove-set-properties, add-text-properties: 1) doc string 2) return value Date: Thu, 29 Dec 2005 12:41:14 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135885343 7526 80.91.229.2 (29 Dec 2005 19:42:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Dec 2005 19:42:23 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 29 20:42:21 2005 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 1Es3fF-0006gz-13 for ged-emacs-devel@m.gmane.org; Thu, 29 Dec 2005 20:42:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Es3gb-0000WF-VO for ged-emacs-devel@m.gmane.org; Thu, 29 Dec 2005 14:43:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Es3gS-0000Vx-Ml for emacs-devel@gnu.org; Thu, 29 Dec 2005 14:43:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Es3gR-0000Vd-VK for emacs-devel@gnu.org; Thu, 29 Dec 2005 14:43:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Es3gR-0000Va-Qt for emacs-devel@gnu.org; Thu, 29 Dec 2005 14:43:31 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Es3gq-0005GB-9Q for emacs-devel@gnu.org; Thu, 29 Dec 2005 14:43:56 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Es3ef-0006XZ-Mf for emacs-devel@gnu.org; Thu, 29 Dec 2005 20:41:41 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Dec 2005 20:41:41 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Dec 2005 20:41:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 26 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: 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:48509 Archived-At: Drew Adams wrote: > >> 2. Wouldn't it be more useful for set-text-properties, > >> remove-set-properties, and add-text-properties to return the modified > >> OBJECT (or nil if no modification occurred)? In case OBJECT > >> is a buffer (or nil), the modified buffer substring could be > returned. > > > > Why would that be useful? > > Even if it was useful in some cases, it would be extremely > wasteful in general. > > I believe you, but could you explain why, so I can learn? I don't know much > about how C interfaces with Lisp. Is it because a new OBJECT would in fact > need to be created? I was thinking that the operation could just return (the > equivalent of) a pointer to the original OBJECT. IOW, where is the waste? > > I guess, in the case of a buffer, a new string would need to be created. Is > that what you meant, or is there also a problem when the OBJECT (string) > argument is explicitly supplied? Exactly. I think it should just return OBJECT, whether that is a buffer (or the current buffer, when nil) or a string. -- Kevin Rodgers