unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: Philipp Haselwarter <philipp.haselwarter@gmx.de>, emacs-devel@gnu.org
Subject: Re: Eliminating a couple of independent face definitions
Date: Tue, 8 Feb 2011 08:14:05 +1100	[thread overview]
Message-ID: <AANLkTi=gwEgRz4sXxU6tUydZsTJicDTvxp56T3Pv_w=Q@mail.gmail.com> (raw)
In-Reply-To: <858F4CEE5E7644D2AED7E6574802C6E8@us.oracle.com>

[-- Attachment #1: Type: text/plain, Size: 3245 bytes --]

On Tue, Feb 8, 2011 at 1:09 AM, Drew Adams <drew.adams@oracle.com> wrote:

> T> Ignoring implementation issues, your suggestion appears to
> T> meet the main objective i.e. making it easier for programmers
> T> to do the right thing and have fully defined faces without
> T> having to jump through all the hoops. I would agree that it is
> T> a better solution than using inheritance with semantically
> T> unrelated parents as it does appear to provide a solution that
> T> does not compromise the strict form of preferred inheritance
> T> and a way to improve the quality of default face values.
> T>
> T> I would suggest that in addition to such enhancements to defface,
> T> we need to provide guidelines in the manual on how to use
> T> inheritance and copy and would go further and argue that for
> T> semantically related faces, inheritance *should* be used to help
> T> enhance consistency and allow users to customize a semantic
> T> 'class' in one go.
>
> Yes to guidelines in the manual and yes to encouraging inheritance among
> faces
> with similar meaning/use.  As I said:
>
> d> We would encourage programmers to use `:inherit' when the
> d> new face (its use/meaning/purpose) is related to the
> d> referenced face - that is, when they want a change in the
> d> latter to be reflected in the former.
>
> d> We would encourage them to use `:copy-default' when the
> d> referenced face is unrelated and all they want to do is
> d> reuse its default-attributes spec.
>
> We would encourage them to use one or the other, to get full face
> definitions
> able to handle different backgrounds etc.  And we would explain when it can
> be
> good to use one vs the other.
>
> We would also say why full definitions are important, and perhaps use an
> example
> to point out characteristics of a full definition.
>
> There is an example in the maual that shows using the different classes to
handle tty, dark/light etc. Of course, this doesn't mean it couldn't be
extended/improved.

I do see some possible implementation issues with the copy concept though.
One problem could be determining when to do the copy. If I have face x and
then define face y using your proposed copy semantics, how would you control
when that copy occurs. For example, if I customize face x, how will face y
know the next time emacs is started to use the old values of face x and not
the new customized values? Somehow the defface would need to know to only
copy the values from face x the first time it is defined/used i.e. from the
first session that the face is used and to then keep those values for future
sessions. Without this, you would simply have a form of delayed inheritance,
which is likely going to be even more confusing that using normal
inheritance as the change would be session dependent and time delayed. This
seems like a non-trivial modification to the defface mechanism as it
introduces a new state/time dimension i.e. copy face x attributes unless
face y attributes have already been copied in a previous session.  Maybe
defface could have some type of 'initform' exstension that is used to
configure the face if it has no custom setting. The result would need to be
written to the custom-faces section so that it is only run once.

Tim

[-- Attachment #2: Type: text/html, Size: 3742 bytes --]

  reply	other threads:[~2011-02-07 21:14 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02  4:05 Eliminating a couple of independent face definitions Chong Yidong
2011-02-02  4:11 ` Lennart Borgman
2011-02-02  5:02   ` Tim Cross
2011-02-02 15:15     ` Drew Adams
2011-02-02 17:17     ` Chong Yidong
2011-02-02 20:33       ` Philipp Haselwarter
2011-02-02 23:01         ` Lennart Borgman
2011-02-03 19:10         ` Drew Adams
2011-02-04  0:12           ` Tim Cross
2011-02-05 22:11             ` Drew Adams
2011-02-07  0:59               ` Drew Adams
2011-02-07  1:30                 ` Tim Cross
2011-02-07 14:09                   ` Drew Adams
2011-02-07 21:14                     ` Tim Cross [this message]
2011-02-07 22:12                       ` Drew Adams
2011-02-08  3:51                         ` Tim Cross
2011-02-08 15:26                           ` Drew Adams
2011-02-08 19:10                             ` Philipp Haselwarter
2011-02-08 13:58                 ` Davis Herring
2011-02-08 14:33                   ` Drew Adams
2011-02-08 15:34                     ` Davis Herring
2011-02-08 16:16                       ` Drew Adams
2011-02-08 17:40                         ` Lennart Borgman
2011-02-08 19:10                         ` Davis Herring
2011-02-07  1:08               ` Tim Cross
2011-02-04  0:18           ` Stephen J. Turnbull
2011-02-04  3:55             ` John Yates
2011-02-04  4:56               ` Stephen J. Turnbull
2011-02-04  4:57             ` Jambunathan K
2011-02-05 22:09             ` Drew Adams
2011-02-06  7:11               ` Stephen J. Turnbull
2011-02-04 10:26           ` Julien Danjou
2011-02-04 17:57             ` color-complement for defface (was: Eliminating a couple of independent face definitions) Ted Zlatanov
2011-02-14 18:11               ` color-complement for defface Ted Zlatanov
2011-02-20 17:44                 ` Julien Danjou
2011-03-10 19:09                   ` Ted Zlatanov
2011-03-10 19:11                     ` Ted Zlatanov
2011-02-02 21:24       ` Eliminating a couple of independent face definitions Tim Cross
2011-02-03 16:14       ` Dan Nicolaescu
2011-02-02 17:16   ` Chong Yidong
2011-02-02  9:58 ` Štěpán Němec
2011-02-02 17:05   ` Chong Yidong
2011-02-02 10:05 ` Julien Danjou

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='AANLkTi=gwEgRz4sXxU6tUydZsTJicDTvxp56T3Pv_w=Q@mail.gmail.com' \
    --to=theophilusx@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=philipp.haselwarter@gmx.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.
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).