From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: Stealing a default face from a non-ELPA package Date: Sat, 05 Mar 2022 20:46:47 +1100 Message-ID: <87v8wslmwu.fsf@gmail.com> References: <87zgm4lst1.fsf@gmail.com> 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="27141"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.9; emacs 28.0.91 Cc: Brian Leung , emacs-devel To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 05 11:22:37 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nQRYa-0006v6-HV for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Mar 2022 11:22:36 +0100 Original-Received: from localhost ([::1]:39792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQRYZ-0004eh-AR for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Mar 2022 05:22:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQRY1-00040T-JT for emacs-devel@gnu.org; Sat, 05 Mar 2022 05:22:01 -0500 Original-Received: from [2607:f8b0:4864:20::631] (port=46924 helo=mail-pl1-x631.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQRXz-00071G-G5 for emacs-devel@gnu.org; Sat, 05 Mar 2022 05:22:01 -0500 Original-Received: by mail-pl1-x631.google.com with SMTP id bd1so9840461plb.13 for ; Sat, 05 Mar 2022 02:21:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=+xkkruoZoJGUDHkHdp803TNaQZlJ3uEKEtXM3XvFR0A=; b=V1BnjKfal0vbu8LMssMuggKQ+rseSzdJX92SzzyyasShRAU2Mw9tmRtIYP8BWOhjfV roKXUuAuIlBi2jtaCAV1+A+wQTQn1jjk4n92jp6DzPgdVbOcjo492y6LzjLqva1hlwJE Xn95R1CN6Oow7ThV0GfdsbFgwp2+2v4iF0C0NprbItqN3XU1IgDO/RiJeVp102Oal3l7 MMGU/Mo2NW7akeOK7TRdSdTEZi4J97/R+HDYwL2lASER2RlZgoP9hm2D1QA9jWmoIcnH VZ4jmZVCLdtdRmGNJMBet93CBdB3bJAcTs4qGXTKwdDZR751+oR2uahRQpgIpdslrEiU biKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=+xkkruoZoJGUDHkHdp803TNaQZlJ3uEKEtXM3XvFR0A=; b=an5iVUtdlgm3sAhvqM5G1c5kEoAootKg9LT0M80n1zebPxkVoqGoRkWluNvfRgJeqZ wFCPzk+5hlcQYCU6riqGr4/fAbQoW/Zx1Ru4uBRMW/z63HdMkq4+oBtA2ub3/tK7j64M jEaJHNlBIS/Z3eVZ/qW+roLaG0qIaSIH8RCwysk3JP44xIXtQoGd4aRJrhiwz8Go40pI yRDfVvrknNDn1Q2mj2R6HN3XstjMtWYbD87lj4Y/tQ8TeKzd9J8/LLmukTcqBWY3SYeY Y7pt/Z+BT/oHw02hkG1lL5paIccus2wogfHswGYYld9+/WT1/GybJiP1lyeu9QtEgQ6+ c9Fw== X-Gm-Message-State: AOAM533dnHDYLn78CmxYUpqQ/BcZ7U+oEoUZg6XbSeyOcKLnlr2jkMVS VzAMydon5oAMOLVt/Qx3Eo2v14ZeCEw= X-Google-Smtp-Source: ABdhPJyKCHKJlkd/vCbM1LZlveyBcrj1rKjksOq+gAdvu9Pu+l1b7zO9vRJYsDM/4Ne+4U3FpvH7ZA== X-Received: by 2002:a17:902:900c:b0:14d:81e9:75d with SMTP id a12-20020a170902900c00b0014d81e9075dmr2730974plp.69.1646475717592; Sat, 05 Mar 2022 02:21:57 -0800 (PST) Original-Received: from dingbat (106-69-94-169.dyn.iinet.net.au. [106.69.94.169]) by smtp.gmail.com with ESMTPSA id f7-20020a056a0022c700b004e11d3d0459sm9188128pfj.65.2022.03.05.02.21.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Mar 2022 02:21:57 -0800 (PST) In-reply-to: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::631 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286836 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > Hello Tim, > > The goal here, I think, was not to decide if the change had merit or not.= As far as I understand there are demonstrable functional > problems with the faces default settings as chosen by Brian himself. > > I presume Brian is just trying to fix those problems, a legitimate goal t= hat cannot be left to "theme authors". There is such a thing > as the "default theme" and we are all its authors. > > Brian is just asking if it is "legal" to take inspiration for decorative = face settings from a different project outside GNU ELPA. I believe > it is quite legal, but I'm not a specialist so suggested he ask here. > I understand. For the default value of a face, I think the key is to look at the documentation of defface and use the facilities it has to set a default based on the local environment. For example, use a face spec which sets a different foreground colour based on whether the user is using a light or dark theme, is running in a GUI frame or a terminal or console etc. Just using :foreground "grey" is unlikely to give adequate default face specification for all environments. Defining good default face specifications is harder than most people realise. One way to simplify things and get a reasonable default is to define the face to inherit from one of the standard built-in faces. For example font-lock-warning-face. These faces have been implemented to have reasonable defaults for most environments and provided they are wrapped in a defcustom, the user can customise to suit their personal preferences if desired (including turning of the inheritance). I don't believe there is any copyright issue here as you are not using any lsp-mode code. You are defining a face, using standard Emacs facilities and setting its attributes. lsp-mode has no copyright over face attribute values. Personally, I wish more packages would define their faces in terms of inheritance from standard/built-in faces. This would mean a user could tweak the built-in faces to suit their preferences and the additional packages would inherit those tweaks without needing to be done individually.=20