From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: Re: Adding git-commit highlight mode? Date: Thu, 02 Jan 2025 22:07:46 +0300 Message-ID: <0347118b217c57e4e62018547883fad5f1d1e63e.camel@yandex.ru> References: <37733be4476e1c2b6e873c967c79cb0035959a9e.camel@yandex.ru> <86wmfdhwg7.fsf@gnu.org> 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="15339"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.54.2 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 02 20:08:29 2025 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 1tTQYX-0003lO-0G for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Jan 2025 20:08:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTQY5-0006FA-RY; Thu, 02 Jan 2025 14:08:01 -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 1tTQY3-0006Ee-W8 for emacs-devel@gnu.org; Thu, 02 Jan 2025 14:08:00 -0500 Original-Received: from forward502d.mail.yandex.net ([2a02:6b8:c41:1300:1:45:d181:d502]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTQY1-0005Hk-DE; Thu, 02 Jan 2025 14:07:59 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:c1aa:0:640:9741:0]) by forward502d.mail.yandex.net (Yandex) with ESMTPS id 27C9C60C5C; Thu, 2 Jan 2025 22:07:47 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id k7mtUuwOmKo0-8WWuKtRV; Thu, 02 Jan 2025 22:07:46 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1735844866; bh=0epSAIfbmp4DtTrwZKDWKQ4dfhYU89WmPeh1yBjq0Us=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=hLg/jTMWJzN4zE4wIY/5LBUiH763A506mSs0efzxVxGeHiCQrZEI9eQPp+o7PmZco XE+WZupqg2b7kBFOtuch49YfP709XtD+rcVxYesEFVax8RSsSSlA4ERh1jcqyJ4GAA 6kFnOLAWaDvDGSshAOpYfaVbMmazuMs8wLxyDiZU= Authentication-Results: mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: <86wmfdhwg7.fsf@gnu.org> Received-SPF: pass client-ip=2a02:6b8:c41:1300:1:45:d181:d502; envelope-from=Hi-Angel@yandex.ru; helo=forward502d.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, SPF_HELO_NONE=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.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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327583 Archived-At: On Thu, 2025-01-02 at 21:01 +0200, Eli Zaretskii wrote: > > From: Konstantin Kharlamov > > Date: Thu, 02 Jan 2025 21:30:53 +0300 > >=20 > > Hi, just wanted to ask this before potentially taking on the > > initiative > > to only find the code will get rejected. > >=20 > > I think a ballpark estimate of 90% of Git usage among CVSes in the > > modern world is fair to assume. > >=20 > > But Emacs seems to be the only widely popular editor that still > > doesn't > > provide OOTB at least syntax highlight for git-commit format. So, > > does > > anyone have opposition to adding a major mode that would be bound > > to > > filenames like `COMMIT_EDITMSG` and others, and would provide the > > aforementioned highlight? >=20 > FWIW, I have this in my ~/.emacs since about forever: >=20 > =C2=A0 (define-derived-mode text-with-comments-mode text-mode "Text#" > =C2=A0=C2=A0=C2=A0 "Text mode with comment syntax." > =C2=A0=C2=A0=C2=A0 (setq-local comment-start "#") > =C2=A0=C2=A0=C2=A0 (setq-local comment-start-skip > (concat (regexp-quote comment-start) "+\\s *")) > =C2=A0=C2=A0=C2=A0 (setq-local font-lock-defaults '(nil nil t nil)) > =C2=A0=C2=A0=C2=A0 (set-syntax-table > =C2=A0=C2=A0=C2=A0=C2=A0 (let ((table (make-syntax-table))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (modify-syntax-entry ?\# "<" table) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 table))) > =C2=A0 (add-to-list 'auto-mode-alist '("COMMIT_EDITMSG\\'" . text-with- > comments-mode)) >=20 > > If there's no opposition, I could write such mode (it seems to be a > > simple one), but I don't promise anything because Idk how long this > > discussion will go and what's gonna happen tomorrow, etc=E2=80=A6 I jus= t > > had > > some spare time and motivation today, so decided to at least start > > the > > discussion. > >=20 > > I don't have plans for adding complicated features besides just > > syntax > > highlight. I think if anyone wishes they could be added later. And > > indentation support from text-mode I think should be fine. >=20 > Do you plan to make this mode be descendant of change-log-mode? > something else? I thought of deriving from text-mode. I don't know much of change-log- mode besides what it says in the mode title and now that I'm looking at mode description it also sounds pretty vague. So=E2=80=A6 I could derive it from change-log-mode if you think it's useful, but I'd rely on your judgment here =F0=9F=98=8A