[Top][All Lists]

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

Re: Erroneous changelog entry?

From: Juanma Barranquero
Subject: Re: Erroneous changelog entry?
Date: Thu, 24 Jan 2002 10:09:02 +0100

On Wed, 23 Jan 2002 20:44:25 -0700 (MST), Richard Stallman <address@hidden> 

> Sorry, I forgot to check in subr.el.

You've added

(defun copy-without-properties (string)
  "Return a copy of STRING with no text properties."
  (setq string (concat string))
  (set-text-properties 0 (length string) nil string)

During the 21.1 pretest I proposed something similar to:

(defun substring-no-properties (string &optional from to)
  "Return a substring of STRING, with no text properties.
The substring starts at index FROM and ends before TO.
FROM defaults to the beginning of the STRING.
TO may be nil or omitted; then the substring runs to the end of STRING.
If FROM or TO is negative, it counts from the end."
  (let ((str (substring string (or from 0) to)))
    (set-text-properties 0 (length str) nil str)

which is somewhat more general.

OTOH, there's already a buffer-substring and a
buffer-substring-no-properties, so even if you don't like the function I
propose, I suggest string-no-properties as a more consistent name for


reply via email to

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