auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] support for xemacs


From: Arash Esbati
Subject: Re: [AUCTeX-devel] support for xemacs
Date: Thu, 16 Mar 2017 10:11:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2

Hi all,

Ikumi Keita <address@hidden> writes:

> Regarding support for xemacs, I recently noticed that the function
> `replace-regexp-in-string', which is not available in xemacs, is used at
> several places of AUCTeX.  The output of `grep -Er
> replace-regexp-in-string .' is:
> ----------------------------------------------------------------------
> ./style/empheq.el:      (setq match (replace-regexp-in-string "[ \t\n\r%]*" ""

I wanted to fix the places where I used this function.  For empheq.el, I
tried this solution:

diff --git a/style/empheq.el b/style/empheq.el
index 9b822898..7ed33fda 100644
--- a/style/empheq.el
+++ b/style/empheq.el
@@ -227,8 +227,17 @@ number of ampersands if possible."
       (when (looking-at "[ \t\n\r%]*\\[")
        (forward-sexp))
       (re-search-forward "[ \t\n\r%]*{\\([^}]+\\)}")
-      (setq match (replace-regexp-in-string "[ \t\n\r%]" ""
-                                           (match-string-no-properties 1)))
+      (setq match
+           (if (featurep 'xemacs)
+               (let ((x (match-string-no-properties 1)))
+                 (with-temp-buffer
+                   (insert x)
+                   (goto-char (point-max))
+                   (while (re-search-backward "[ \t\n\r%]" nil t)
+                     (replace-match ""))
+                   (buffer-string)))
+             (replace-regexp-in-string "[ \t\n\r%]" ""
+                                       (match-string-no-properties 1))))
       (if (string-match "=" match)
          (progn
            (setq amsenv (car (split-string match "=")))

Would this work for XEmacs?  I don't have XEmacs at hand so I can't test
it myself.  I would apply the same thing to other style files as well.

Any comments welcome.  TIA.

Best, Arash



reply via email to

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