Re: Any want to test buffer-substring patches?

Hannu Koivisto <[email protected]>
Newsgroups gmane.lisp.ilisp.devel
Message-ID <[email protected]>
Kevin Rosenberg <[email protected]> writes:

> That version looks fairly xemacs-specific. I don't know if that'd work
> in old versions of emacs that didn't have buffer-substring-no-properties.

Right, you cannot know that but you don't really need to either.
The rule #1: you can write 100% compatibility code that reaches
only the versions you have access to, otherwise you may end up
telling a lie which breaks some other application.  It's better to
break someone's (X)Emacs than try to guess too far.

In other words, if your concern is mainly XEmacs 20.4 (I suppose
Emacs is not of concern since no one in their right minds would use
the latest ILISP but Emacs earlier than 19.34) and you know it has
set-text-properties, then you could write this:

(cond ((fboundp 'buffer-substring-no-properties))
      ((fboundp 'set-text-properties)
       (defun buffer-substring-no-properties (start end)
         the-definition-aadvark-lama-quoted))
      (t (error "Your Emacs lacks buffer-substring-no-properties, please extend ilcompat.el(c).")))

> I'm not aware of any versions that don't have that function. I just
> don't want to break anyone's old (x)emacs editors.

You can try to avoid that to some extent (depending on what Emacs
versions you have access to and how much effort you want to put
into checking compatibility) but you cannot avoid that 100% (or
probably even, say, 50%).  This, of course, does not mean that we
need to actively prevent ILISP from working in such an old Emacs.
What it means is that the user of such old Emacs must provide
support for his Emacs to one of those compatibility files.  If he
doesn't want to/can't do that, then he can use an older version of
ILISP (or some nice ILISP developer may write the support with his
help).

IMHO.

-- 
Hannu
Please don't send copies of list mail


-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.