all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Protesilaos Stavrou <info@protesilaos.com>
To: Sean Whitton <spwhitton@spwhitton.name>,
	Lars Ingebrigtsen <larsi@gnus.org>,
	emacs-devel@gnu.org
Subject: Re: [PATCH] * vc-git.el (vc-git-log-edit-mode): Font lock long summary lines.
Date: Sun, 04 Sep 2022 20:42:34 +0300	[thread overview]
Message-ID: <87edwrf33p.fsf@protesilaos.com> (raw)
In-Reply-To: <87wnaj124y.fsf@melete.silentflame.com>

> From: Sean Whitton <spwhitton@spwhitton.name>
> Date: Sun, 04 Sep 2022 10:27:09 -0700
>
> Hello,

Hello Sean,

> On Sun 04 Sep 2022 at 12:50PM +02, Lars Ingebrigtsen wrote:
>
>> Sean Whitton <spwhitton@spwhitton.name> writes:
>>
>>> I'd like to install this patch to highlight long summary lines when composing
>>> git commit messages.  Comments welcome.
>>
>> What constitutes a too-long summary line varies by project, so I don't
>> think doing this by default would be appreciated.  But it would be a
>> user option.
>
> Ah okay, I don't recall having myself seen anything written down other
> than 50/68, though I know plenty of projects don't care about it at all.
>
> I'm thinking two defcustoms, then:
>
>     vc-git-summary-target-length defaults to nil,
>          I'll make emacs.git's .dir-locals.el set it to 50
>
>     vc-git-summary-max-length defaults to 68.
>
> (The name of the latter is based on `git-commit-summary-max-length' from
> git-commit.el on my system, which I believe is pulled in by Magit.)

Please consider defining the relevant faces as well.  The 'warning' and
'error' are not always appropriate here and by hardcoding them we no
longer have the chance to modify them easily (thinking about themes).

git-commit.el does this:

    (defface git-commit-overlong-summary
      '((t :inherit font-lock-warning-face))
      "Face used for the tail of overlong commit message summaries."
      :group 'git-commit-faces)

    (defface git-commit-nonempty-second-line
      '((t :inherit font-lock-warning-face))
      "Face used for non-whitespace on the second line of commit messages."
      :group 'git-commit-faces)

The new faces can inherit from 'warning' and 'error', of course.

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com



  reply	other threads:[~2022-09-04 17:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03 17:03 [PATCH] * vc-git.el (vc-git-log-edit-mode): Font lock long summary lines Sean Whitton
2022-09-04 10:50 ` Lars Ingebrigtsen
2022-09-04 17:27   ` Sean Whitton
2022-09-04 17:42     ` Protesilaos Stavrou [this message]
2022-09-04 18:36 ` Matthias Meulien
2022-09-04 18:41   ` Philip Kaludercic
2022-09-04 22:06     ` Sean Whitton
2022-09-04 23:22 ` [PATCH v2] Font lock long Git commit " Sean Whitton
2022-09-05 11:12   ` Lars Ingebrigtsen
2022-09-05 12:07   ` Eli Zaretskii
2022-09-05 18:14     ` Sean Whitton
2022-09-05 18:23       ` Eli Zaretskii
2022-09-06  0:39         ` Sean Whitton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edwrf33p.fsf@protesilaos.com \
    --to=info@protesilaos.com \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.