all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] * vc-git.el (vc-git-log-edit-mode): Font lock long summary lines.
@ 2022-09-03 17:03 Sean Whitton
  2022-09-04 10:50 ` Lars Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Sean Whitton @ 2022-09-03 17:03 UTC (permalink / raw)
  To: emacs-devel; +Cc: Sean Whitton

---
 lisp/vc/vc-git.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

I'd like to install this patch to highlight long summary lines when composing
git commit messages.  Comments welcome.

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 7395253745..8338bfcb26 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -913,7 +913,14 @@ vc-git-log-edit-mode-map
 
 (define-derived-mode vc-git-log-edit-mode log-edit-mode "Log-Edit/git"
   "Major mode for editing Git log messages.
-It is based on `log-edit-mode', and has Git-specific extensions.")
+It is based on `log-edit-mode', and has Git-specific extensions."
+  (setq-local
+   log-edit-font-lock-keywords
+   (append log-edit-font-lock-keywords
+           ;; Warn about going over 50 chars, warn harder about going
+           ;; over 68, per established conventions.
+           '(("\\`Summary: .\\{,50\\}\\(.\\{,18\\}\\)\\(.*\\)"
+	      (1 'warning prepend t) (2 'error prepend t))))))
 
 (defvar vc-git-patch-string nil)
 
-- 
2.30.2




^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-09-06  0:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.