From: Stefan Monnier Date: Mon, 6 Dec 2021 14:43:13 +0000 (-0500) Subject: lisp/minibuffer.el: Fix for bug#52169 regression X-Git-Tag: emacs-28.0.91~79 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d529207b0eb26b623fadf4716581add58f2cc282;p=emacs.git lisp/minibuffer.el: Fix for bug#52169 regression * lisp/minibuffer.el (completion-table-subvert): Make sure we return a boundary that's not outside of the limit of the string. --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ca82b4a9e60..21d610fdf44 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -283,8 +283,9 @@ 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) - (+ beg (- (length s1) (length s2)))) + ,(min (length string) + (max (length s1) + (+ beg (- (length s1) (length s2))))) . ,(and (eq (car-safe res) 'boundaries) (cddr res))))) ((stringp res) (if (string-prefix-p s2 res completion-ignore-case)