diff options
| author | Stefan Monnier | 2021-12-06 09:43:13 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2021-12-06 09:43:13 -0500 |
| commit | d529207b0eb26b623fadf4716581add58f2cc282 (patch) | |
| tree | 09b75ea88a3209141d3f0449b6c207b3fc620810 | |
| parent | e3427faf55d7887de1dcba0fd027474ccbb5c214 (diff) | |
| download | emacs-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.el | 5 |
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) |