GNU bug report logs - #61308
28.2; icomplete --- Error in post-command-hook: wrong-type-argument

Previous Next

Package: emacs;

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

Date: Mon, 6 Feb 2023 02:33:02 UTC

Severity: normal

Found in version 28.2

Fixed in version 30.0.50

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

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Fernando de Morais <fernandodemorais.jf <at> gmail.com>
Cc: 61308 <at> debbugs.gnu.org
Subject: Re: bug#61308: 28.2; icomplete --- Error in post-command-hook:
 wrong-type-argument
Date: Wed, 08 Feb 2023 09:20:57 +0200
>   (progn
>     (with-eval-after-load 'icomplete
>       (customize-set-variable 'enable-recursive-minibuffers t)
>       (customize-set-variable 'help-window-select t)
>       (customize-set-variable 'icomplete-show-matches-on-no-input t))
>     (icomplete-mode))
>
> 2. C-x C-f
> 3. C-h v
> 4. Then RET (to select any candidate).
>
> Results in:
>
>   - The window displaying the *Help* buffer is selected, but an error[1]
>     is raised and I am left with the default Emacs completion system
>     when I return to the minibuffer.
>
> [1]  "Error in post-command-hook (icomplete-post-command-hook): (wrong-type-argument number-or-marker-p nil)"

Interesting bug report.  I guess we need to double-check
if we are still in the right buffer after help-window-select
selects another window and thus confuses icomplete-mode:

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 014f38b2024..97457832e2c 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -686,6 +686,8 @@ icomplete-exhibit
 Should be run via minibuffer `post-command-hook'.
 See `icomplete-mode' and `minibuffer-setup-hook'."
   (when (and icomplete-mode
+             ;; Check if still in the right buffer (bug#61308)
+             (or (window-minibuffer-p) completion-in-region--data)
              (icomplete-simple-completing-p)) ;Shouldn't be necessary.
     (let ((saved-point (point)))
       (save-excursion




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

Previous Next


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