aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2021-12-06 09:43:13 -0500
committerStefan Monnier2021-12-06 09:43:13 -0500
commitd529207b0eb26b623fadf4716581add58f2cc282 (patch)
tree09b75ea88a3209141d3f0449b6c207b3fc620810
parente3427faf55d7887de1dcba0fd027474ccbb5c214 (diff)
downloademacs-d529207b0eb26b623fadf4716581add58f2cc282.tar.gz
emacs-d529207b0eb26b623fadf4716581add58f2cc282.zip
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.
-rw-r--r--lisp/minibuffer.el5
1 files changed, 3 insertions, 2 deletions
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)."
283 ((eq (car-safe action) 'boundaries) 283 ((eq (car-safe action) 'boundaries)
284 (let ((beg (or (and (eq (car-safe res) 'boundaries) (cadr res)) 0))) 284 (let ((beg (or (and (eq (car-safe res) 'boundaries) (cadr res)) 0)))
285 `(boundaries 285 `(boundaries
286 ,(max (length s1) 286 ,(min (length string)
287 (+ beg (- (length s1) (length s2)))) 287 (max (length s1)
288 (+ beg (- (length s1) (length s2)))))
288 . ,(and (eq (car-safe res) 'boundaries) (cddr res))))) 289 . ,(and (eq (car-safe res) 'boundaries) (cddr res)))))
289 ((stringp res) 290 ((stringp res)
290 (if (string-prefix-p s2 res completion-ignore-case) 291 (if (string-prefix-p s2 res completion-ignore-case)