From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 13:50:44 2014 Received: (at submit) by debbugs.gnu.org; 5 Mar 2014 18:50:44 +0000 Received: from localhost ([127.0.0.1]:51933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLGtv-0007A1-S0 for submit@debbugs.gnu.org; Wed, 05 Mar 2014 13:50:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59864) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLGtt-00079s-7p for submit@debbugs.gnu.org; Wed, 05 Mar 2014 13:50:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLGti-00053w-0p for submit@debbugs.gnu.org; Wed, 05 Mar 2014 13:50:40 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLGth-00053o-MH for submit@debbugs.gnu.org; Wed, 05 Mar 2014 13:50:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLGtZ-0007dH-0v for bug-gnu-emacs@gnu.org; Wed, 05 Mar 2014 13:50:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLGtQ-0004oE-AC for bug-gnu-emacs@gnu.org; Wed, 05 Mar 2014 13:50:20 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:34303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLGtQ-0004kp-3N for bug-gnu-emacs@gnu.org; Wed, 05 Mar 2014 13:50:12 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s25Io9Is016369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Mar 2014 18:50:09 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s25Io8Fa025594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 5 Mar 2014 18:50:09 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s25Io8DP025574 for ; Wed, 5 Mar 2014 18:50:08 GMT MIME-Version: 1.0 Message-ID: <5d97809c-5fbf-4b3e-b864-8badfbd532da@default> Date: Wed, 5 Mar 2014 10:50:07 -0800 (PST) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 24.3.50; [PATCH] `icomplete-exhibit' needs `with-current-buffer' for minibuffer X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) I have noticed, with both my version (icomplete+.el) and vanilla icomplete.el, that in some cases no match of the user input is found because the field string gets picked up from buffer *Completions*, not from the minibuffer. This might be because in my case I use a separate frame for the minibuffer and for *Completions* (the latter has its input redirected to the former). The fix that seems most appropriate, I think, is this: wrap the body of the `icomplete-exhibit' code with this: (with-current-buffer (window-buffer (active-minibuffer-window)) E.g.: (defun icomplete-exhibit () "Insert Icomplete completions display. Should be run via minibuffer `post-command-hook'. See `icomplete-mode' and `minibuffer-setup-hook'." (when (and icomplete-mode (icomplete-simple-completing-p)) ;Shouldn't be necessary. (with-current-buffer (window-buffer (active-minibuffer-window)) (save-excursion (goto-char (point-max)) ... In GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2014-03-04 on ODIEONE Bzr revision: 116662 kbrown@cornell.edu-20140304190249-6s13s5bwn3un3hfe Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/binary --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3' 'CPPFLAGS=3D-DGC_MCHECK=3D1 -Ic:/Devel/emacs/include' LDFLAGS=3D-Lc:/Devel/emacs/lib' From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 07 19:17:36 2014 Received: (at 16943) by debbugs.gnu.org; 8 Mar 2014 00:17:36 +0000 Received: from localhost ([127.0.0.1]:55346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM4xL-0001H1-Vw for submit@debbugs.gnu.org; Fri, 07 Mar 2014 19:17:36 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:10953) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM4xJ-0001Gs-3d for 16943@debbugs.gnu.org; Fri, 07 Mar 2014 19:17:33 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFMCppy/2dsb2JhbABEuzWDWRdzgh8BBVYjEAs0EhQYDSSIJMEtkQoDiGGcGYFegxU X-IPAS-Result: Av8EABK/CFFMCppy/2dsb2JhbABEuzWDWRdzgh8BBVYjEAs0EhQYDSSIJMEtkQoDiGGcGYFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="50840587" Received: from 76-10-154-114.dsl.teksavvy.com (HELO ceviche.home) ([76.10.154.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Mar 2014 19:17:32 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 370DC660A5; Fri, 7 Mar 2014 19:17:32 -0500 (EST) From: Stefan Monnier To: Drew Adams Subject: Re: bug#16943: 24.3.50; [PATCH] `icomplete-exhibit' needs `with-current-buffer' for minibuffer Message-ID: References: <5d97809c-5fbf-4b3e-b864-8badfbd532da@default> Date: Fri, 07 Mar 2014 19:17:32 -0500 In-Reply-To: <5d97809c-5fbf-4b3e-b864-8badfbd532da@default> (Drew Adams's message of "Wed, 5 Mar 2014 10:50:07 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 16943 Cc: 16943@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > (with-current-buffer (window-buffer (active-minibuffer-window)) I think this would only paper over an underlying problem: icomplete uses a buffer-local post-command-hook, so it makes no sense that it would be run in another buffer. A few possibilities: - the hook is placed in the wrong buffer, in which case it would only be run in the wrong buffer. - an earlier post-command-hook function changed current-buffer. - an earlier minibuffer-setup-hook function changed current-buffer (which would cause the hook to be placed in the wrong buffer). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 07 20:40:31 2014 Received: (at 16943) by debbugs.gnu.org; 8 Mar 2014 01:40:31 +0000 Received: from localhost ([127.0.0.1]:55386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM6Fa-0004II-H7 for submit@debbugs.gnu.org; Fri, 07 Mar 2014 20:40:30 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:37856) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM6FW-0004Hz-0P for 16943@debbugs.gnu.org; Fri, 07 Mar 2014 20:40:26 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s281eMon007762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 8 Mar 2014 01:40:23 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s281eLlF004974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Mar 2014 01:40:22 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s281eLCc021441; Sat, 8 Mar 2014 01:40:21 GMT MIME-Version: 1.0 Message-ID: <740624be-841d-4560-81b8-367599f26c05@default> Date: Fri, 7 Mar 2014 17:40:20 -0800 (PST) From: Drew Adams To: Stefan Monnier Subject: RE: bug#16943: 24.3.50; [PATCH] `icomplete-exhibit' needs `with-current-buffer' for minibuffer References: <5d97809c-5fbf-4b3e-b864-8badfbd532da@default> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 16943 Cc: 16943@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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-current-buffer (window-buffer (active-minibuffer-window)) >=20 > I think this would only paper over an underlying problem: icomplete uses > a buffer-local post-command-hook, so it makes no sense that it would be > run in another buffer. `icomplete-exhibit' should not use a buffer other than the minibuffer. But it apparently does sometimes. Hence the fix: confine it to the minibuffer. (FWIW, it is text like this that gets picked up from *Completions*: "Click on a completion to select it.") IIRC, Icomplete started out using the minibuffer, but (in the same (or perhaps a recursive?) minibuffer activation) it later was using *Completions*. I've kind of forgotten just how I was reproducing this. > A few possibilities: > > - the hook is placed in the wrong buffer, in which case it would > only be run in the wrong buffer. ^^^^ Clearly the minibuffer, not *Completions*, is the current buffer for *most* invocations of `icomplete-exhibit'. Otherwise, it would not work in general. It is not run *only* in the wrong buffer, for sure. > - an earlier post-command-hook function changed current-buffer. > - an earlier minibuffer-setup-hook function changed current-buffer > (which would cause the hook to be placed in the wrong buffer). Even if such were the case, for whatever reason, `icomplete-exhibit' should act on the text in the minibuffer. It should look to the minibuffer to do its job, regardless of whether some other buffer happens to be current when it is invoked. If the minibuffer is active then its input text is there for Icomplete to read and complete. You have said that `icomplete-exhibit' should not be invoked unless the minibuffer is current. Maybe so. But maybe not. In the case of my fix it now does the right thing: even if invoked with *Completions* current, it picks up text from the minibuffer. Would you instead have it do nothing in that case (e.g., by=20 preventing from being invoked)? Icomplete should complete minibuffer text, and so should be confined to the minibuffer. That does not imply that it should be invoked only from the minibuffer, i.e., only when the minibuffer is the current buffer. That would be a stronger constraint, whose necessity is not demonstrated. What is necessary and sufficient is that it be able to do its job when the minibuffer is active. That's not the same thing as it being *invoked* only with the minibuffer as current buffer. In any case, `icomplete-exhibit', and the Icomplete code more generally, should not have a say in what other things might or might not do wrt `post-command-hook', including while the minibuffer is active. `icomplete-exhibit' is meant to operate in the minibuffer. Perhaps some other commands on `post-command-hook' do not have that constraint, and make sense regardless of the buffer. Enabling `icomplete-mode' should not prevent such commands from being invoked by `post-command-hook' just because the minibuffer might be active. It seems to me that the proposed fix is entirely appropriate: as long as the minibuffer is active, `icomplete-exhibit' can do its thing. It just needs to be limited to doing it in the minibuffer; that's all. Control of Icomplete should be limited to what it does. It should focus on the minibuffer. But that does not say anything about `post-command-hook' in general while the minibuffer is active. Feel free to debug this and come up with a different fix. But a priori I don't think that should involve "fixing" what other commands on `post-command-hook' might do wrt the current buffer. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 07 23:12:26 2014 Received: (at 16943) by debbugs.gnu.org; 8 Mar 2014 04:12:26 +0000 Received: from localhost ([127.0.0.1]:55444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM8cb-0000jq-ST for submit@debbugs.gnu.org; Fri, 07 Mar 2014 23:12:26 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:13951) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM8cZ-0000ji-MK for 16943@debbugs.gnu.org; Fri, 07 Mar 2014 23:12:24 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFMCppy/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av8EABK/CFFMCppy/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="50856492" Received: from 76-10-154-114.dsl.teksavvy.com (HELO ceviche.home) ([76.10.154.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Mar 2014 23:12:21 -0500 Received: by ceviche.home (Postfix, from userid 20848) id C1BA6660A5; Fri, 7 Mar 2014 23:12:19 -0500 (EST) From: Stefan Monnier To: Drew Adams Subject: Re: bug#16943: 24.3.50; [PATCH] `icomplete-exhibit' needs `with-current-buffer' for minibuffer Message-ID: References: <5d97809c-5fbf-4b3e-b864-8badfbd532da@default> <740624be-841d-4560-81b8-367599f26c05@default> Date: Fri, 07 Mar 2014 23:12:19 -0500 In-Reply-To: <740624be-841d-4560-81b8-367599f26c05@default> (Drew Adams's message of "Fri, 7 Mar 2014 17:40:20 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 16943 Cc: 16943@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 0.3 (/) > `icomplete-exhibit' should not use a buffer other than the minibuffer. So you say. Instead I say "icomplete-exhibit' should not be called in a buffer other than the minibuffer". And both are wrong if icomplete-in-buffer is non-nil, of course. > But it apparently does sometimes. And that implies there's a bug elsewhere. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 29 13:59:34 2016 Received: (at 16943) by debbugs.gnu.org; 29 Apr 2016 17:59:34 +0000 Received: from localhost ([127.0.0.1]:55698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awChS-0001nD-I0 for submit@debbugs.gnu.org; Fri, 29 Apr 2016 13:59:34 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:47560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awChQ-0001n5-Ob for 16943@debbugs.gnu.org; Fri, 29 Apr 2016 13:59:33 -0400 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1awChN-0000XG-FK; Fri, 29 Apr 2016 19:59:31 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#16943: 24.3.50; [PATCH] `icomplete-exhibit' needs `with-current-buffer' for minibuffer References: <5d97809c-5fbf-4b3e-b864-8badfbd532da@default> <740624be-841d-4560-81b8-367599f26c05@default> Date: Fri, 29 Apr 2016 19:59:28 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 07 Mar 2014 23:12:19 -0500") Message-ID: <87wpngxpmn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16943 Cc: 16943@debbugs.gnu.org, Drew Adams 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: 0.0 (/) Stefan Monnier writes: >> `icomplete-exhibit' should not use a buffer other than the minibuffer. > > So you say. Instead I say "icomplete-exhibit' should not be called in > a buffer other than the minibuffer". > > And both are wrong if icomplete-in-buffer is non-nil, of course. This all sounds like a bug in code not in Emacs, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 29 13:59:37 2016 Received: (at control) by debbugs.gnu.org; 29 Apr 2016 17:59:38 +0000 Received: from localhost ([127.0.0.1]:55701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awChV-0001nV-O2 for submit@debbugs.gnu.org; Fri, 29 Apr 2016 13:59:37 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:47568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awChT-0001nL-UQ for control@debbugs.gnu.org; Fri, 29 Apr 2016 13:59:36 -0400 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1awChR-0000XN-PC for control@debbugs.gnu.org; Fri, 29 Apr 2016 19:59:35 +0200 Date: Fri, 29 Apr 2016 19:59:33 +0200 Message-Id: <87vb30xpmi.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #16943 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: 0.0 (/) close 16943 From unknown Sun Aug 17 22:12:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 28 May 2016 11:24:07 +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