; * lisp/emacs-lisp/regexp-opt.el (regexp-opt-group): Clarify intent.

This commit is contained in:
Mattias Engdegård 2026-01-14 17:39:53 +01:00
parent 02966c8db5
commit e7c5ab2015

View file

@ -209,10 +209,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher."
;;
;; If there are several one-char strings, use charsets
((and (= (length (car strings)) 1)
(let ((strs (cdr strings)))
(while (and strs (/= (length (car strs)) 1))
(pop strs))
strs))
(any (lambda (s) (= (length s) 1)) (cdr strings)))
(let (letters rest)
;; Collect one-char strings
(dolist (s strings)