[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set-text-properties, remove-set-properties, add-text-properties: 1)

From: Kevin Rodgers
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
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

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
    > 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]