GNU bug report logs - #61479
28.2; icomplete-in-buffer --- Error in post-command-hook: args-out-of-range

Previous Next

Package: emacs;

Reported by: Fernando de Morais <fernandodemorais.jf <at> gmail.com>

Date: Mon, 13 Feb 2023 14:59:02 UTC

Severity: normal

Found in version 28.2

Fixed in version 29.0.60

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #34 received at 61479 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61479 <at> debbugs.gnu.org
Subject: Re: bug#61479: 28.2; icomplete-in-buffer --- Error in
 post-command-hook: args-out-of-range
Date: Thu, 23 Feb 2023 10:36:45 +0200
> This patch fixes the problem when we hit C-j to select a candidate, but
> the problem persists if we type multiple C-M-i when in the candidate
> list, unfortunately.

Thanks for finding another way to reproduce the problem.  This shows
that C-M-i bound to icomplete-force-complete needs the same treatment:

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index f7a91599f3b..b0b55dd1e7e 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -215,7 +215,11 @@ icomplete-force-complete-and-exit
        ;; calculated, This causes the first cached completion to
        ;; be taken (i.e. the one that the user sees highlighted)
        completion-all-sorted-completions)
-      (minibuffer-force-complete-and-exit)
+      (if (window-minibuffer-p)
+          (minibuffer-force-complete-and-exit)
+        (minibuffer-force-complete (icomplete--field-beg)
+                                   (icomplete--field-end)
+                                   'dont-cycle))
     ;; Otherwise take the faster route...
     (minibuffer-complete-and-exit)))
 
@@ -223,7 +227,11 @@ icomplete-force-complete
   "Complete the icomplete minibuffer."
   (interactive)
   ;; We're not at all interested in cycling here (bug#34077).
-  (minibuffer-force-complete nil nil 'dont-cycle))
+  (if (window-minibuffer-p)
+      (minibuffer-force-complete nil nil 'dont-cycle)
+    (minibuffer-force-complete (icomplete--field-beg)
+                               (icomplete--field-end)
+                               'dont-cycle)))
 
 ;; Apropos `icomplete-scroll', we implement "scrolling icomplete"
 ;; within classic icomplete, which is "rotating", by contrast.




This bug report was last modified 2 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.