bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54374: 29.0.50; previous-completion fails at beginning of completion


From: Philip Kaludercic
Subject: bug#54374: 29.0.50; previous-completion fails at beginning of completions buffer
Date: Sun, 13 Mar 2022 20:39:53 +0000

Juri Linkov <juri@linkov.net> writes:

> X-Debbugs-Cc: Philip Kaludercic <philipk@posteo.net>
>
> This is not reproducible in Emacs 28, so looks like a recent regression:

This seems to fix it:

diff --git a/lisp/simple.el b/lisp/simple.el
index accc119e2b..7d47aba1ee 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9125,7 +9125,7 @@ next-completion
         (unless (get-text-property (point) 'mouse-face)
           (goto-char (next-single-property-change (point) 'mouse-face nil 
end)))
         (setq n (1- n)))
-      (while (< n 0)
+      (while (and (< n 0) (< 1 (point)))
         (let ((prop (get-text-property (1- (point)) 'mouse-face)))
           ;; If in a completion, move to the start of it.
           (when (and prop (eq prop (get-text-property (point) 'mouse-face)))

> 0. emacs -Q
> 1. M-x TAB
> 2. move point to the beginning of the *Completions* buffer
> 3. type S-TAB (<backtab>)
>
> Debugger entered--Lisp error: (args-out-of-range 0 0)
>   get-text-property(0 mouse-face)
>   next-completion(-1)
>   previous-completion(1)
>   funcall-interactively(previous-completion 1)
>   command-execute(previous-completion)
>   completing-read-default("M-x " ...)
>   read-extended-command()
>   command-execute(execute-extended-command)
>
>

-- 
        Philip Kaludercic

reply via email to

[Prev in Thread] Current Thread [Next in Thread]