From: Stefan Monnier Date: Sat, 4 Dec 2021 05:02:01 +0000 (-0500) Subject: * lisp/minibuffer.el: Don't return a boundary outside its arg X-Git-Tag: emacs-29.0.90~3619^2~4 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=284cc2491d0997e0b6559a2cdefbfed707a259d6;p=emacs.git * lisp/minibuffer.el: Don't return a boundary outside its arg * lisp/minibuffer.el (completion-table-subvert): Fix out of string start boundary for the odd case where `string` is shorter than `s1`. --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c2a6b01fc8e..0a5fb72774b 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -283,7 +283,7 @@ the form (concat S2 S)." ((eq (car-safe action) 'boundaries) (let ((beg (or (and (eq (car-safe res) 'boundaries) (cadr res)) 0))) `(boundaries - ,(max (length s1) + ,(max (min (length string) (length s1)) (+ beg (- (length s1) (length s2)))) . ,(and (eq (car-safe res) 'boundaries) (cddr res))))) ((stringp res)