From f6ce701dd96ad51df2587ad8b3232a6e971afe78 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 8 Jul 2024 22:47:10 +0200 Subject: [PATCH] Fix error when choosing 1-char completion candidates --- lisp/simple.el | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 47047ffa617..6d776e6e4dd 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -10006,25 +10006,10 @@ minibuffer, but don't quit the completions window." (base-position completion-base-position) (insert-function completion-list-insert-choice-function) (completion-no-auto-exit (if no-exit t completion-no-auto-exit)) - (choice - (save-excursion - (goto-char (posn-point (event-start event))) - (let (beg) - (cond - ((and (not (eobp)) - (get-text-property (point) 'completion--string)) - (setq beg (1+ (point)))) - ((and (not (bobp)) - (get-text-property (1- (point)) 'completion--string)) - (setq beg (point))) - (t (error "No completion here"))) - (setq beg (or (previous-single-property-change - beg 'completion--string) - beg)) - (get-text-property beg 'completion--string))))) - - (unless (buffer-live-p buffer) - (error "Destination buffer is dead")) + (choice (get-text-property (posn-point (event-start event)) + 'completion--string))) + (unless choice (error "No completion here")) + (unless (buffer-live-p buffer) (error "Destination buffer is dead")) (unless no-quit (quit-window nil (posn-window (event-start event)))) (let ((mstate completions-minibuffer-state)) -- 2.39.2