From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Different background color for different windows/modes Date: Thu, 29 Jun 2017 13:24:32 +0200 Message-ID: <86y3sbm3yn.fsf@zoho.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498735537 31840 195.159.176.226 (29 Jun 2017 11:25:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Jun 2017 11:25:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 29 13:25:31 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQXZg-0007oc-5k for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 13:25:28 +0200 Original-Received: from localhost ([::1]:38404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQXZj-00044t-Pz for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 07:25:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQXZG-00044Z-63 for help-gnu-emacs@gnu.org; Thu, 29 Jun 2017 07:25:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQXZB-0000Xu-Ff for help-gnu-emacs@gnu.org; Thu, 29 Jun 2017 07:25:02 -0400 Original-Received: from [195.159.176.226] (port=52464 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQXZB-0000WV-8P for help-gnu-emacs@gnu.org; Thu, 29 Jun 2017 07:24:57 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dQXYv-0005Yo-Gf for help-gnu-emacs@gnu.org; Thu, 29 Jun 2017 13:24:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 30 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:QiJIfGDp+seJRZPlp6VQMqawis4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113601 Archived-At: Alexandre Oberlin wrote: > Hi all, I am using a hook to change my > background color using stuff like: (add-hook > 'change-major-mode-hook > 'change-my-background-color) You want the background color to be a function of the major mode? And there are no mode-specific variables to control this so you instead have a function that maps on the fly? Oh, man... > This is sub-optimal because - there is > a terrible flash as soon as I enter the > minibuffer - all the displayed windows change > color (not only the one getting focus). *If* you are going to stick to this sub-optimal solution indeed, I suppose you could write a more advanced function that will examine if the new context is such that the change of background color should or shouldn't kick in. -- underground experts united http://user.it.uu.se/~embe8573