[Top][All Lists]

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

Re: buffer-substring vs. buffer-substring-no-properties

From: Juanma Barranquero
Subject: Re: buffer-substring vs. buffer-substring-no-properties
Date: Thu, 15 Nov 2001 09:25:55 +0100

On 14 Nov 2001 21:22:36 -0800, Kevin Layer <address@hidden> wrote:

> Also, note I couldn't get copy-sequence to remove properties.  It
> always preserves them for me:

Can you remove properties with that?

(defun substring-no-properties (string from &optional to)
  "Return a substring of STRING, without text properties.
The substring starts at index FROM and ends before TO.
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 from to)))
    (set-text-properties 0 (length str) nil str)


reply via email to

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