Has anyone given any thought to fixing the replace-match
incompatibility between GNU Emacs and XEmacs? The optional fifth
argument is different:
* GNU Emacs 20.4:
The optional fifth argument SUBEXP specifies a subexpression of the match.
It says to replace just that subexpression instead of the whole match.
This is useful only after a regular expression search or match
since only regular expressions have distinguished subexpressions.
* XEmacs:
When fourth argument is a string, fifth argument STRBUFFER specifies
the buffer to be used for syntax-table and case-table lookup and
defaults to the current buffer. (When fourth argument is not a string,
the buffer that the match occurred in has automatically been remembered
and you do not need to specify it.
I've been trying to port diff-mode.el to XEmacs, and it's difficult, as
the subexpression-replacement capability of GNU Emacs is used
extensively. I could managle diff-mode.el to work, but it would require
a lot of effort, and I'm wondering if we can somehow fix replace-match,
instead.
The best solution is would be to shift the XEmacs-specific option
over once place (make it the sixth option), but I don't know how much
XEmacs code would have to be changed (especially, privately-written
code).
An ugly, kludgy solution would be to test the type of the fifth
parameter; if it's a number, treat it as a subexpression index,
otherwise treat it as a buffer. However, this means that you can't
specify a buffer to use for syntax and case tables if a subexpression is
specified.
Comments, anyone?
--
Darryl Okahata
darrylo(a)sr.hp.com
DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Hewlett-Packard, or of the
little green men that have been following him all day.
Show replies by date