From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Introducing face in comments for various modes Date: Mon, 12 Dec 2022 11:55:09 +0000 Message-ID: References: <9ZK1Solghrmps4AarUsz2E6-mAdkrTZoXPs4RTRTd9sZ0Cd8DGhK955im1kuug-EZXU3tc5rgDDd16vQexxpFnMvMFjFqnNnh0noashyLdE=@protonmail.com> <0RJB0bPRTMAqXlUbL2kGUvJtnCNPYwPhqTNi_l9nIpQAciTZYcYCikFVqi2Nr_UZLbT1_DRtX8G0dSkgI4jln5DTYBDxLz4i7L2d9wx-kA8=@protonmail.com> <21708ec2-d908-4e91-6c0a-4b1cd253e707@gmail.com> <009361a1-4430-ac3a-f395-ce32f10b31f2@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="13803"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , help-gnu-emacs@gnu.org To: Thibaut Verron Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 12 12:58:55 2022 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 1p4hSP-0003HD-Il for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 12 Dec 2022 12:58:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4hPS-000368-Ho; Mon, 12 Dec 2022 06:55:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4hOy-0002qe-0C for help-gnu-emacs@gnu.org; Mon, 12 Dec 2022 06:55:22 -0500 Original-Received: from mail-4318.protonmail.ch ([185.70.43.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4hOv-0006HZ-5c for help-gnu-emacs@gnu.org; Mon, 12 Dec 2022 06:55:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1670846113; x=1671105313; bh=pWiMSyw299XDdNXBFl/KT8zNZJS80xdJnu0y4JYE7/c=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=wQuAAlrgyFvSh1t3wpZMc20FVWqq9LFZLBB/lsl8VINX2/emrlC4eHl8a+xEfgSBG WJr6rlRYxro7eucmCZi7JQL/5H+jChISbdBdTAsts/jgNu5JqpECxASv0waPNTk+Qo 1R0oLqiPFl+L31cMaduAUT2Gi+tTgfqkXQ/4PjYyRWYg6ZtQfpbOnYom48Bl0Rr8+k QWvG4cnnG0a5BMlUsM2IuxrSYFbPMEsIY0wexJNGTA5m1OmkXb9/TcKwQ2AGkaDCQe 00/gp1lhp+NQdaII0Ac1C/B+fX2zsu6zUf0Gd7h5xpQalq2abdsGWAMa6vbefJxiBN O5cjZxvhB374g== In-Reply-To: <009361a1-4430-ac3a-f395-ce32f10b31f2@gmail.com> Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.18; envelope-from=heimeborgia@protonmail.com; helo=mail-4318.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141672 Archived-At: ------- Original Message ------- On Monday, December 12th, 2022 at 10:50 AM, Thibaut Verron wrote: > On 12/12/2022 11:20, Heime wrote: >=20 > > ------- Original Message ------- > > On Monday, December 12th, 2022 at 9:58 AM, Thibaut Verronthibaut.verron= @gmail.com wrote: > >=20 > > > On 12/12/2022 10:21, Heime wrote: > > >=20 > > > > ------- Original Message ------- > > > > On Monday, December 12th, 2022 at 8:49 AM, Thibaut Verron > > > > thibaut.verron@gmail.com wrote: > > > >=20 > > > > > Le lun. 12 d=C3=A9c. 2022 =C3=A0 04:01, Heimeheimeborgia@protonma= il.com a > > > > > =C3=A9crit : > > > > >=20 > > > > > ------- Original Message ------- > > > > > On Monday, December 12th, 2022 at 2:24 AM, Heime > > > > > heimeborgia@protonmail.com wrote: > > > > >=20 > > > > > > ------- Original Message ------- > > > > > > On Sunday, December 11th, 2022 at 5:40 PM, Stefan Monnier via > > > > > > Users list for the GNU Emacs text editorhelp-gnu-emacs@gnu.org > > > > > > wrote: > > > > > >=20 > > > > > > > BTW, there is a related convention in ELisp code where > > > > > > > comments that > > > > > > > start in column 0 and which are introduced with 3 or more > > > > > > > semi-colons > > > > > > > are considered sectioning headers (where ";;;" means a top-le= vel > > > > > > > header, ";;;;" a subheader, ";;;;;" a subsubheader, ...). > > > > > > >=20 > > > > > > > I'd be happy if Emacs were changed to highlighting those. > > > > > > >=20 > > > > > > > Stefan > > > > > > > If you are colourising "Sectioning Headers", ensure that vibr= ant > > > > > > > and good contrast: > > > > >=20 > > > > > 1) betweenthe text and the background; > > > > >=20 > > > > > 2) and between a header, subheader, subsubheader, ... > > > > >=20 > > > > > Use some colour metric (e.g. using the Web Content Accessibility > > > > > Guidelines [WCAG]). > > > > >=20 > > > > > Because I consistently see that developers almost never care (or > > > > > have the skills) > > > > > to properly set up colours. Have suggested changing the colour > > > > > scheme as described, > > > > > for "Org Headings" because they are indistinguishable against a > > > > > dark background and > > > > > between a heading and its subheading. Applying such metrics have > > > > > been turned down, > > > > > with the excuse that if I want them right, I have to work on > > > > > emacs customisations > > > > > myself, as the crappy colours are there to stay. > > > > >=20 > > > > > > The colors of the standard themes are chosen with its (light) > > > > > > background in mind. If you change that background, it is not > > > > > > surprising that things fall apart. > > > > > > Choosing colours with a light background in mind is the wrong a= pproach > > > > > > because colours produce far greater visual > > > > > > impact. > > >=20 > > > There is no right or wrong approach, but individual preferences. > > > Standard metrics exist. The Gnu Project like many others, does not > > > want to use them. >=20 > You're moving the goalpost: the sentence I quoted claimed that "focusing > on a light background is the wrong approach". Having worked with modus-themes, it was concluded that there exist greater variations in possibilities with a dark background that with a light one. =20 > It's also factually not true that the GNU project does not care about > readability metrics, especially now that the Modus themes are shipped > with Emacs. >=20 > > > If you want a dark background, just use a dark background theme. For > > > instance, emacs has a built-in implementation of the tango dark color > > > palette. If contrast if your primary concern, you should look at the > > > modus themes (modus-vivendi for the dark background), which is also p= art > > > of emacs now. Yes, contrast is my primary concern on some packages. > > > M-x customize-themes and make your choice. > > > If you use "modus-vivendi" for org-mode, the colours are all almost w= hite, > > > a big problem particularly when you fold the org headings. >=20 >=20 > I don't like dark backgrounds, but it seems perfectly readable to me. I personally always cater for both light and dark theme. =20 > Anyway, from personal experience the developer of the Modus themes is > extremely responsive. If you have a problem with his themes you should > take it up with him. Will let him know. Perhaps there are some problems there he can see. =20 > > > > Rather, there there should be carefully chosen colour settings for > > > > both light and dark backgrounds. > > >=20 > > > That's how you end up with settings which are at best acceptable, but > > > not perfect, for both light and dark backgrounds. The range of colors > > > which are suitable for both light and dark backgrounds is just too na= rrow. > > >=20 > > > The proper way is the current way: carefully curated themes implement= ing > > > all colors in a consistent ways. > >=20 > > What metrics are being used. The blind belief that the proper way is th= e > > current way, is the origin of the problem. >=20 >=20 > For one, the Modus themes were developed with quantified metrics > (minimal contrast ratio afaik), and they are two completely different > themes for black and light backgrounds. >=20 > If you think you can do better, you are welcome to try. But if you come > and claim that the current way is the wrong way, the burden of proof is > on you. :) I worked on the enhancement of modus-themes. =20 > > > > > > It is not a new problem, but it doesn't mean that you have to > > > > > > customize all the individual faces yourself. Instead, you shoul= d look > > > > > > for a theme implementing > > >=20 > > > > > > the colors you like, and install it. The responsibility for hav= ing > > > > > > consistent colors across all emacs fonts is on the theme design= er. > > > > > > You can still tweak some > > > > > > faces from there if you choose to of course. > > > > > > At any rate, Stefan's suggestion would not require making new d= esign > > > > > > choices, as there are already faces designed for fontifying hea= ders: > > > > > > outline-1, outline-2, etc. > > > > > > Making a new design choice is a necessity if you want to move f= orward. > > >=20 > > > No. The question is whether to fontify those headers, how to identify > > > them, etc. > > >=20 > > > That's completely separate from the question of changing the face > > > currently used for headers in other places. > > >=20 > > > > > Those faces are used by outline-mode, but not by outline-minor-mo= de > > > > > (which emacs-lisp-mode uses to implement the ;;; comment headers)= at > > > > > the moment. > > > > > Which proves my point that changes are necessary. What needs to b= e > > > > > done is for colour contrast metrics > > > > > to be taken seriously by all packages, rather than relying on som= e > > > > > theme to fix the crappy default choices. > > >=20 > > > Sorry to be blunt, but you couldn't be more wrong. For a start, > > > outline-mode and outline-minor-mode are the same package. :) > > >=20 > > > But more to the point, with the current system, packages choose exist= ing > > > faces to implement coloring based on what they should color (e.g. is > > > it a comment, is it a header, is it a keyword, is it something > > > important). And the theme designers choose colors (and other features= ) > > > for those faces. > > >=20 > > > As a result, colors are the same across all of Emacs (for example > > > comments look the same in elisp and python), and -- if the theme make= r > > > is competent -- the colors will implement good contrast and be readab= le > > > everywhere. > > > One can at least use good metrics for light (white) and dark (dark) b= ackground. > > > We have not even arrived at that yet. I am not arguing against commen= ts looking > > > the same, but that there should specific settings for the canonical w= hite and > > > black background as minimum. >=20 >=20 > And I am telling you that there are. >=20 > For light background: the default theme, leuven, tango, modus-operandi >=20 > For dark background: the default theme with inverse-video, tango-dark, > modus-vivendi >=20 >=20 > > > If instead we were to let each package decide on its colors, Emacs wo= uld > > > look like a Christmas tree with different colors all over the place. = And > > > most of them would be really crappy because the package developer was > > > never trained in graphic design, or because they didn't plan for all > > > possible background colors (it's not as simple as light and dark, som= e > > > people use blue, or green backgrounds), or because they didn't predic= t > > > that their choice of color would conflict with the choice made by a > > > minor mode in another package, or... > > > Am only discussing for white background and black background, which a= re the > > > canonical settings for printing. With colour contrast you are limited= by > > > the metric values which limits to about eight colours. > > > It is not Christmas Tree as you say. Focusing on any possible colour = combination > > > (blue, or green backgrounds) is beyond the scope of my discussion. >=20 >=20 > No it's not. My point is that if you leave the responsibility of > choosing colors to packages as opposed to themes, it will be a Christmas > tree and there will be unpredictable combinations. It's a direct > consequence of your idea, you can't just wave it off. >=20 > It's already bad enough now with some packages defining their own faces > without at least inheriting from the standard ones. Right. My focus has been to provide colours with good metrics so that=20 people inherit from the standard ones. =20 > There are currently 5330 packages on Melpa. Do you plan to contact the > authors of all of them individually to get them to implement your > preferred colors? To start using actual standards. Absolutely, they should learn more and ch= ange their packages. =20 =20 > With the current approach, on the other hand, it's very easy: report a > bug for the theme you're using, or make your own theme if you really > want to. >=20 > > > You shouldn't think of themes as "fixing the default choices" > > > (especially considering that you are the one "breaking" them by > > > insisting to use them with a background they weren't designed for). > > > Their purpose is to implement different choices in a consistent way. > > > Good design in much more important that consistency. >=20 > It's also much easier to achieve in a consistent system. The argument is to design separately for light and also for dark background= . Emacs does have light and dark checks. =20 > > > > > > > Heime [2022-12-11 15:35:41] wrote: > > > > > > >=20 > > > > > > > > The following uses `hi-lock` to change the foreground of > > > > > > > > comments matching > > > > > > > > a regexp. This is implemented for emacs-lisp files where > > > > > > > > comments start > > > > > > > > with ";;". > > > > > > > >=20 > > > > > > > > I would like to extend this for other programming languages > > > > > > > > besides emacs-lisp > > > > > > > > files, using the relevant comment character automatically > > > > > > > > for that language. > > > > > > > > (defface elfa-face > > > > > > > > '((t :foreground "magenta")) > > > > > > > > "Face for comment headings.") > > > > > > > >=20 > > > > > > > > (defun elfa-regexp (&optional actm) > > > > > > > > "Identify comment category ';; [Category]'." > > > > > > > > (highlight-regexp > > > > > > > > "^;;\s+\\[.+\\].*$" 'elfa-face)) > > > > > > > >=20 > > > > > > > > (defun elfa-category () > > > > > > > > "TODO." > > > > > > > > (interactive) > > > > > > > > (add-to-list 'auto-mode-alist '("\\.el\\'" . hi-lock-mode)) > > > > > > > > (add-hook 'emacs-lisp-mode-hook 'hi-lock-mode t) > > > > > > > > (add-hook 'hi-lock-mode-hook 'elfa-regexp))