From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Adding git-commit highlight mode? Date: Thu, 2 Jan 2025 14:10:22 -0600 Message-ID: References: <37733be4476e1c2b6e873c967c79cb0035959a9e.camel@yandex.ru> <86wmfdhwg7.fsf@gnu.org> <0347118b217c57e4e62018547883fad5f1d1e63e.camel@yandex.ru> 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="9854"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Jonas Bernoulli To: Konstantin Kharlamov , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 02 21:10:44 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 1tTRWm-0002Pk-8q for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Jan 2025 21:10:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTRWV-0004gv-TU; Thu, 02 Jan 2025 15:10:27 -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 1tTRWU-0004fH-9d for emacs-devel@gnu.org; Thu, 02 Jan 2025 15:10:26 -0500 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTRWS-0000ij-Jc; Thu, 02 Jan 2025 15:10:26 -0500 Original-Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5ceb03aadb1so16751304a12.0; Thu, 02 Jan 2025 12:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735848622; x=1736453422; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=2Liwzs7F4BFyW9Ts1jSMjSMSrHbNzrZIGzc42ElxYd8=; b=OQOjNpNqRAFRuJPr4Ordy6Zfwba0NtggMn3NmIm1RALS3Q0namnu4JdPMxT+vsqTQl iUp6GlSNRAFRxpzLtEy9GZyMNZu3GGWmCvCn7Q8jNN7ZCBkBY1w6y70tVevbQTPElJQw Q0mR/GiD0EuoX2sc9IrWXWkzAJ3LKbUslqaTKLKu9GDDJ3311Bvp7k2LY+Guki6rMJkD Evr1TVyAIasFENHgJxTovb+1UINlOIEI1pKCEs5jjRlgKa0BOo7o3g96IU7jR568Qw8j ldYTm0LRKEPvXonDZzndDy7x7fTy/qJ8vekQE6O6X+DhuVcvbf4z2aCj55LS7mZ4mNyQ xkmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735848622; x=1736453422; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2Liwzs7F4BFyW9Ts1jSMjSMSrHbNzrZIGzc42ElxYd8=; b=wzF/YRpdOGOV/XKnLOGn4bjubAP5jmVXQvxfLvKYi2esU6Vw4PFe8p1lmSDjamj+/r wHIYDs3kE9XaZ/LaCHL98w70yuSXkkHbfFXVxwCKrLessn3yyNRgk/7cXyiiMSmLvp59 aGR6mx44jkCgWVnIVTDqA8+CscUrY1oq998Lh3m5z4PThvyApnIYCPNJGBaSJQzF546z /niQybnytoqZY8bfV2uy2jUs0akfOn+T5gRteVtChIIKkL5/iWhV4bLSttcQz1A7BzZD MJ2Mju5YyyvSOl+YpcDKhrvHGXT6z1KkzgDQHXz1X/IX30dPtkW//C5w6k68uPiPXJ8c yMOQ== X-Forwarded-Encrypted: i=1; AJvYcCV1pvl4kdUtFM+u6tfk9JR6LQYcFSwLfYdusY9QX60yg+zRfQ2WDcb2F0tOhXVyCoPk/4Tu@gnu.org X-Gm-Message-State: AOJu0YzEyyp15VrQmltt8+Eazseu94BreHoEuq65H/AkQzKX1dJQNUXe sQNTgoYxBOYl9PBSjhCi27XFSbpt0t/i2M2aszR1OAP5867w8DZv2qavJMsmwTo7BQUlLqn7TcX /ytJh5Ni8t7Ykg70UaN9fW1vO51s= X-Gm-Gg: ASbGncuwUMREQO0fP5KJVMTqSlTQ9jhfPPUUhApNTD4G/HXin9KZUIm6CCnNaM2C43z EvrhYZ1NwFsHRV1JI6de0g3rweOeVruOw/74/X8U= X-Google-Smtp-Source: AGHT+IEnvGNlDkkiDbZy2dRbYJVSF7BNFSgk7GGhb0XyAvQq2ToPZD5mOuyPtev1sDRkxvjbW3U82ISibXjgVAuUi1w= X-Received: by 2002:a05:6402:388c:b0:5d2:7270:6135 with SMTP id 4fb4d7f45d1cf-5d81de197fcmr46550343a12.33.1735848622429; Thu, 02 Jan 2025 12:10:22 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 2 Jan 2025 14:10:22 -0600 In-Reply-To: <0347118b217c57e4e62018547883fad5f1d1e63e.camel@yandex.ru> Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=stefankangas@gmail.com; helo=mail-ed1-x532.google.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, RCVD_IN_DNSWL_NONE=-0.0001, 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:327591 Archived-At: Konstantin Kharlamov writes: > On Thu, 2025-01-02 at 21:01 +0200, Eli Zaretskii wrote: >> > From: Konstantin Kharlamov >> > Date: Thu, 02 Jan 2025 21:30:53 +0300 >> > >> > Hi, just wanted to ask this before potentially taking on the >> > initiative >> > to only find the code will get rejected. >> > >> > I think a ballpark estimate of 90% of Git usage among CVSes in the >> > modern world is fair to assume. >> > >> > 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? It would be great to have something like that in Emacs by default, indeed. Even a simple mode with syntax highlighting would go a long way. Note that there is some prior work here, see `git-commit-mode' in `magit`. However, AFAIU, we recommend not looking at the implementation if you want to implement something like it, for reasons of copyright. The reason is that once you look at its implementation it's hard to write something original enough to be able to copyright assign the result to the Free Software Foundation, and even if it is original it can still (under some circumstances) be considered a derivative work of the code you have looked at. You can look at its docstrings though. Let me know if this is interesting, and I'll happily share it with you off-list. I'm copying in Jonas Bernoulli, in case he has any comments. >> 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 `change-log-mode` implements the anachronistic ChangeLog format favored by GNU. If the idea is to be useful to the 90% of the world that uses Git, I'd recommend against inheriting from `change-log-mode`, because 99.99% or so of Git users do not use that format. Granted, that figure might be something more like 99.9% when it comes to GNU Emacs users specifically.