From: Arash Esbati Date: Sat, 26 Oct 2019 11:25:19 +0000 (+0200) Subject: Avoid infloop's by doing a case-sensitive match X-Git-Tag: emacs-27.0.90~877 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=368e88b8cbeceaac898f5d6793257378866c99c8;p=emacs.git 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. --- 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))))