From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [External] : Re: Could the current font-lock mechanism support font locking code in comments? Date: Tue, 30 Mar 2021 18:09:02 +0000 Message-ID: References: <-vuXfnLB83FOYoLI0Kery7gGaun-l6OFzywSWZ6LMyJTpDGk9ooLIKfJ4xSCkYwNTK9IHgDhtkdxPw7kXZkyaippVgp7CRR3aMz7dbos3og=@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27237"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Stefan Monnier , scame Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 30 20:12:35 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 1lRIqx-0006yQ-83 for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Mar 2021 20:12:35 +0200 Original-Received: from localhost ([::1]:59924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRIqw-0003SI-8w for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Mar 2021 14:12:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRIny-0002EP-5Y for emacs-devel@gnu.org; Tue, 30 Mar 2021 14:09:30 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:47280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRInt-0000Ao-9z for emacs-devel@gnu.org; Tue, 30 Mar 2021 14:09:29 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12UHxEw4050881; Tue, 30 Mar 2021 18:09:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=gHBwpUX/xgWOOxNXMT9lMpnvdEkks+kZdvwL67MmWnQ=; b=BrQt+EILROZr2Ocee2QuJouzPJlt/lD6MKoELO51DfN3h+HspwzKuUutX/DxW1voxr/H W6movFB5n11YxzbwQT38KiDni7l04XSTYusM4gm1BXHlEmTCVMBaPwyX2fwXuqNNns/t 1Q1DGDb/oGe8yH12xunXBy6wl6chpc9//Yg0Ps0jrv6T37IXANi5b9Y9A5sMiKGW4mA1 AhGn3pB1t2mLOTetDqEDEeRSrnBzYEtqrS1vH+O8236ZQwAY7q23COjjCozdQF3TwjyQ Hn+TTgdTvu2MFHm+HXno8JRuIHU2vH+poJ8JgDQf6IqbXv12JmiMKBGer1ivXaX7h0Wr YQ== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 37ht7bgbsa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Mar 2021 18:09:05 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12UI5bDm047970; Tue, 30 Mar 2021 18:09:05 GMT Original-Received: from nam04-co1-obe.outbound.protection.outlook.com (mail-co1nam04lp2051.outbound.protection.outlook.com [104.47.45.51]) by aserp3030.oracle.com with ESMTP id 37je9q2yrw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Mar 2021 18:09:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=THtQS3M183+7ZVGddbNLHrfXAGI4o8jTaxcqiXSUOclr7PBuhWzAZBYgCgw06BTAlO1iLLXrJGurW74uri6FtfwmUhZIwffotjE2WsV7wUIVxAIiaPv9ec/DweAtgJ0GBXE2m7jlzM0T1XgURw/ZXe/U3yW/6fUvkqkIhSiMRu4y+7ZD9tsPYPkdl6uMGKEEux/4WXaM8kSrQLHcFZy8h5OIlUFPookPWB0dkPwax5kmllY8BuoxSf44Ygj6PZY/FlxysEIsWZTh2gE2NWz3PKvKlO9X+aUCaEoxfATg8LOYFz+51bVKv8skFtwAjKb6RZAm/kDTwBnaKrhKbpMDKQ== 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=gHBwpUX/xgWOOxNXMT9lMpnvdEkks+kZdvwL67MmWnQ=; b=RtsmztfZFTj9wvoVjrZD038yHdi7n4S15LMyOzU69+dPvG3cm6bwMpEQiolAJnUQw1CgKphKBe6tcxI7Eeu8HI2aJtjegXprtpFH4iKHgHZPG+XwjAqJY7TouKMqsVLtAFbSvId8scDjmjK8LMLPTqvBLb8My6dCBxBZ3pJzANH+eI1m2sAUWoLLC0YB48WBwQCa72gmzMxrAAfDG5y5KfoJAqeC01j/Muwo5tqZDlue3OVk130zITtjwM2GpwMZ7zVfu0s0jWIjC9hH8kezkLHWaXdG/SJwzo3CXEozos1qa5a/BmkOfj1VQYfyX71Htz46tSaaSlBPrJEFtJlmzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gHBwpUX/xgWOOxNXMT9lMpnvdEkks+kZdvwL67MmWnQ=; b=twLJQKomb6ydKIrvMp8ytjS3l9WCZW4/ocfND0kFFafOhrc6iS2ckA8HcGy6uJ5WaHCwIYKO1HQ70ryAJ7U/2UCbd+WLcJmvDg4hwIbXAEpCrR5QWovRQowsMrzV3vfoEo6AQ7o34S7eaZY3WOkS8lut6PT5nC0k2jSCbALkDEQ= Original-Received: from CO1PR10MB4466.namprd10.prod.outlook.com (2603:10b6:303:9b::10) by MWHPR1001MB2398.namprd10.prod.outlook.com (2603:10b6:301:2f::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.33; Tue, 30 Mar 2021 18:09:03 +0000 Original-Received: from CO1PR10MB4466.namprd10.prod.outlook.com ([fe80::6c75:86a7:a64:6c72]) by CO1PR10MB4466.namprd10.prod.outlook.com ([fe80::6c75:86a7:a64:6c72%3]) with mapi id 15.20.3977.033; Tue, 30 Mar 2021 18:09:02 +0000 Thread-Topic: [External] : Re: Could the current font-lock mechanism support font locking code in comments? Thread-Index: AQHXJYCBIVGWntwTj0+0IqGb9sW57KqcyvZQ In-Reply-To: Accept-Language: en-US Content-Language: en-US authentication-results: iro.umontreal.ca; dkim=none (message not signed) header.d=none;iro.umontreal.ca; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a2bf561-c872-4a96-98d1-08d8f3a6e662 x-ms-traffictypediagnostic: MWHPR1001MB2398: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: t80QRujURSb9Hf00MnJkQAFSz60PeAIkxN9kMkJciVdPRNqxP4eXxK4ig3afmw6CdiW+K54F+hwAGK/x04RUhX9B9WAZBZoDu1Qjl2V2n0TQzf464ynaWFybZdwFWwA5KBNxAjeOYautCW4jUuZrQYvVLyReXUzEl4JfNk0bP6RMi7jkaHKCkSkhFkqLICa1UKdVlJ7IfVVZEkVOTq3zAMNYq46bSufZHbIZ2ae6D6ahXViNjk0fvsGayzYY7u5MkoqhmmtkIPoinFaUFDQG64LFiiurmQ2Y8C6BN7dYh06yD+DZIrd/Yb8eFblpYm7Lz2OlUVDOZFi0F3cK0d4RV2BiULSF+G+BQleAEaxjxmdRnd3CtYwbf1rZcR89A85wymWkI1qO8uK9adGSJ6fzhNvjOfHO8NI7KEiDiJpVN0CB2AEGWqCBRnQ3q3oat/hksCVv5DgdoYXEdnmRVY2NfYaxVYIf0hdtSfStTLO7bihhuSNkzxB6h0Nm30FHwIzjp0o5elciV64MneUQPkHHfFKOzq55/xndJ8VoQAgxoPw2BdJii+7ZnXE3KsaXvjGVh3UJSG3ni04sAKL0egGsYOORXPrzo2Z/LPoq29yeYRpXuYeNHt+gWjvbY5Sfi6Uowhh3tdLTAl9FVja1+GOlRa1s/WC5iYfwyVvaX1sDCTaXWhhoOSttoc9rDyZxzpkpdUxNEZbO58qYU7xXbj/KjF2Z+vKs4TUbzbZXX7Ka+/I= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(376002)(346002)(136003)(366004)(6506007)(83380400001)(4326008)(33656002)(44832011)(296002)(316002)(55016002)(38100700001)(71200400001)(9686003)(186003)(86362001)(966005)(7696005)(2906002)(64756008)(26005)(110136005)(8936002)(52536014)(66476007)(66946007)(5660300002)(66446008)(66556008)(478600001)(76116006)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?nVpcyYgtWbwNxSb9pcvx0dbMjzbYJ5SFXpj5YR4Sw7Jaz4C1CWAuFN52qMbu?= =?us-ascii?Q?dTrKS04ppgWRSenuLf+/+0aeIXBYzNEE7qcnN0I7n6Urfk9pjBB5uCxczWoT?= =?us-ascii?Q?ZxdLOXg2ogrVGkRVNdyuT10/y9ngf/pYZqZwpAOZsr6CVlc8tV2LqgFUhdh7?= =?us-ascii?Q?3P/4EehUP9+RlehqxWpORhBslr1YSK5ztkwwtUpsIfnjW9M/cK7Jn4z4hcqo?= =?us-ascii?Q?I4VsaFpmeic0ad1PHFL7wqHFBf0gbdjNkK7KqZNbeB2pJPmG1iZoxZpA1Sql?= =?us-ascii?Q?2h67apWO0yciU6iS8dJj7WEKJ7apU9FKHxEu3cCjloR2jNl1MzCxxbASKBN2?= =?us-ascii?Q?QORMgOSutV8zwewpHB3RWK7iJWCbbsmAYdk+Lh2PMJ3LGlVvvGq/X44Rx+iB?= =?us-ascii?Q?KbSodp1sl8pqhxhPRpoHjhPwOuIIp5JW+ZOpHRf/sMHfRQhFb20mf7nvLpKv?= =?us-ascii?Q?NXom8o7KObAhBjhEHCt5S7kodfFOCFnxPDiYOcEf61VNQQT/WNQwPZOIS3Ag?= =?us-ascii?Q?yoEJl/zRW7YZOEX5CpLv0jtr/dgCe7ncDkO4FeyjkqhG5RD8p6R39TFqwEqW?= =?us-ascii?Q?HnV/lxAEUpywuqSLDtTUFlAfZormLOTzPTVTOjl73eBQu2tXli59Wx55U5OF?= =?us-ascii?Q?uM7R x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a2bf561-c872-4a96-98d1-08d8f3a6e662 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2021 18:09:02.7590 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Hzywv0XA2eXL8hGdpvdumpW3CvjGXFm+WFG//VnA74reVRSIGMgbYTHW8OueaN+UOcO8kZg+ZoCfHGa1pDsPVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1001MB2398 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9939 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 bulkscore=0 mlxlogscore=890 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103300132 X-Proofpoint-GUID: _GFngNPDNhb30RmHEjRFhmP5ntPawfxS X-Proofpoint-ORIG-GUID: _GFngNPDNhb30RmHEjRFhmP5ntPawfxS X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9939 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 clxscore=1015 mlxscore=0 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103300131 Received-SPF: pass client-ip=141.146.126.79; envelope-from=drew.adams@oracle.com; helo=aserp2130.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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:267189 Archived-At: > > 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? >=20 > 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