From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#13641: 24.3.50; `minibuffer-inactive-mode' - hook seems wrong Date: Wed, 6 Feb 2013 15:04:53 -0800 Message-ID: <1FC09B5AA7D44DCDA241D3947B30BFA1@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360191953 22411 80.91.229.3 (6 Feb 2013 23:05:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Feb 2013 23:05:53 +0000 (UTC) To: 13641@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 07 00:06:12 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U3E49-0003i3-OI for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Feb 2013 00:06:09 +0100 Original-Received: from localhost ([::1]:39436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3E3q-00009V-Ar for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Feb 2013 18:05:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3E3m-00009F-QM for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2013 18:05:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3E3k-0000gU-Qu for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2013 18:05:46 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3E3k-0000gQ-MG for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2013 18:05:44 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U3E50-0007fC-RJ for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2013 18:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Feb 2013 23:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13641 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.136019198529405 (code B ref -1); Wed, 06 Feb 2013 23:07:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Feb 2013 23:06:25 +0000 Original-Received: from localhost ([127.0.0.1]:40132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3E4O-0007eD-Gh for submit@debbugs.gnu.org; Wed, 06 Feb 2013 18:06:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44953) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3E4L-0007e6-WF for submit@debbugs.gnu.org; Wed, 06 Feb 2013 18:06:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3E34-0000C3-8k for submit@debbugs.gnu.org; Wed, 06 Feb 2013 18:05:03 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:49007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3E34-0000Bl-5s for submit@debbugs.gnu.org; Wed, 06 Feb 2013 18:05:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3E32-0008TX-GW for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2013 18:05:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3E31-00009j-6O for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2013 18:05:00 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:24041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3E30-00009T-Vy for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2013 18:04:59 -0500 Original-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 ; Wed, 6 Feb 2013 23:04:58 GMT Original-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 ; Wed, 6 Feb 2013 23:04:57 GMT Original-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 ; Wed, 6 Feb 2013 17:04:55 -0600 Original-Received: from dradamslap1 (/130.35.178.8) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Feb 2013 15:04:55 -0800 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70789 Archived-At: 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: #, active: # [2 times] fr: #, 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@gmx.de-20130130192046-nx4rskw7jemmtrw8 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'