From: Christopher Dimech <dimech@gmx.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: custom-set-faces for various file types
Date: Mon, 23 Nov 2020 00:52:58 +0100 [thread overview]
Message-ID: <trinity-605ca56b-bb93-43e3-8e64-ca04c22f4cb6-1606089178928@3c-app-mailcom-bs01> (raw)
In-Reply-To: <87pn45nesd.fsf@web.de>
> Sent: Monday, November 23, 2020 at 12:38 AM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: custom-set-faces for various file types
>
> Christopher Dimech <dimech@gmx.com> 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 differently.
Then others can find a number of different constructs to learn from, rather 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.
>
>
prev parent reply other threads:[~2020-11-22 23:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-22 17:30 custom-set-faces for various file types Christopher Dimech
2020-11-22 20:57 ` Michael Heerdegen
2020-11-22 21:16 ` Christopher Dimech
2020-11-22 21:39 ` Michael Heerdegen
2020-11-22 22:04 ` Christopher Dimech
2020-11-22 22:10 ` Christopher Dimech
2020-11-22 22:53 ` Christopher Dimech
2020-11-22 23:38 ` Michael Heerdegen
2020-11-22 23:52 ` Christopher Dimech [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-605ca56b-bb93-43e3-8e64-ca04c22f4cb6-1606089178928@3c-app-mailcom-bs01 \
--to=dimech@gmx.com \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).