emacs-devel
[Top][All Lists]
Advanced

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

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


From: Drew Adams
Subject: RE: set-text-properties, remove-set-properties, add-text-properties: 1) doc string 2) return value
Date: Wed, 28 Dec 2005 20:15:02 -0800

    > 1. The set-text-properties doc string should say what the
    >    function returns.

    Why?

I should have said, "Does the value of set-text-properties change, or is it
always the same? If it changes, then the value is significant and it should
be documented."

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

Why is it useful for `push' and `pop' to return values that correspond to
the updated list and the removed car?

It would be convenient to say

 (setq foo (or (remove-text-properties start end props toto) ...))

Of course, you can always write

 (setq foo (if (remove-text-properties start end props toto)
               toto
              ...))

As for `push' and `pop' and many other "functions", returning a richer value
offers only a slight convenience, but why not?





reply via email to

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