GNU bug report logs - #13641
24.3.50; `minibuffer-inactive-mode' - hook seems wrong

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Drew Adams" <drew.adams@HIDDEN>; dated Wed, 6 Feb 2013 23:07:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 13641 <at> debbugs.gnu.org:


Received: (at 13641) by debbugs.gnu.org; 7 Mar 2013 02:59:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 06 21:59:48 2013
Received: from localhost ([127.0.0.1]:35049 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UDR3c-0001LD-F7
	for submit <at> debbugs.gnu.org; Wed, 06 Mar 2013 21:59:48 -0500
Received: from userp1040.oracle.com ([156.151.31.81]:46333)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1UDR3a-0001L0-7D
	for 13641 <at> debbugs.gnu.org; Wed, 06 Mar 2013 21:59:47 -0500
Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
	by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with
	ESMTP id r272xA2T006723
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <13641 <at> debbugs.gnu.org>; Thu, 7 Mar 2013 02:59:11 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	r272x9ZC004705
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <13641 <at> debbugs.gnu.org>; Thu, 7 Mar 2013 02:59:10 GMT
Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	r272x9Am007445
	for <13641 <at> debbugs.gnu.org>; Wed, 6 Mar 2013 20:59:09 -0600
Received: from dradamslap1 (/10.159.178.227)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 06 Mar 2013 18:59:09 -0800
From: "Drew Adams" <drew.adams@HIDDEN>
To: <13641 <at> debbugs.gnu.org>
References: <1FC09B5AA7D44DCDA241D3947B30BFA1@HIDDEN>
	<7F99775CA6C6422AACBB09E0DE386CB4@HIDDEN>
Subject: RE: bug#13641: 24.3.50; `minibuffer-inactive-mode' - hook seems wrong
Date: Wed, 6 Mar 2013 18:59:06 -0800
Message-ID: <C2EB743A28C94381B3A91909548A5AAA@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-reply-to: <7F99775CA6C6422AACBB09E0DE386CB4@HIDDEN>
Thread-Index: Ac4Evl/VnVDB7LAWQhaGmOAXfLuBQwABlVnwBYavj1A=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: acsinet21.oracle.com [141.146.126.237]
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 13641
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.9 (--)

Any chance someone could please take a look at this behavior and explain what is
going on?  Thx.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13641; Package emacs. Full text available.

Message received at 13641 <at> debbugs.gnu.org:


Received: (at 13641) by debbugs.gnu.org; 6 Feb 2013 23:57:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 06 18:57:23 2013
Received: from localhost ([127.0.0.1]:40205 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1U3Eri-0001Mi-ID
	for submit <at> debbugs.gnu.org; Wed, 06 Feb 2013 18:57:23 -0500
Received: from aserp1040.oracle.com ([141.146.126.69]:29979)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1U3Erg-0001MZ-HR
	for 13641 <at> debbugs.gnu.org; Wed, 06 Feb 2013 18:57:21 -0500
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94])
	by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with
	ESMTP id r16Nu0sc001208
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <13641 <at> debbugs.gnu.org>; Wed, 6 Feb 2013 23:56:01 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	r16NtxvN029209
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <13641 <at> debbugs.gnu.org>; Wed, 6 Feb 2013 23:56:00 GMT
Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	r16Ntwo9015832
	for <13641 <at> debbugs.gnu.org>; Wed, 6 Feb 2013 17:55:59 -0600
Received: from dradamslap1 (/130.35.178.8)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 06 Feb 2013 15:55:59 -0800
From: "Drew Adams" <drew.adams@HIDDEN>
To: <13641 <at> debbugs.gnu.org>
References: <1FC09B5AA7D44DCDA241D3947B30BFA1@HIDDEN>
Subject: RE: bug#13641: 24.3.50; `minibuffer-inactive-mode' - hook seems wrong
Date: Wed, 6 Feb 2013 15:55:57 -0800
Message-ID: <7F99775CA6C6422AACBB09E0DE386CB4@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <1FC09B5AA7D44DCDA241D3947B30BFA1@HIDDEN>
Thread-Index: Ac4Evl/VnVDB7LAWQhaGmOAXfLuBQwABlVnw
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 13641
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.3 (--)

> (add-hook 'minibuffer-inactive-mode-hook #'make-frame-invisible)
>  
> This is how I started.  I was expecting the minibuffer frame to
> essentially stay hidden except when the minibuffer was activated.
>  
> With *Messages* selected, M-x makes *Messages* disappear.  Then C-g
> makes the minibuffer frame disappear and brings back *Messages*.

Thinking it might have something to do with the minibuffer level, I tried this:

(add-hook 'minibuffer-inactive-mode-hook
          (lambda ()
            (message "fr: %S, active: %S, depth: %S"
                     (selected-frame)
                     (active-minibuffer-window)
                     (minibuffer-depth))
            (unless (> (minibuffer-depth) 0)
              (make-frame-invisible))))

Then M-x followed by C-g works, but only every other time.
The inactive minibuffer reappears every other time (why?).

It reappears even when the message shows that the depth is 0 and the minibuffer
is inactive.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#13641; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Feb 2013 23:06:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 06 18:06:25 2013
Received: from localhost ([127.0.0.1]:40132 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1U3E4O-0007eD-Gh
	for submit <at> debbugs.gnu.org; Wed, 06 Feb 2013 18:06:24 -0500
Received: from eggs.gnu.org ([208.118.235.92]:44953)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <drew.adams@HIDDEN>) id 1U3E4L-0007e6-WF
	for submit <at> debbugs.gnu.org; Wed, 06 Feb 2013 18:06:23 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1U3E34-0000C3-8k
	for submit <at> debbugs.gnu.org; Wed, 06 Feb 2013 18:05:03 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-104.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED,
	RP_MATCHES_RCVD, UNPARSEABLE_RELAY,
	USER_IN_WHITELIST autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:49007)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1U3E34-0000Bl-5s
	for submit <at> debbugs.gnu.org; Wed, 06 Feb 2013 18:05:02 -0500
Received: from eggs.gnu.org ([208.118.235.92]:56304)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1U3E32-0008TX-GW
	for bug-gnu-emacs@HIDDEN; Wed, 06 Feb 2013 18:05:02 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1U3E31-00009j-6O
	for bug-gnu-emacs@HIDDEN; Wed, 06 Feb 2013 18:05:00 -0500
Received: from aserp1040.oracle.com ([141.146.126.69]:24041)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1U3E30-00009T-Vy
	for bug-gnu-emacs@HIDDEN; Wed, 06 Feb 2013 18:04:59 -0500
Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93])
	by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with
	ESMTP id r16N4vEk025373
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-gnu-emacs@HIDDEN>; Wed, 6 Feb 2013 23:04:58 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	r16N4tXj010407
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <bug-gnu-emacs@HIDDEN>; Wed, 6 Feb 2013 23:04:57 GMT
Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	r16N4tqb004409
	for <bug-gnu-emacs@HIDDEN>; Wed, 6 Feb 2013 17:04:55 -0600
Received: from dradamslap1 (/130.35.178.8)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 06 Feb 2013 15:04:55 -0800
From: "Drew Adams" <drew.adams@HIDDEN>
To: <bug-gnu-emacs@HIDDEN>
Subject: 24.3.50; `minibuffer-inactive-mode' - hook seems wrong
Date: Wed, 6 Feb 2013 15:04:53 -0800
Message-ID: <1FC09B5AA7D44DCDA241D3947B30BFA1@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
Thread-Index: Ac4Evl/VnVDB7LAWQhaGmOAXfLuBQw==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
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: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -3.5 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.2 (------)

I don't have the C sources, so cannot see just how/when
the hook `minibuffer-inactive-mode-hook' gets called.

I see this behavior with my own setup, which has a standalone minibuffer
frame: It seems like the hook is invoked for each toggle between
states active & inactive, i.e., including from inactive to active,
which would be wrong.  I would expect the hook to be invoked only
when the minibuffer becomes inactive.

E.g.:

(defun move-frame-right (&optional n frame)
  (interactive "p")
  (unless n (setq n  1))
  (setq n  (* n (frame-char-width frame)))
  (modify-frame-parameters frame
    (list (list 'left '+ (new-frame-position frame 'left n)))))

(add-hook 'minibuffer-inactive-mode-hook #'move-frame-right)

Start with the minibuffer inactive and some frame other than the
minibuffer frame selected, and do M-x.  That selected frame moves to the
right.  Why?  Then hit C-g to cancel M-x.  The minibuffer frame moves to
the right.

The latter makes sense, because C-g inactivates the minibuffer.  The
former invocation of the hook seems like a bug to me.

Then remove that hook function and do this instead:

Show buffer *Messages* in its own frame, then:
 
(add-hook 'minibuffer-inactive-mode-hook
 (lambda ()
   (message "fr: %S, active: %S"
            (selected-frame) (active-minibuffer-window))))
 
Then, with frame *Messages* selected, do M-x, then C-g.  This confirms
the double invocation.  This is what I see (my minibuffer frame has a
long name):
 
fr: #<frame *Messages* 03F9CC10>, active: #<window 6 on  *Minibuf-0*> [2 times]
fr: #<frame Emacs minibuffer - show/hide: hold CTRL + click in window 03FDDA48>,
active: nil
 
The first message, including the [2 times], appears after M-x.  The
second message appears after C-g.  Note that the first message indicates that
the minibuffer is _active_ - so why is the hook firing?
 
Now remove that hook function and then do this:
 
(add-hook 'minibuffer-inactive-mode-hook #'make-frame-invisible)
 
This is how I started.  I was expecting the minibuffer frame to
essentially stay hidden except when the minibuffer was activated.
 
With *Messages* selected, M-x makes *Messages* disappear.  Then C-g
makes the minibuffer frame disappear and brings back *Messages*.
 
Seems broken to me, but perhaps I'm missing something.
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-01-30 on ODIEONE
Bzr revision: 111631 michael.albinus@HIDDEN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 





Acknowledgement sent to "Drew Adams" <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#13641; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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