From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: custom-set-faces for various file types Date: Mon, 23 Nov 2020 00:52:58 +0100 Message-ID: References: <87sg91cdpd.fsf@web.de> <87im9xcbr7.fsf@web.de> <87pn45nesd.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23816"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 23 00:55:20 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kgzCS-00067P-Ei for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 23 Nov 2020 00:55:20 +0100 Original-Received: from localhost ([::1]:41698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgzCR-0002AD-7t for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 18:55:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgzAF-0002A2-Lg for help-gnu-emacs@gnu.org; Sun, 22 Nov 2020 18:53:03 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:49145) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgzAD-000529-HB for help-gnu-emacs@gnu.org; Sun, 22 Nov 2020 18:53:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1606089179; bh=QLhK1oTK03ls3gD14/xsUr4blnolHi/D2pnApN1LlPI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=CA4aJVWe8HcvqoO4H7ySSy4DF1TPBCHn8z/XNU7vFs+dYIm6Vn0ve8s7fa30AXP2s mnt/YvNXlz4GzbpkgJSR68CR1agZVv3Aa3smDiRIHkkBySGcKVMW8BEwfOM/UAWEZL sDBPmVMg0plBlKSW70MKpywrFrcDonivhhKRsOV8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs01.server.lan [172.19.170.58]) (via HTTP); Mon, 23 Nov 2020 00:52:58 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87pn45nesd.fsf@web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:IMEXhWEUaRmWWx7316l/Ri1Q2WY8+pAsE3YXDSbkomssTb3cy6OR7jPujfUuYONK4ZQTt 4w1n7YBE4yJiqzeYbH+/IHYf6IQ6PJy/ScVUXl9JoMlWL2P4tPEZ/lTuWNeHtMjFjCLhtOLk5GTU 9wwuDwgD1qkjITfy84oeiiwlquXZBsd6/gufyK0M12PpeTyFjwgw7YLYCY2Pk2tQieDHZdAjea3q rQrzfQiDoT2tOCLkypMMrQuOUFgztUmlnlKkFQ90GTAwYnhIMNZM/thoW66AKcTS+pSEEpoBWHVD qA= X-UI-Out-Filterresults: notjunk:1;V03:K0:S3RlSn28iXU=:UNpSqVjoKnAvXN5EnKTx39 A+vU/FrPYdDw0rANh0KhJQXMPsQEWy5dDl8E6F21XSOfeUCJ6a7/1keeoF74daj8mamfvR8pK n/1BbdSJ+bOfPdBXwNs+S50q0aKKWJjRlhfLkBV3rPjDp2pkU8vucwXWOZ9TVu2VtJPNyPQxY y3zybWNzLF/LdZXguZG60tWw/Us2LEQyRswrYD8FdX2pBJtAF0VI43WYBcbr4lwQX6R2g9o94 Bffiw3EzL4AsH+VG08m2pswlA7GDHdqI60kARj1vuayqkolLIpwmh/LMPX1dXKUJGyoW8gcOU UW/sctLcOETahRN6eyO8Rgu1mYP88FgCfcHiU8iEHGuvMxcWK7Nz+sKbyh7AQ4rAF7TJL0Xd9 eXSisjl1pObb4QHUyKZYyDcmWX9hI+2TvRKBFFP3A+KTnOM5KLDWwmXey57DBD+8UNvPM2x3Q +e73N+KUG/d7XCp7QzL5eZSME5lmENJqBn0xgMWKAGQnX6bVA5CDQfJ9SBdalJK+yFVT+3+j/ nEZpJta+tODJEbgsDBDYDflDToConc2LjIVLNjgxgtbu3NoEBoI6EiMJOor+dLiiT7kJyvqkC f9/RB4DRYjuY8= Received-SPF: pass client-ip=212.227.15.19; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125498 Archived-At: > Sent: Monday, November 23, 2020 at 12:38 AM > From: "Michael Heerdegen" > To: "Christopher Dimech" > Cc: help-gnu-emacs@gnu.org > Subject: Re: custom-set-faces for various file types > > Christopher Dimech writes: > > > Would this be good > > > > (add-hook 'org-mode-hook > > (lambda () > > (face-remap-add-relative > > '(org-level-1 ((t (:foreground "cyan1")))) > > '(org-level-2 ((t (:foreground "chartreuse")))) > > '(org-level-3 ((t (:foreground "dark orange")))) > > '(org-level-4 ((t (:foreground "yellow")))) > > '(org-level-5 ((t (:foreground "magenta")))) > > '(org-level-6 ((t (:foreground "tan1")))) > > '(org-level-7 ((t (:foreground "deep sky blue")))) > > '(org-level-8 ((t (:foreground "orange red")))) ))) > > So far you only showed settings of different, mode specific faces. Your > situation seems to be less complex than I understood, and you don't need > face remapping for these examples; simple `face-spec-set' calls are good > enough. Correct. They are already mode specific. Still I might need to change others and would have a good system. It would also help others making modifications without having to figure out what to do. Still, as you suggest I can code tho part for mode specific faces differen= tly. Then others can find a number of different constructs to learn from, rathe= r than just one way that simply solve mp problems. > BTW, as far as I recall, if you know what your are doing, it is even ok > to have multiple `custom-set-faces' calls in your init file. I don't > recall what happens when your custom file gets written, probably it will > save your settings a second time there, and that may cause trouble (only > later, much later...) > > So, for your init file, `face-spec-set' is better, and for per mode > settings of the faces shared by several modes, you want to use face > remapping. `text-scale-mode' is such a use case, for example (it > modifies the `default' face, i.e., by inheriting, mostly all faces, > buffer locally). > > > Michael. > >