From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Adding git-commit highlight mode? Date: Fri, 03 Jan 2025 08:45:19 +0200 Message-ID: <868qrsief4.fsf@gnu.org> References: <37733be4476e1c2b6e873c967c79cb0035959a9e.camel@yandex.ru> <86wmfdhwg7.fsf@gnu.org> <0347118b217c57e4e62018547883fad5f1d1e63e.camel@yandex.ru> <86r05lht77.fsf@gnu.org> <875xmwykuk.fsf@aarsen.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23395"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Hi-Angel@yandex.ru, emacs-devel@gnu.org To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 03 07:45:47 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 1tTbRL-0005ws-DP for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Jan 2025 07:45:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTbR3-0003yW-0i; Fri, 03 Jan 2025 01:45:29 -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 1tTbQw-0003xv-49 for emacs-devel@gnu.org; Fri, 03 Jan 2025 01:45:23 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTbQv-0004l4-Lt; Fri, 03 Jan 2025 01:45:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=zv3Sz3c45/VtasrOI52rK8qSJufBBm2hqEwPS9WoeL4=; b=JmZsvDnDqPZRBUCM4of/ 2SRJsrIrF+uBXhETp/46QF/AghQdiM7J11+/YY0mOvno6eNxsKqbl+S1lPotH2TG+bczNXgoUuXWG qqJ2mpQ1QAQ+qxvoJAsLyVYKCjb/HwW3M6mVRI8pKppY8Mvo7K0fDNTkTOMm0JBjO1Vx9GoxsxXNz 1PIdqerdHP3pKPVKtnk+ks/odUh31ddYPqAMKFPlRcpUlyFbxUwKz0rnN3qFFqgVzfzAJ+6Wk5Yip L/vM0KH16gbpa8E1SWq8fTPrQUigSaFCmJVstg6rQANrwnLjzU5IfQlFl7CZK91MFWNQYFYWUWCrq vb4sFB4MUhDivw==; In-Reply-To: <875xmwykuk.fsf@aarsen.me> (message from Arsen =?utf-8?Q?Arse?= =?utf-8?Q?novi=C4=87?= on Thu, 02 Jan 2025 22:19:47 +0100) 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:327612 Archived-At: > From: Arsen Arsenović > Cc: Konstantin Kharlamov , emacs-devel@gnu.org > Date: Thu, 02 Jan 2025 22:19:47 +0100 > > Eli Zaretskii writes: > > >> From: Konstantin Kharlamov > >> Cc: emacs-devel@gnu.org > >> Date: Thu, 02 Jan 2025 22:07:46 +0300 > >> > >> On Thu, 2025-01-02 at 21:01 +0200, Eli Zaretskii wrote: > >> > 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… I could derive it > >> from change-log-mode if you think it's useful, but I'd rely on your > >> judgment here 😊 > > > > change-log-mode is also a derivative of text-mode. Its advantage is > > that it already provides font-lock for the style of log entries we > > use. > > A thing that a git commit mode ought to do, however, is set fill-column > to 72, highlight any content on line 2 as erroneous, and limit the first > line to 50 characters. This is conventional in Git: > https://git-scm.com/docs/git-commit#_discussion > https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project.html#_commit_guidelines > > Naturally, all of this ought to be configurable, but these are important > features and sane defaults, and are one of the primary reasons why I > initially installed magit (though, I now use it for general Git > interaction while editing). > > As far as I know, some of these guidelines conflict with changelog > guidelines. Being a descendant of change-log-mode doesn't mean the derivative mode cannot change the settings it needs to change. ChangeLog files are indented, whereas commit log messages aren't, so some customization of the whitespace and fill-column will sure be needed. But, for example, the change-log-fill-parenthesized-list capability will come in very handy.