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 20:50:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2

Hi Keita,

Ikumi Keita <address@hidden> 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



reply via email to

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