summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2025-02-12 11:16:20 +0800
committerPo Lu <luangruo@yahoo.com>2025-02-12 11:16:20 +0800
commitfb4daf4aa07b6fa060b64548ff5c75819f77515c (patch)
tree93424a8d8c4a67d3572b3e1509b6f1eb463676b2 /lisp/emacs-lisp
parent3fd0b802de20dc83b5d5236b6d458df73c9d4e77 (diff)
parent19791839cfbb9202aff8a8d476ec76741592c97d (diff)
downloademacs-fb4daf4aa07b6fa060b64548ff5c75819f77515c.tar.gz
emacs-fb4daf4aa07b6fa060b64548ff5c75819f77515c.tar.bz2
emacs-fb4daf4aa07b6fa060b64548ff5c75819f77515c.zip
Merge from savannah/emacs-30
19791839cfb ; Don't document a complicated default 88bc748f52f Fix minibuffer-next-completion in completing-read-multiple 737f249aa2c ; Document 'completing-read-multiple' in the ELisp manual 37f25514602 ; * lisp/gnus/nnweb.el (nnweb-type): Doc fix.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/crm.el26
1 files changed, 10 insertions, 16 deletions
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 454c3e85074..a371a8e14de 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -251,22 +251,16 @@ with empty strings removed."
(setq-local minibuffer-completion-table #'crm--collection-fn)
(setq-local minibuffer-completion-predicate predicate)
(setq-local completion-list-insert-choice-function
- (lambda (start end choice)
- (if (and (stringp start) (stringp end))
- (let* ((beg (save-excursion
- (goto-char (minibuffer-prompt-end))
- (or (search-forward start nil t)
- (search-forward-regexp crm-separator nil t)
- (minibuffer-prompt-end))))
- (end (save-excursion
- (goto-char (point-max))
- (or (search-backward end nil t)
- (progn
- (goto-char beg)
- (search-forward-regexp crm-separator nil t))
- (point-max)))))
- (completion--replace beg end choice))
- (completion--replace start end choice))))
+ (lambda (_start _end choice)
+ (let* ((beg (save-excursion
+ (if (search-backward-regexp crm-separator nil t)
+ (1+ (point))
+ (minibuffer-prompt-end))))
+ (end (save-excursion
+ (if (search-forward-regexp crm-separator nil t)
+ (1- (point))
+ (point-max)))))
+ (completion--replace beg end choice))))
;; see completing_read in src/minibuf.c
(setq-local minibuffer-completion-confirm
(unless (eq require-match t) require-match))