From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: help needed with gnus mode-line Date: Fri, 01 Jul 2011 12:23:51 -0400 Message-ID: References: <87r56b5yf5.fsf@gmail.com> <87y60ixy1u.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1309540688 9975 80.91.229.12 (1 Jul 2011 17:18:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 17:18:08 +0000 (UTC) Cc: emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 01 19:18:04 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QchLu-0007Te-9C for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2011 19:18:02 +0200 Original-Received: from localhost ([::1]:38376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QchLs-0003bH-U9 for ged-emacs-devel@m.gmane.org; Fri, 01 Jul 2011 13:18:01 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcgVW-0005rC-PZ for emacs-devel@gnu.org; Fri, 01 Jul 2011 12:23:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcgVV-0003lz-EG for emacs-devel@gnu.org; Fri, 01 Jul 2011 12:23:54 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3833 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcgVV-0003ln-3D for emacs-devel@gnu.org; Fri, 01 Jul 2011 12:23:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EANjzDU5MCqDH/2dsb2JhbABSp2J4iHm/eYYyBJ5ThCw X-IronPort-AV: E=Sophos;i="4.65,459,1304308800"; d="scan'208";a="118305250" Original-Received: from 76-10-160-199.dsl.teksavvy.com (HELO pastel.home) ([76.10.160.199]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 01 Jul 2011 12:23:51 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AC97C5912D; Fri, 1 Jul 2011 12:23:51 -0400 (EDT) In-Reply-To: <87y60ixy1u.fsf@gmail.com> (Thierry Volpiatto's message of "Fri, 01 Jul 2011 09:25:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141387 Archived-At: > (with-current-buffer (with-selected-window > (minibuffer-selected-window) > (current-buffer)) Try (window-buffer (minibuffer-selected-window)) ;-) Of course, minibuffer-selected-window is not quite right either: you don't want to modify the mode-line of the buffer from where the M-: was typed, but the mode-line that's right above the minibuffer (which doesn't even exist in minibuffer-only frames). > Which use the minibuffer only with gnus buffers. > In other place in emacs it use the current-buffer of the selected window > before entering the minibuffer. No, the problem is that if you don't switch to the other buffer, your let binding will change the mode-line-format value in the minibuffer and since the minibuffer basically never sets this value buffer-locally it means it changes (temporarily) the default value of mode-line-format, i.e. it changes the value of mode-line-format for all buffers that haven't set it buffer-locally (i.e. all buffers except Gnus buffers and a few other ones). If you have several windows, you should see that your mode-line message appears in pretty much all mode lines rather than only the one next to the minibuffer (tho calling force-mode-line-update with a nil may be sufficient to restrict the change to the window(s) that show this buffer in many cases). Stefan