From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: Could the current font-lock mechanism support font locking code in comments? Date: Wed, 31 Mar 2021 02:10:07 +0200 Message-ID: References: <-vuXfnLB83FOYoLI0Kery7gGaun-l6OFzywSWZ6LMyJTpDGk9ooLIKfJ4xSCkYwNTK9IHgDhtkdxPw7kXZkyaippVgp7CRR3aMz7dbos3og=@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16924"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: scame , Stefan Monnier , "emacs-devel@gnu.org" To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 31 02:12:27 2021 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 1lROTB-0004Jp-Md for ged-emacs-devel@m.gmane-mx.org; Wed, 31 Mar 2021 02:12:25 +0200 Original-Received: from localhost ([::1]:35108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lROTA-000119-LO for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Mar 2021 20:12:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRORV-0008CE-6J for emacs-devel@gnu.org; Tue, 30 Mar 2021 20:10:42 -0400 Original-Received: from mail-oln040092068074.outbound.protection.outlook.com ([40.92.68.74]:52483 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRORO-0005Kg-DB for emacs-devel@gnu.org; Tue, 30 Mar 2021 20:10:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a6Y7ISyZLvJynDVwjMtrWljXW6aq09MOOnyKz5Om2IQas4KEC+FNU4yX2nykt/Iy4XCep42kkhkmxlYgld5TIVAThZLoZcgSQvG9pBqau95JxLoBhq94ZupY91mo0pEML3jxZmxXTMxCnV5jlUkS8Qzu3Mqvj+je+z0s5EF7+KSoLzEvHZcw/LM+KBhHsY2AsQ83wblsF6/cPbeLq4pVeGJh7jhVdv7VEvGvp3uhlUWvDfE+WlYiMuNjucF1Q74kHBNZfBxHbgP/mhUBKFdJ30jEB84g32ofgnz2XkMvSKX72oqiiCSdDst6kp6X1RUqaCNWfkmijubEs7xte5sEjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lX+NnzaH3X26wJCHdBGaObMdPbm4z7eHK0JuYp0BwAQ=; b=nJ0AvQH2qlJzer7dgNK8YcvzBh68BVrqe1qgzPMAJGcs2wHv5mJ+taZIZOe2kEg2shQqQXliNseqjXhyBI3/zCgKYL/38UAOUE19S66HEvn7xz0Y0kO8hdolaBWAJjJ620Z33EPuaDUKyzdwEAnIwB2Pm4RmEAsDtBlPPk8AxrhELFwZ3T4P1hwSfq72YPCBofC3roM8W4oi1XwtutRMIExPCtqZ1uYcRP0SWMFpIlMDFkHFG2FRTf6iU0SI2pDqXQ5RKmB10HgYpp+15F7dvmX307h7mfH6vRKFeMQO5V7s7T7WDHuYvtNYYnNCyN3No+8f871ARTvjk6UAH8LAjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lX+NnzaH3X26wJCHdBGaObMdPbm4z7eHK0JuYp0BwAQ=; b=iBie0JiQkWY44qxIlPH/yf1g1Hag0Dv+SsrUq/Ya23sEPTUDh0FJ3kxIylLbTBJXebTvnGcFhTRIj3QD008Lo5CXyc1ITnoZU3JaWThWYsgfmY6951w9SMusIOVXyXXZ/WhJNFOMY7Nyd1yiXEODHW4SVDvSDh0lzU5Ks/DjlNTuSVzL1BQuErsYedMJ9zV7kkOj9m3tUnqUgAPK/Yzb80t8++Xoz9lkcgViRoFLb4Qi+Nv9u5dogfWCB8j2QYgNuH8rXDEdsKhd/Yq0MgadtU9XSj3PqGx+10QV3lTRG88cV7FTKDDAczHGKauJSjmwl74DWBl+tSDBkuc6FxxFhQ== Original-Received: from VE1EUR02FT009.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::4b) by VE1EUR02HT177.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.29; Wed, 31 Mar 2021 00:10:28 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e1e::4b) by VE1EUR02FT009.mail.protection.outlook.com (2a01:111:e400:7e1e::226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Wed, 31 Mar 2021 00:10:28 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:881BC8764894AECAC967C155B820317597619CC3ABF17D3A17BA3828D33D6102; UpperCasedChecksum:88D67593583A196B4E88EC0748156F7270B117E5B4F7983B5A7DC0E3CCCE5815; SizeAsReceived:7991; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b%6]) with mapi id 15.20.3977.033; Wed, 31 Mar 2021 00:10:28 +0000 In-Reply-To: (Drew Adams's message of "Tue, 30 Mar 2021 18:09:02 +0000") X-TMN: [sP+iYswQrReMUgjnNgQ9+bPj7TAnwBt0] X-ClientProxiedBy: AM5PR0502CA0022.eurprd05.prod.outlook.com (2603:10a6:203:91::32) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82czvgxjxc.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AM5PR0502CA0022.eurprd05.prod.outlook.com (2603:10a6:203:91::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26 via Frontend Transport; Wed, 31 Mar 2021 00:10:08 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d80def5f-cfe7-48a8-5f09-08d8f3d95acf X-MS-TrafficTypeDiagnostic: VE1EUR02HT177: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ks5CWzs790E3UaFWEoENCMYWMSQOyyFNoCXgsMdcoSTHU2yuJUuvDspAugzIE/RT3a+Xy/4+KMcbxiH8Y2ie8nvIau8tNSHPPbIa5aIVwVa3NXfXgCIjBcryeD8wCeWB2Cu33qmNAaQT5bPuWIvVOgYXFD2AeYsQ2KnQv4iRlRSg+kohnJsxEYhV0I/B4V/DDEIFAL8zgeH0gKAbBDxoQjt7hcg5x3JI6xnbIWlFPydkBDfcaGj9+xj90YSUVLdMYbxtvZWIpdN2bGT5uoWEJTnluJHFnEobaWrzar0IwFpKRwsBYM6SxjntD0LiQXQmpxmhNXvhqPIAy6/GbWkaA3iL+45KnQQTdtNa1exQkHihlx20xVCWcgdYH7M4PBthbpNuZxV2RflaRSLty2eiip/BjNqSqxjs68bvkyH4Lu5inw2ZoW2YFdyjTK6T8H3f X-MS-Exchange-AntiSpam-MessageData: QpaO2ctgbH4VtioVnIDOWIjUxpM6GAGwEmMDV0HchAz7OeOvkdB9cQdhBoQu+sxMrgIcSGFmG6OnoJ5wReaG/SGDtGkIVNK+N3cIaWbkrbd9QKtsOnxNWkS3BB9vcANxd7cg99KjWzrxWzU7jBIfhA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: d80def5f-cfe7-48a8-5f09-08d8f3d95acf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 00:10:28.0665 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT009.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT177 Received-SPF: pass client-ip=40.92.68.74; envelope-from=arthur.miller@live.com; helo=EUR02-HE1-obe.outbound.protection.outlook.com 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:267198 Archived-At: Drew Adams writes: >> > the comment starter // should have regular comment color and the code >> > inside should be syntax highlighted with dimmed colors of the regular >> > faces. >> > Does this complicate things? >> >> Yes and no: AFAIK Emacs's faces don't support "dimming", so you either >> do it the hard way and get what you describe (which requires creating new >> faces and hence knowing which faces are used by the current >> font-lock-rules, etc...), or you take the easy way out and just apply an >> additional face that marks the commented out code in some other way >> (e.g. by adding a background color). > > Vanilla Emacs might not have dimming, but Emacs has it. > > Library `doremi-frm.el' provides commands that let > you incrementally dim or strengthen a face or frame > foreground or background. > > WYSIWYG - you can see the change in a sample, with > an original sample next to it, for comparison. Hit > `C-g' to cancel the changes, or `RET' to accept them. > > For example, command `doremi-face-bg+' changes the > foreground color of a face. You can change any of > these color components at any time, switching to > another just by typing its initial letter: > > `r' - red > `g' - green > `b' - blue > `h' - hue (basic color) > `s' - saturation (purity) > `v' - value (brightness) > > `R' - red, green, and blue, at the same time > `H' - hue, saturation, and value, at the same time > > For example, you can type `v' and use the arrow keys or > mouse wheel to change the value component, then type `s' > and use the arrows or wheel to change the saturation > component, and so on, all in the same call to the command. > > Depending on what kind of "dimming" effect you want, it > means changing the value (brightness) component or the > saturation component, or both. > > `doremi-face-fg+ does the same thing, but acts on the > face foreground, not background. And `doremi-bg+' and > `doremi-fg+' act on the frame foreground and background, > instead of those of a particular face. > > `doremi-frm.el' requires these other libraries. All are > available on Emacs Wiki. > > `doremi.el' > `hexrgb.el' > `frame-fns.el' > `faces+.el' > > Doc: https://www.emacswiki.org/emacs/DoReMi > > Code: https://www.emacswiki.org/emacs/download/doremi-frm.el One way is, maybe, to use theme that support different shades of color such as B. Batsov's implementation of Solarized. Solarized ahs 8 base colors and 8 accent colors. Batsov has introduced 8 brither and 8 darker shades ot those 8 accent colors. A theme creator could use that scheme to create a syntax highlight scheme where normal syntax colors uses those 8 accented color and brighter/darker accents in comments. I am not sure about the approach, just an idea.