From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: goncholden Newsgroups: gmane.emacs.help Subject: Re: Customisation for Comments Date: Fri, 11 Feb 2022 20:14:07 +0000 Message-ID: <1AU0hzdbC1U_BvDCtw-1uDqhnf1mJ6xRlz3jOEWF5lh0TqU56XVQMibCipjQWArxTsUkrAktC2AGvrO1sZed-koBvPMfXINA-mXowljXOh4=@protonmail.com> References: <87czjttdmh.fsf@zoho.eu> <878ruhtcmb.fsf@zoho.eu> <_8nnLBMzH_CPdwBGJD5nvSCcTQn7F4nGwKrnU7o5DipOewQDZ_O7zsBU3xpSR5VzthpPII7FrZazGGcGbJKfjQK38iFcYRsWdNfu_xQ4w9c=@protonmail.com> <874k55tbh4.fsf@zoho.eu> Reply-To: goncholden 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="21256"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 11 21:16:17 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 1nIcL2-0005JP-QB for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Feb 2022 21:16:16 +0100 Original-Received: from localhost ([::1]:34294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIcL1-0003WI-7d for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Feb 2022 15:16:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIcJ4-0003Az-4D for help-gnu-emacs@gnu.org; Fri, 11 Feb 2022 15:14:14 -0500 Original-Received: from mail-40132.protonmail.ch ([185.70.40.132]:45896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIcJ1-0001er-2D for help-gnu-emacs@gnu.org; Fri, 11 Feb 2022 15:14:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1644610447; bh=dN3lSt3h4J21wQEgMRL0f4nnHSy2dw3bxZkAcdAeKCE=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=MCr2ecAHoEnNf3LIvqOVjhQfO6b14PzxfPaxYeXn5o1P/IgU3Y0XWwnBIwlgsDwcW nC5fGyrggNVOqOerWIOzJIo5cSsrUVf0m7PvDu0GvkJ7pu1Mc2pCqRb+KR0cLOm0ex CjsfP+coq4YpihNk89LXFub2ybphigxDZ38ruk5595owH2a1B5sEJIBn9AKxOsbsg3 2cDcVxAQugMgQJ269uYoY7n5MsI1V8PlaAFcTBPpdkJmydQQVUca7DZ/SYLs0h0Bjb zoHRBuj7WAR//hdcq+NVuLLQLISDGXd1FO83VU+0vtvdcBhvjLoeGVXCK0sGBf+BKy buiRkkgfkROaA== In-Reply-To: <874k55tbh4.fsf@zoho.eu> Received-SPF: pass client-ip=185.70.40.132; envelope-from=goncholden@protonmail.com; helo=mail-40132.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.help:135902 Archived-At: ------- Original Message ------- On Friday, February 11th, 2022 at 8:05 PM, Emanuel Berg via Users list for = the GNU Emacs text editor wrote: > goncholden wrote: > > > Stefan mentioned that a minor-mode would not be the > > appropriate thing to do. The idea is to derive a mode from > > a major mode and introduce the comment functionality in it. > > One could have a go at introducing the functionality in the > > theme, but that would be too restrictive for others to use. > If this is the goal > I want a special customisation for comments, using normal > weight, and having a keybinding that changes the contrast > ratio between the comment colour and the background. > then start with a function that increases the contrast by CON. I have done all that and introduced them into a minor-mode. There are a number of minor-modes out there that do provide font-lock customization. Extending a major-mode is not simple, eg. a derived mode from prog-mode is used to make a major-mode, like emacs-lisp-mode (which actually derives from lisp-data-mode which derives from prog-mode). This means that if I derive from prog-mode, I would need to setup the syntax for the major-mode before I can change the comment font-locking.