Hi Keita, Ikumi Keita <ik...@ikumi.que.jp> writes:
> As I said before, xemacs has a similar function `replace-in-string'. So > how about an approach defining compatibility function like this? If > the use of `replace-regexp-in-string' doesn't require its optional > arguments, the compatibility function does the job. > > diff --git a/style/empheq.el b/style/empheq.el > --- a/style/empheq.el > +++ b/style/empheq.el > @@ -227,7 +227,7 @@ > (when (looking-at "[ \t\n\r%]*\\[") > (forward-sexp)) > (re-search-forward "[ \t\n\r%]*{\\([^}]+\\)}") > - (setq match (replace-regexp-in-string "[ \t\n\r%]" "" > + (setq match (TeX-replace-regexp-in-string "[ \t\n\r%]" "" > (match-string-no-properties 1))) > (if (string-match "=" match) > (progn > diff --git a/tex.el b/tex.el > --- a/tex.el > +++ b/tex.el > @@ -762,7 +762,10 @@ > (/ outer-priority 2)) > ((and inner-priority outer-priority) > (+ (/ (- outer-priority inner-priority) 2) inner-priority)) > - (t TeX-overlay-priority-step)))) ) > + (t TeX-overlay-priority-step)))) > + (defun TeX-replace-regexp-in-string (regexp rep string) > + "Compatibility function mimicking `replace-regexp-in-string' for XEmacs." > + (replace-in-string string regexp rep)) ) > > ;; require crm here, because we often do > ;; > @@ -900,7 +903,9 @@ > (/ outer-priority 2)) > ((and inner-priority outer-priority) > (+ (/ (- outer-priority inner-priority) 2) inner-priority)) > - (t TeX-overlay-priority-step)))) ) > + (t TeX-overlay-priority-step)))) > + > + (defalias #'TeX-replace-regexp-in-string #'replace-regexp-in-string) ) > > (defun TeX-delete-dups-by-car (alist &optional keep-list) > "Return a list of all elements in ALIST, but each car only once. Thanks for your response. Indeed, your suggestion is even easier. I'm fine with the compat function as I don't need the optional arguments of `replace-regexp-in-string'. @Mosè: WDYT? Best, Arash _______________________________________________ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel