From: Juri Linkov Date: Wed, 15 Nov 2023 17:37:30 +0000 (+0200) Subject: * lisp/minibuffer.el (minibuffer-completion-help): Fix base-suffix for region. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=579ea5f6e2475b880737ba157a6629ab92c1138c;p=emacs.git * lisp/minibuffer.el (minibuffer-completion-help): Fix base-suffix for region. When used with completion-in-region where completion-in-region-mode-predicate is non-nil, start base-suffix from point (bug#62700). --- diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 07a284134d6..9f4ac704599 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2405,9 +2405,14 @@ These include: (base-prefix (buffer-substring (minibuffer--completion-prompt-end) (+ start base-size))) (base-suffix - (if (eq (alist-get 'category (cdr md)) 'file) - (buffer-substring (save-excursion (or (search-forward "/" nil t) (point-max))) - (point-max)) + (if (or (eq (alist-get 'category (cdr md)) 'file) + completion-in-region-mode-predicate) + (buffer-substring + (save-excursion + (if completion-in-region-mode-predicate + (point) + (or (search-forward "/" nil t) (point-max)))) + (point-max)) "")) (all-md (completion--metadata (buffer-substring-no-properties start (point))