]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix error when choosing 1-char completion candidates
authorEshel Yaron <me@eshelyaron.com>
Mon, 8 Jul 2024 20:47:10 +0000 (22:47 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 8 Jul 2024 20:47:10 +0000 (22:47 +0200)
lisp/simple.el

index 47047ffa617667ef3e2b3fdf080435c4c5bbccb5..6d776e6e4dde86391d2a6c491a4043e03e814ec0 100644 (file)
@@ -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))