From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Different background color for different windows/modes Date: Thu, 29 Jun 2017 13:40:24 +0200 Message-ID: <20170629114024.GB24776@tuxteam.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1498736473 10734 195.159.176.226 (29 Jun 2017 11:41:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Jun 2017 11:41:13 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: help-gnu-emacs@gnu.org To: Alexandre Oberlin Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 29 13:41:07 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 1dQXom-0002It-CG for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 13:41:04 +0200 Original-Received: from localhost ([::1]:38458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQXor-0000gF-L6 for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 07:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQXoL-0000g9-Fp for help-gnu-emacs@gnu.org; Thu, 29 Jun 2017 07:40:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQXoG-0007PB-PX for help-gnu-emacs@gnu.org; Thu, 29 Jun 2017 07:40:37 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:55296 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQXoG-0007Ob-IE for help-gnu-emacs@gnu.org; Thu, 29 Jun 2017 07:40:32 -0400 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1dQXoC-0006be-HW; Thu, 29 Jun 2017 13:40:28 +0200 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 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:113602 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, Jun 29, 2017 at 03:45:31AM -0700, 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) > > 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). > > How can I have different colors for different window modes? If currently impossible, is something planned in that regard? Or maybe xemacs does this? You don't state it explicitly, but I assume you want to change the background color per buffer, perhaps per window. For a long time it was only possible to set the whole frame's (an Emacs frame is what the window manager considers a "window") background color. This has changed since Emacs 24-ish, see for example https://stackoverflow.com/questions/3094638/emacs-custom-background-color-by-mode (this seems to be exactly what you're looking for). Cheers - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAllU5ygACgkQBcgs9XrR2kYSgACfT8hG9yXfeclPQwLOGU5O7KEo 3McAniy9SLPfXdCYcsnZW2Xl+4HvM2rN =OkVt -----END PGP SIGNATURE-----