From 368e88b8cbeceaac898f5d6793257378866c99c8 Mon Sep 17 00:00:00 2001 From: Arash Esbati Date: Sat, 26 Oct 2019 13:25:19 +0200 Subject: [PATCH] Avoid infloop's by doing a case-sensitive match * lisp/textmodes/reftex-ref.el (reftex-format-special): Be case-sensitive when checking the actual reference macro against \ref. This avoids infloop when \Ref is chosen. --- lisp/textmodes/reftex-ref.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index 3ec96aa67db..fd47514d690 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -841,7 +841,8 @@ Replace any occurrences of \"\\ref\" with REFSTYLE." ;; Replace instances of \ref in `fmt' with the special reference ;; style selected by the user. (cond - ((while (string-match "\\(\\\\ref\\)[ \t]*{" fmt) + ((while (let ((case-fold-search nil)) + (string-match "\\(\\\\ref\\)[ \t]*{" fmt)) (setq fmt (replace-match refstyle t t fmt 1)))) ((string-match "\\(\\\\[[:alpha:]]+\\)[ \t]*{" fmt) (setq fmt (replace-match refstyle t t fmt 1)))) -- 2.39.2