unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Fernando de Morais <fernandodemorais.jf@gmail.com>
Cc: 61308@debbugs.gnu.org
Subject: bug#61308: 28.2; icomplete --- Error in post-command-hook: wrong-type-argument
Date: Wed, 08 Feb 2023 09:20:57 +0200	[thread overview]
Message-ID: <86cz6k1v3a.fsf@mail.linkov.net> (raw)
In-Reply-To: <87wn4vh6b9.fsf@gmail.com> (Fernando de Morais's message of "Sun,  05 Feb 2023 23:32:42 -0300")

>   (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





  reply	other threads:[~2023-02-08  7:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  2:32 bug#61308: 28.2; icomplete --- Error in post-command-hook: wrong-type-argument Fernando de Morais
2023-02-08  7:20 ` Juri Linkov [this message]
2023-02-08 22:09   ` Fernando de Morais
2023-02-09 18:09     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86cz6k1v3a.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=61308@debbugs.gnu.org \
    --cc=fernandodemorais.jf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).