bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Peter S Galbraith
Subject: Re: buffer-substring vs. buffer-substring-no-properties
Date: Wed, 14 Nov 2001 12:41:50 -0500

Per Abrahamsen wrote:

> layer@--you-know-what-to-remove--.franz.com (Kevin Layer) writes:
> 
> > Given that I have lots and lots of calls to buffer-substring that I
> > don't want to change to buffer-substring-no-properties,
> 
> Why not?

Earlier he said:

: (I can't just change them to buffer-substring-no-properties because I
: support xemacs, too.)

Except that 'buffer-substring-no-properties' is in xemacs21 !

If it's not in xemacs20 (I can't check for you) then define it in your
code:

(or (fboundp 'buffer-substring-no-properties)
    (defun buffer-substring-no-properties (beg end)
      "Return the text from BEG to END, without text properties, as a string."
      (let ((string (buffer-substring beg end)))
        (set-text-properties 0 (length string) nil string)
        string)))

By coincidence, I recall cutting this snippet out from an early version of
Per's custom.el.

Peter




reply via email to

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