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: Kevin Layer
Subject: Re: buffer-substring vs. buffer-substring-no-properties
Date: 14 Nov 2001 09:54:40 -0800
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

GalbraithP@dfo-mpo.gc.ca (Peter S Galbraith) writes:

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

Excellent.  Any idea what version of emacs and xemacs started
supporting set-text-properties?

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




reply via email to

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