unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: Simplification of faces
Date: Mon, 1 Oct 2007 11:18:02 -0700	[thread overview]
Message-ID: <BNELLINCGFJLDJIKDGACAEELCDAA.drew.adams@oracle.com> (raw)
In-Reply-To: <E1IcPGF-0007wm-VY@fencepost.gnu.org>

>     > I am thinking of essentially eliminating the face
>     > attributes as a way to control what a face looks like.
>     > Programs would use only `defface' and `face-spec-set'.
>
>     What about `modify-face'?
>
> `modify-face' is another interface to `set-face-attribute'.  Under
> this proposal, we would get rid of both.

Could you give a simple example of how a current use of `modify-face' would
be replaced with a call to `face-spec-set' or `defface' in your proposal?

I have nothing against doing things differently; I just want to know whether
and how I can still do what I do now (in some way). What I do now is change
only selected attributes of a face, leaving the rest as they were.

>     I'm not too clear on `face-spec-set'. Is what it does now is
>     replace only those attributes that are included in its SPEC arg,
>     leaving the others alone?
>
> That is what I thought yesterday from reading its code, but I see that
> in fact it calls `face-spec-reset-face'.  So it already does totally
> replace any other settings for that face.

That's what I thought.

See my proposal for `set-face', based on that understanding. AFAICT,
`face-spec-set' completely redefines an existing face, but it cannot be used
to create a new face.

For variables, we have `defvar' and `defcustom' that are analogous to
`defface', but we also have `setq', which is not analogous to
`face-spec-set', AFAICT: `setq' creates a variable if it did not already
exist. What I was asking for was an equivalent of `setq' for faces. Perhaps
`face-spec-set' could be redefined to do that, or a new function `set-face'
could be defined to do that.

> So this proposal therefore reduces to eliminating the
> `set-face-attribute' level of interface for controlling faces.
>
>     I hope that I will at least be able to still use
>     `modify-face'.
>
> Why do you want to use `modify-face'?

To modify a face. ;-)
To modify it only partly - only some attributes.

I have nothing against doing that some other way, but how to do that with
`face-spec-set' is not clear to me. Suppose, for instance, that I just want
to set (e.g. replace) the foreground color. How would I call `face-spec-set'
to do that (and still leave the rest of the face as it was defined?

  reply	other threads:[~2007-10-01 18:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-30 12:54 Simplification of faces Richard Stallman
2007-09-30 15:25 ` Jason Rumney
2007-10-01 17:41   ` Richard Stallman
2007-09-30 23:53 ` Drew Adams
2007-10-01 17:40   ` Richard Stallman
2007-10-01 18:18     ` Drew Adams [this message]
2007-10-02  3:32       ` Richard Stallman
2007-10-02 15:05         ` Drew Adams
2007-10-02 22:00           ` Richard Stallman
2007-10-04 16:47             ` Drew Adams
2007-10-05 16:14               ` Richard Stallman
2007-10-05 16:25                 ` Drew Adams
2007-10-07 18:29             ` Michael Welsh Duggan
2007-10-09  1:14               ` Richard Stallman

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=BNELLINCGFJLDJIKDGACAEELCDAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).