From unknown Mon Jun 23 02:20:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#55712 <55712@debbugs.gnu.org> To: bug#55712 <55712@debbugs.gnu.org> Subject: Status: 29.0.50; Bad interaction between icomplete and completion-auto-select. Reply-To: bug#55712 <55712@debbugs.gnu.org> Date: Mon, 23 Jun 2025 09:20:10 +0000 retitle 55712 29.0.50; Bad interaction between icomplete and completion-aut= o-select. reassign 55712 emacs submitter 55712 Knut Anders Hatlen severity 55712 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 29 14:36:57 2022 Received: (at submit) by debbugs.gnu.org; 29 May 2022 18:36:57 +0000 Received: from localhost ([127.0.0.1]:41940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvNma-0003RU-Tn for submit@debbugs.gnu.org; Sun, 29 May 2022 14:36:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:57324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvNmZ-0003RN-1c for submit@debbugs.gnu.org; Sun, 29 May 2022 14:36:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvNmY-0005fX-RX for bug-gnu-emacs@gnu.org; Sun, 29 May 2022 14:36:54 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:35786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvNmX-0001gs-52 for bug-gnu-emacs@gnu.org; Sun, 29 May 2022 14:36:54 -0400 Received: by mail-lj1-x22c.google.com with SMTP id m26so2473274ljb.2 for ; Sun, 29 May 2022 11:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=RPRx+Ka0fa8/8BIi6BYnViNfXr5GcAvf8djJHdH3RGk=; b=VClYxz63ElI6NwWojC4ZN/FnA5sb1eQXfZiTHL0YuxrDyfP7eGA39EOfzwAuqWVjIx /s4EMI5BSCgBIamblmLuU4YN7DnI+QNkGaMnHOt0hORX0T1xlvJMIKWo6O0ldJCim036 /N9viHNxuQ97uCykPGASySZ6S2icLhDiQ5E9R1NaNiUyLgbSuUCUD1jY7BDyQv6cwvI2 HO3wDxQdoTZQxmy0cq5aWfROLPrYEr7qeffJmnCg+fz7142QXdzVOvMXywOLVfx8Exyv 3bRKmfyluQhduHJdIGGLNHXgN3kftFvmME8XAz8C44R2PnnvDZo7mrpoR3bn7iAFW3Wn Z13Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=RPRx+Ka0fa8/8BIi6BYnViNfXr5GcAvf8djJHdH3RGk=; b=lzYtPzhfH1yuUODm/s6IXiiFpO7+VSePLypBXDzREoODdAGJ/BIJTJy4blSjF0y1TY 0cNUI+zZQfLv3HamDqfLXI8yyi3lwYiMxMUvAo3OFm2v+kbFGb/e0KMKnGt20UNz0q5H gpGBqGOyyWnaiJ0ZLbNgbEDZjZoyLQ30t9b1VZGsxlFznv7x3PPnbVBip3PBIWeTKMCK aKm/RsBrdqHActTZGr+JgkZoStmpTBWuIwhgz8sxUIUsHc5h+fShI/0w69vHT9e7vL07 ZLF3lg4hwH5N5NE81TZAQjGPHUheHv54oi7EJsD/1v1JbadA2WhhM28SQHWNafrBTiaw A1Hg== X-Gm-Message-State: AOAM531aWiYfqV/bZwNfm1FHgLmjPa7W4TyINVFuyEHQcI73orxY18SY f0w9rrgaanLD5/duuUChEqD/SZi6Lg== X-Google-Smtp-Source: ABdhPJwsYSQjNoWHsPb3iHzICvDLtpDo3RIWHP27ca+G/jUkMfP0wPnqivF1guxupuRMYmJ3Bqv9Qg== X-Received: by 2002:a2e:9bd6:0:b0:255:4904:6552 with SMTP id w22-20020a2e9bd6000000b0025549046552mr4316576ljj.253.1653849410445; Sun, 29 May 2022 11:36:50 -0700 (PDT) Received: from dell ([2a02:1660:692e:dd00::44c]) by smtp.gmail.com with ESMTPSA id x7-20020a0565123f8700b0047863382e3dsm1878341lfa.215.2022.05.29.11.36.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 May 2022 11:36:50 -0700 (PDT) From: Knut Anders Hatlen To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Bad interaction between icomplete and completion-auto-select. Date: Sun, 29 May 2022 20:36:11 +0200 Message-ID: <87a6b0gp9g.fsf@dell.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=kahatlen@gmail.com; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) With emacs -Q: (icomplete-mode 1) (setopt completion-auto-select t) C-x C-f TAB TAB The following error message is displayed in the minibuffer: Error in post-command-hook (icomplete-post-command-hook): (wrong-type-argument integer-or-marker-p nil) In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-05-29 built on dell Repository revision: aa955dc569b361771e4d2b3b1d7b90c1ceea8b6a Repository branch: master System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --with-json --with-xml2 --with-modules --prefix=/usr/local/stow/emacs-master --with-pgtk --without-x CC=gcc-12' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS XIM GTK3 ZLIB Important settings: value of $LANG: nn_NO.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: icomplete-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media rmc puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date seq mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cus-edit pp cus-start cus-load wid-edit icomplete cl-loaddefs cl-lib term/xterm xterm gv subr-x byte-opt bytecomp byte-compile cconv iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 73863 6888) (symbols 48 7496 2) (strings 32 19656 1982) (string-bytes 1 597351) (vectors 16 10036) (vector-slots 8 119240 6882) (floats 8 34 23) (intervals 56 1281 68) (buffers 992 12)) -- Knut Anders From debbugs-submit-bounces@debbugs.gnu.org Sun May 29 15:56:35 2022 Received: (at 55712) by debbugs.gnu.org; 29 May 2022 19:56:36 +0000 Received: from localhost ([127.0.0.1]:41998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvP1f-00067z-Mw for submit@debbugs.gnu.org; Sun, 29 May 2022 15:56:35 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:36135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvP1c-00067e-Ua for 55712@debbugs.gnu.org; Sun, 29 May 2022 15:56:33 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8F7F4200003; Sun, 29 May 2022 19:56:25 +0000 (UTC) From: Juri Linkov To: Knut Anders Hatlen Subject: Re: bug#55712: 29.0.50; Bad interaction between icomplete and completion-auto-select. Organization: LINKOV.NET References: <87a6b0gp9g.fsf@dell.mail-host-address-is-not-set> Date: Sun, 29 May 2022 22:55:25 +0300 In-Reply-To: <87a6b0gp9g.fsf@dell.mail-host-address-is-not-set> (Knut Anders Hatlen's message of "Sun, 29 May 2022 20:36:11 +0200") Message-ID: <86a6b0un9u.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55712 Cc: 55712@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > (icomplete-mode 1) > (setopt completion-auto-select t) > C-x C-f TAB TAB > > The following error message is displayed in the minibuffer: > > Error in post-command-hook (icomplete-post-command-hook): (wrong-type-argument integer-or-marker-p nil) I confirm the problem, I have seen it a few times, but it seems the root of the problem is in the way how buffer-local hooks are fired. icomplete-post-command-hook is a hook local in the minibuffer. But when the command switches from the minibuffer to the Completions buffer, then for an unknown reason the minibuffer post-command hook is still fired in another buffer - in the Completions buffer that has no local post-command hook. From debbugs-submit-bounces@debbugs.gnu.org Mon May 30 14:09:54 2022 Received: (at 55712) by debbugs.gnu.org; 30 May 2022 18:09:55 +0000 Received: from localhost ([127.0.0.1]:46048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvjpy-00043k-Ee for submit@debbugs.gnu.org; Mon, 30 May 2022 14:09:54 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:48467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvjpv-00043K-5r for 55712@debbugs.gnu.org; Mon, 30 May 2022 14:09:52 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 2AE321C0003; Mon, 30 May 2022 18:09:43 +0000 (UTC) From: Juri Linkov To: Knut Anders Hatlen Subject: Re: bug#55712: 29.0.50; Bad interaction between icomplete and completion-auto-select. Organization: LINKOV.NET References: <87a6b0gp9g.fsf@dell.mail-host-address-is-not-set> <86a6b0un9u.fsf@mail.linkov.net> Date: Mon, 30 May 2022 20:36:28 +0300 In-Reply-To: <86a6b0un9u.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 29 May 2022 22:55:25 +0300") Message-ID: <868rqi51zv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55712 Cc: 55712@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit >> (icomplete-mode 1) >> (setopt completion-auto-select t) >> C-x C-f TAB TAB >> >> The following error message is displayed in the minibuffer: >> >> Error in post-command-hook (icomplete-post-command-hook): (wrong-type-argument integer-or-marker-p nil) > > I confirm the problem, I have seen it a few times, but > it seems the root of the problem is in the way how buffer-local > hooks are fired. icomplete-post-command-hook is a hook > local in the minibuffer. But when the command switches > from the minibuffer to the Completions buffer, then for an unknown > reason the minibuffer post-command hook is still fired in another buffer - > in the Completions buffer that has no local post-command hook. Actually, this problem started to appear after the recent addition of completion-auto-select that calls switch-to-completions in two different places that fail for two different reasons. Each of both cases messes up buffers and windows in such a way that after the end of the command the current buffer is " *Minibuf-1*", but the selected window is "*Completions*": 1. when completion-auto-select is t, minibuffer-completion-help temporarily switches buffers using ‘(with-current-buffer-window "*Completions*"’, then display-completion-list calls completion-setup-hook and completion-setup-function that uses switch-to-completions to select another window. Then minibuffer-completion-help restores the original buffer, i.e. the minibuffer, but the selected window remains "*Completions*". 2. when completion-auto-select is 'second-tab', completion--in-region-1 uses ‘(with-current-buffer (window-buffer window)’. Then switch-to-completions selects another window, after that the original buffer is restored, i.e. the minibuffer, but the selected window remains "*Completions*". So the solution for both cases is to move the window selection outside from switching buffers: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=switch-to-completions.patch diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 6ae25b8def..a34a1ddad0 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1422,9 +1503,9 @@ completion--in-region-1 (let ((window minibuffer-scroll-window)) (with-current-buffer (window-buffer window) (cond - ;; Here this is possible only when second-tab, so jump now. - (completion-auto-select - (switch-to-completions)) + ;; Here this is possible only when second-tab, but switch + ;; to completions below, outside of `with-current-buffer'. + ((eq completion-auto-select 'second-tab)) ;; Reverse tab ((equal (this-command-keys) [backtab]) (if (pos-visible-in-window-p (point-min) window) @@ -1439,7 +1520,9 @@ completion--in-region-1 (set-window-start window (point-min) nil) ;; Else scroll down one screen. (with-selected-window window (scroll-up))))) - nil))) + nil) + (when (eq completion-auto-select 'second-tab) + (switch-to-completions)))) ;; If we're cycling, keep on cycling. ((and completion-cycling completion-all-sorted-completions) (minibuffer-force-complete beg end) @@ -2421,7 +2504,9 @@ minibuffer-completion-help (display-completion-list completions nil group-fun))))) nil))) - nil)) + nil) + (when (eq completion-auto-select t) + (switch-to-completions))) (defun minibuffer-hide-completions () "Get rid of an out-of-date *Completions* buffer." diff --git a/lisp/simple.el b/lisp/simple.el index d6b7045432..99ac7b812d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9826,9 +9826,7 @@ completion-setup-function (insert "Click on a completion to select it.\n")) (insert (substitute-command-keys "In this buffer, type \\[choose-completion] to \ -select the completion near point.\n\n"))))) - (when (eq completion-auto-select t) - (switch-to-completions))) +select the completion near point.\n\n")))))) (add-hook 'completion-setup-hook #'completion-setup-function) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 30 16:55:48 2022 Received: (at 55712) by debbugs.gnu.org; 30 May 2022 20:55:48 +0000 Received: from localhost ([127.0.0.1]:46158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvmQV-00044Z-JJ for submit@debbugs.gnu.org; Mon, 30 May 2022 16:55:48 -0400 Received: from mail-lj1-f181.google.com ([209.85.208.181]:44931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvmQQ-00044E-QZ for 55712@debbugs.gnu.org; Mon, 30 May 2022 16:55:46 -0400 Received: by mail-lj1-f181.google.com with SMTP id w23so1916262ljd.11 for <55712@debbugs.gnu.org>; Mon, 30 May 2022 13:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=HnRHK9DOgzHgcaNzX1vYXcQycQ7ZfF99fqPjkbetAK8=; b=hbNNrYlZwmfCfqk3nPYhSA7S7u/vBZ4TqrzB2xHD9bED5QoY9W7pg7V5dywPVEgoGC mrR/MOPO638+4lY2J4DeP8RQJWznfPdEjj0ayJeMsB7bG20HyCuU/uaFRpcZh8iEWNXL 3EwxY4h2Xc1EfxT6qtXckScjdddBi5qvLZZnQFumWyNmnWJytl5JHImf4fAdlJy+2PCT aweCpSGKVVtvtgl3PUtUYYBZbDKdTzl+UAonLBkrJS9BUb6dPIQINV1UVyRQVR54J6Ax kdG/J1l6joP6wwhtxhuu6pBy54US3mNG/l6uC29JEoelsHemNaLrhF9AGP0HKEP393rg g8Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=HnRHK9DOgzHgcaNzX1vYXcQycQ7ZfF99fqPjkbetAK8=; b=lmehuDqDrrtkLZ5evEqIpS0/wV7vQPeNVFL4uYp7zyGb3MHoJLl6Hfo931kig9mO9y R0V2NXDkAIxOp2N8p1RLVDuBwUZftAedubr0DNIS/XvIX/kvvXRm1ByIoE3XA+hGt8QX Hjj7rAqmxo3GUWq0+tzIherhbE7mOpQoaXhxCU65Cx9DqGLmLewCPXgr6gId6vAVpA5M elFGNzS5H/OrxHQL+4OjCA8RKCbYbk/XlpMtEwd10LwIiZ5+LGs9rqS66W/6scxDE7Ub /c+lQS/J4qhLwr5YfjfG3PAFRscGnrRyFPdfGL7VsdyzRDx+CSGumP+eoRuJvaK557jO wr/w== X-Gm-Message-State: AOAM530KeAa4abgeSSu0CBftdPwWQaeT+8ValZF/QKorMcBIvG0zy1mJ m0qnFfG4WyC1XHYKKkqlb5QpzUd/iA== X-Google-Smtp-Source: ABdhPJzqJ3lfrHTIHzVlnEtt1JWrH5OK1K+uRzASuRT0vxV+WHS23mUWeUY5bQXKPHb+r4WhcjC3HQ== X-Received: by 2002:a2e:bba2:0:b0:253:e644:61e8 with SMTP id y34-20020a2ebba2000000b00253e64461e8mr27322519lje.42.1653944136238; Mon, 30 May 2022 13:55:36 -0700 (PDT) Received: from dell ([2a02:1660:692e:dd00::44c]) by smtp.gmail.com with ESMTPSA id m1-20020a2e5801000000b0025550f92c05sm561238ljb.54.2022.05.30.13.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 13:55:35 -0700 (PDT) From: Knut Anders Hatlen To: Juri Linkov Subject: Re: bug#55712: 29.0.50; Bad interaction between icomplete and completion-auto-select. References: <87a6b0gp9g.fsf@dell.mail-host-address-is-not-set> <86a6b0un9u.fsf@mail.linkov.net> <868rqi51zv.fsf@mail.linkov.net> Date: Mon, 30 May 2022 22:55:34 +0200 In-Reply-To: <868rqi51zv.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 30 May 2022 20:36:28 +0300") Message-ID: <87leuisptl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 55712 Cc: 55712@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >>> (icomplete-mode 1) >>> (setopt completion-auto-select t) >>> C-x C-f TAB TAB >>> >>> The following error message is displayed in the minibuffer: >>> >>> Error in post-command-hook (icomplete-post-command-hook): (wrong-type-a= rgument integer-or-marker-p nil) >> >> I confirm the problem, I have seen it a few times, but >> it seems the root of the problem is in the way how buffer-local >> hooks are fired. icomplete-post-command-hook is a hook >> local in the minibuffer. But when the command switches >> from the minibuffer to the Completions buffer, then for an unknown >> reason the minibuffer post-command hook is still fired in another buffer= - >> in the Completions buffer that has no local post-command hook. > > Actually, this problem started to appear after the recent addition > of completion-auto-select that calls switch-to-completions in two > different places that fail for two different reasons. Each of both > cases messes up buffers and windows in such a way that after the end > of the command the current buffer is " *Minibuf-1*", but the selected > window is "*Completions*": > > 1. when completion-auto-select is t, minibuffer-completion-help > temporarily switches buffers using =E2=80=98(with-current-buffer-window "= *Completions*"=E2=80=99, > then display-completion-list calls completion-setup-hook and completion-s= etup-function > that uses switch-to-completions to select another window. Then > minibuffer-completion-help restores the original buffer, i.e. the minibuf= fer, > but the selected window remains "*Completions*". > > 2. when completion-auto-select is 'second-tab', completion--in-region-1 > uses =E2=80=98(with-current-buffer (window-buffer window)=E2=80=99. Then > switch-to-completions selects another window, after that > the original buffer is restored, i.e. the minibuffer, > but the selected window remains "*Completions*". > > So the solution for both cases is to move the window selection > outside from switching buffers: Thanks! The patch seems to be working fine in my setup. --=20 Knut Anders From debbugs-submit-bounces@debbugs.gnu.org Tue May 31 13:56:53 2022 Received: (at 55712) by debbugs.gnu.org; 31 May 2022 17:56:53 +0000 Received: from localhost ([127.0.0.1]:48825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nw66v-0007OJ-Gs for submit@debbugs.gnu.org; Tue, 31 May 2022 13:56:53 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:46043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nw66t-0007Ny-4v; Tue, 31 May 2022 13:56:51 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 24D5F20007; Tue, 31 May 2022 17:56:42 +0000 (UTC) From: Juri Linkov To: Knut Anders Hatlen Subject: Re: bug#55712: 29.0.50; Bad interaction between icomplete and completion-auto-select. Organization: LINKOV.NET References: <87a6b0gp9g.fsf@dell.mail-host-address-is-not-set> <86a6b0un9u.fsf@mail.linkov.net> <868rqi51zv.fsf@mail.linkov.net> <87leuisptl.fsf@gmail.com> Date: Tue, 31 May 2022 20:53:19 +0300 In-Reply-To: <87leuisptl.fsf@gmail.com> (Knut Anders Hatlen's message of "Mon, 30 May 2022 22:55:34 +0200") Message-ID: <86leuhvbao.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 55712 Cc: 55712@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 55712 29.0.50 thanks >> So the solution for both cases is to move the window selection >> outside from switching buffers: > > Thanks! The patch seems to be working fine in my setup. Thanks for confirming. Now pushed to master. From unknown Mon Jun 23 02:20:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 29 Jun 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 09 23:56:58 2022 Received: (at control) by debbugs.gnu.org; 10 Aug 2022 03:56:59 +0000 Received: from localhost ([127.0.0.1]:45729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLcq2-0006gi-Lk for submit@debbugs.gnu.org; Tue, 09 Aug 2022 23:56:58 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:33720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLcpy-0006gR-D8 for control@debbugs.gnu.org; Tue, 09 Aug 2022 23:56:57 -0400 Received: by mail-pj1-f50.google.com with SMTP id t22-20020a17090a449600b001f617f2bf3eso2701772pjg.0 for ; Tue, 09 Aug 2022 20:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc; bh=9nfegxX7at7kiRg7/tC/IIa3xISJwUk68azjZGN2BuY=; b=jpIkKJn/M3XSsesQn4WDZjqLiNV2uzJ11vHTxdTmSEIprtNXI+8hQ2lsQjal7VaaCL zuLV6EFRuJLDtJKJadP1HNITbTnrr5x6meaW7n9fEZXlq062MJqQk+3d5EvTtOOULKdT 4GakBY9VqylMHz+RlsoIgwaPVw88XM3mhLfWXtMEMRQtKew5gL5qOkQnSpMTDjHZTHib enkDP0tyUhfb28hGxURy/BX8SkuX2deb2529Rzq7ysazx36MD0LKrqQYGMlrdVEWr2yZ a932dLsiiEcRWCBhWCgkbTh+QS+WvtlH5SPkGkgsFgdll23Qvaud0PLhDBPt3X+OeUWq iTtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc; bh=9nfegxX7at7kiRg7/tC/IIa3xISJwUk68azjZGN2BuY=; b=KiKrSnsTGvgF/6a/GBaC9xvFjWKR01R/+sKWebEM0lSucvmpd5C5MwB/fk3/H0f0V3 Po+OBD4bKCgU9ryMwdYsE2TnZs8Lsr9FLzLTbhn3aK9GVE12hXOZjw61ks5uVhqZpsph 1d6ZFWxd6dvzcLF0OnGUDDa26QdOlQ3AMp3ZQpvrqvO6dujK9avVx4PuHxEphUDjVvoY ob1tewK8ErnoD++7oKIFO+Iqc/oESd/VAIbrg8cHn66w3EP0ThZo+jZuwCxcXhY/1BIK zlZ3EZ4fTbzD+k2lEek8VGpK7jmOw2Tu/FytJU7YoAiYZZychAm2+jp79fQKT0VqxbhM mIZA== X-Gm-Message-State: ACgBeo21VDnkexplQejdJHlxRyiHdr88CY0mvvm2fN1/bxagQyGLzRfO XSS/Kg8MKhp9fYN/DT8AWFIjwmswm+iwANId7nLlIoWov9o= X-Google-Smtp-Source: AA6agR7x7AlS3Xdx7uAjCjnKBAASIOmfZkfR+mcOfKrH1P/56xQbE9pjwgYti7RYyasLUWGmWyEj6tgrmDdvRi0YoAc= X-Received: by 2002:a17:902:6b4c:b0:171:38ab:e762 with SMTP id g12-20020a1709026b4c00b0017138abe762mr709388plt.42.1660103807202; Tue, 09 Aug 2022 20:56:47 -0700 (PDT) MIME-Version: 1.0 From: Tom Gillespie Date: Tue, 9 Aug 2022 20:56:35 -0700 Message-ID: Subject: unarchive 55712 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) unarchive 55712 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 10 00:10:25 2022 Received: (at 55712) by debbugs.gnu.org; 10 Aug 2022 04:10:25 +0000 Received: from localhost ([127.0.0.1]:45739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLd32-0000kH-SE for submit@debbugs.gnu.org; Wed, 10 Aug 2022 00:10:25 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:42626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLd2v-0000ju-K7 for 55712@debbugs.gnu.org; Wed, 10 Aug 2022 00:10:22 -0400 Received: by mail-pj1-f47.google.com with SMTP id d65-20020a17090a6f4700b001f303a97b14so916950pjk.1 for <55712@debbugs.gnu.org>; Tue, 09 Aug 2022 21:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc; bh=y1sJjEVcq5i+nyibzW99KJJVCBXjG1yuj1rXqkC/hJI=; b=om8po/o5uJqvHB37De5aaKqaw6h4JdmwFbW34XcYNHDM1PtbjOWLkcLejBfGtpqbRn Yo6HLtdFxXW2c/C6FNGHw80SA25EHgwTAgSQJIoBOpY638StU1CSjC32PpEBXNfLUtdX pW7BFNSI32pzhErbH1GF5Ce0EKA027Bc5dPsV6w/dy4Lyg+bkiYYs0mn8tSWmMVppcYk HNFvTnzyV94YncXfoPMYQW5KGN6QRiafiZpxWxdx3flQ1EqkR2IVj+Lk1kzkVfrMoM4m 1eJiyRPpjxVQxYWA4pRufgpG/oby30FjLV37EBsa2XwInd++L+cWSHbgTm5+Rb/9FhB0 DFCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc; bh=y1sJjEVcq5i+nyibzW99KJJVCBXjG1yuj1rXqkC/hJI=; b=IUGz8+pwbd7RPslPSf6QL7qb9Lqo8Zne4KpxNB9OKZfzDgXAtOqq2J+4SSqaazNEh4 aq5ARdoznutYiU86Vc8PI5eQlY75UXF5LgAtVGtK2l74m6a3wtg9b6VDO9BXino8AiBA MF8hOaCmCuHKXM5S8NgkUrISmDKzzn9I24B0AySl+RIVRDrVWiw+NNgSO3RXxWj/mC4N Bgxua484ADjiEzbU7ee8PE8nXND2646W3Ck1zbkD0wMw4/6fnxd7qOmxQGOGRm0E8BBD oo5BLrq/nItmcmdT/E2zcz6PoWPeqmTUIAWnCl0zzhJ/rRIex3L3WuKEHcyZmTiKK/4U iEMQ== X-Gm-Message-State: ACgBeo2enn58g5GX0X56x6E/CsmC/5C+eX01PFz9glJUT5NuhiPk3ccC OPTkekqBOb2r1Zd4b/sIhQocCtn5LTVwSTkc+8SsDIM/aYM= X-Google-Smtp-Source: AA6agR7PLB/aPoyqlTtqCeNnBDl5QV7uXcfsUH2Neswdq98qarJy4E5IxX+k7QcKNn45BbfaBl0wGYQnyHYdokSR0BM= X-Received: by 2002:a17:90b:4d91:b0:1f5:24a:ff7e with SMTP id oj17-20020a17090b4d9100b001f5024aff7emr1706175pjb.194.1660104611572; Tue, 09 Aug 2022 21:10:11 -0700 (PDT) MIME-Version: 1.0 From: Tom Gillespie Date: Tue, 9 Aug 2022 21:10:00 -0700 Message-ID: Subject: the fix for this broke the ability to paste into gmail plain text To: 55712@debbugs.gnu.org Content-Type: multipart/alternative; boundary="000000000000a9b3e805e5db390a" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 55712 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000a9b3e805e5db390a Content-Type: text/plain; charset="UTF-8" I have a bug where emacs can no longer paste into gmail compose windows that are set to plain text, and the fix for this bug 03b780e387e54c23ac9322e329aca6e5ab4f18e6 bisected as the bad commit. Reverting the commit resolves the issue. The issue is on linux under X11 on master at all points after 03b780. To reproduce, copy some text from emacs and try to paste it into a gmail compose window that is set to plain text mode. I do not know exactly which part of the changes induced the behavior, but reverting the commit clearly fixes the issue and allows me to paste into plain text mode compose again. --000000000000a9b3e805e5db390a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have a bug where emacs can no longer paste into gma= il
compose windows that are set to plain text, and the fix for
this bug 03b780e387e54c23ac9322e329aca6e5ab4f18e6
bisecte= d as the bad commit. Reverting the commit resolves
the issue.

The issue is on linux under X11 on master at all poin= ts after
03b780. To reproduce, copy some text from emacs and try<= /div>
to paste it into a gmail compose window that is set to plain
text mode.

I do not know exactly which p= art of the changes induced the
behavior, but reverting the commit= clearly fixes the issue and
allows me to paste into plain text m= ode compose again.
--000000000000a9b3e805e5db390a-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 10 07:11:01 2022 Received: (at 55712) by debbugs.gnu.org; 10 Aug 2022 11:11:01 +0000 Received: from localhost ([127.0.0.1]:46259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLjc5-0003X9-CM for submit@debbugs.gnu.org; Wed, 10 Aug 2022 07:11:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLjc3-0003Wu-Tf for 55712@debbugs.gnu.org; Wed, 10 Aug 2022 07:11:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLjby-00041w-Kz; Wed, 10 Aug 2022 07:10:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3LiFsyDuF8jRkuzEqbGuZr4a/8dqwnwWe5Oy3uNq1WA=; b=A7Z9XzsQi1c6 pmEHvs7YQLQYYzWH/XAcG2sxyfDq1cc5pQLhpdPaQ3pbzxRD+OW5TEIOQeAmrZUMmX+WHmIimOLdj Ut0AR7l+/3LHl/8QWcei5vMOO0wnBSzxTwWKMXlzW2MQufjVB828wWk/+/MJmHKtGyfSEzAQutG9o acsrjz4GwAesOnhWNV61kUqKlKE4AUGhEOJha1LMLy/FGW/GUJflCQzXIqznMNkGeYZYs7m2K/hDi qB3FcTx8IHTM3KEZ4X7q5pfAoPFsFbLvwDzBfMKK3yZax5lZJXAewQQxlCBkH5czoZ+rVZBmUR/Lr S+NQ6ktU/WAbA//1Ix8Nag==; Received: from [87.69.77.57] (port=1773 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLjbx-0003uI-Pz; Wed, 10 Aug 2022 07:10:54 -0400 Date: Wed, 10 Aug 2022 14:10:45 +0300 Message-Id: <83czd8s6a2.fsf@gnu.org> From: Eli Zaretskii To: Tom Gillespie In-Reply-To: (message from Tom Gillespie on Tue, 9 Aug 2022 21:10:00 -0700) Subject: Re: bug#55712: the fix for this broke the ability to paste into gmail plain text References: <87a6b0gp9g.fsf@dell.mail-host-address-is-not-set> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55712 Cc: 55712@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Tom Gillespie > Date: Tue, 9 Aug 2022 21:10:00 -0700 > > I have a bug where emacs can no longer paste into gmail > compose windows that are set to plain text, and the fix for > this bug 03b780e387e54c23ac9322e329aca6e5ab4f18e6 > bisected as the bad commit. Reverting the commit resolves > the issue. > > The issue is on linux under X11 on master at all points after > 03b780. To reproduce, copy some text from emacs and try > to paste it into a gmail compose window that is set to plain > text mode. > > I do not know exactly which part of the changes induced the > behavior, but reverting the commit clearly fixes the issue and > allows me to paste into plain text mode compose again. Hard to understand how completion could be related to pasting. Could you please run the modified code under Edebug, put a breakpoint where that commit made changes, and show the Lisp backtrace when that breakpoint is hit? Maybe that will give us some hints. Thanks. From unknown Mon Jun 23 02:20:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 07 Sep 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator