From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: custom-set-faces for various file types Date: Mon, 23 Nov 2020 00:38:10 +0100 Message-ID: <87pn45nesd.fsf@web.de> References: <87sg91cdpd.fsf@web.de> <87im9xcbr7.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36264"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 23 00:38:36 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 1kgywG-0009Jv-Oz for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 23 Nov 2020 00:38:36 +0100 Original-Received: from localhost ([::1]:40398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgywF-0000l9-Qa for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 18:38:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgyvx-0000kx-F8 for help-gnu-emacs@gnu.org; Sun, 22 Nov 2020 18:38:17 -0500 Original-Received: from mout.web.de ([212.227.15.4]:35509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgyvv-0003JZ-Ny for help-gnu-emacs@gnu.org; Sun, 22 Nov 2020 18:38:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1606088291; bh=3273vDn7sxcKNNt+AZGxtLyTF2NtgStRDISiI3s5FMk=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=bR0IvNSf/8PYaju9xW8K3yhYGLuajVRHhJ/9l2cDm2rUewF4Q0q1KJ9CYtCcMndBr 1hxFf+41C7Up/sxxYPjXg+5OkC2bAp8zjcCR7oNIpAdzmx9cS1owFK86yoNmdyl5mb uQuXdSe3Kx2zHhsG8LJ2SFSo3FYyaeIjBihETG70= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([94.218.219.247]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M4EJn-1kOtuq186t-00rnB9; Mon, 23 Nov 2020 00:38:11 +0100 In-Reply-To: (Christopher Dimech's message of "Sun, 22 Nov 2020 23:53:47 +0100") X-Provags-ID: V03:K1:eMUmIcYhYK1JHl5G8OBe8uZgabjyY6mbqMQAxmUho75yb8ABn1X oPW4dQu3KUJ6PoxXa1fg1CmmbF+GlXwYn6L0N5T6Xzb0M5XbL1nXPA2TCs4qayx6Ab05XHD AP4uCljwbgjMsXOuQPQ2ymjSXt+GvG0aqXSuj/CCM4b25V1pDs6ER9QVKYumRw8D67rbcCu xtRZM3OXLjvVYZrHy+9dA== X-UI-Out-Filterresults: notjunk:1;V03:K0:CAYQz+rj6m4=:9NA+ccRUHfNGtU0gY3O9SW EroQlqaKE36Ehk3J/g6pkbeIkeWuLNAvskqsVdG/QCnEqvOOjvF0OUFkLPmTcWN2hUAIjkXvw JIlFhZVkbh34en0dZr0Swo+KAarrgkhtnGT6DZ7tRmPXjKn20oyQHgxP5DQsW2ixHKXviTMO0 jL4aomw1v8zqmbYVSJK0VHUN0+yXA0Z2Fb8jgULFBYANHlaLvM06vq5PX9UQS7Zuv5TEI3M+8 KeitSy5gsVrH4POm1/u5g9hGb/7EpZjE/49vBWEwURGSz8YiBeDG4IUxDmBX4jiHdUr1K4w6B e13Vr5kNdRIbk5S9/QFQV9iBcFsDiz2ojcQ3EJZ1eo6culoMJ7ShJqrlDlSX6LHiX9gmnsQuI FtnuOSltbE7ZdIWP2HhMrMZbOMnPSWiZiUe+TbrsesJdaZTrYz3PRncvtiIHUZMRaiGPHXViA kGrLslP+0klwAsyB/YJSOFKPy//DLBi3svOJ2f5Mz4HB6fRU5DutMqeUsSvGWKrhKC53CI/LW 1EnN+Z4JVQ7P5531uY3y/jbMjXzxyuLbJXkBlPwAsjPJjMYJBrdyYBr/1C5uEwblMLImLzC44 72OTBrTPXJQpNI2LCbjyYA72ESUmIfUXurhWdy/XMZ28zJaVpUYPS6q9KmNq/4o4AFm7qLXDf kM7tf9rM4nlafFO/lv9mzMDctxphCJjjhFKL6vINiMVq2+RMxTrYnHfaVRiDYrncHl5RjmVro vWbNUueVnB6f+Ps11bndyxZLDPKQyl62I3MZipVhKvxD10312q7cqmYXPcm8c/WhwIy7+59H Received-SPF: pass client-ip=212.227.15.4; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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:125497 Archived-At: 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. 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.