unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log
@ 2020-11-03 17:23 Protesilaos Stavrou
  2020-11-09 16:14 ` Lars Ingebrigtsen
  2020-11-28 18:13 ` Dmitry Gutov
  0 siblings, 2 replies; 5+ messages in thread
From: Protesilaos Stavrou @ 2020-11-03 17:23 UTC (permalink / raw)
  To: 44424

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

In the 'vc-print-root-log' buffer it is possible to reveal the message
of the commit at point by invoking 'log-view-toggle-entry-display'.

Currently the revealed text is fontified with 'font-lock-comment-face'
even though the rest of the buffer has 'log-view' -specific faces for
several of its components.

The attached patch is an attempt to introduce a new face for expanded
commit messages.  It has the upside that users/themes can now further
control the presentation of 'vc-print-root-log'.

Also attached are a couple of screenshots with the before and after
states on 'emacs -Q'.

What do you think?

* * *

GNU Emacs 28.0.50 (build 9, x86_64-pc-linux-gnu, GTK+ Version 3.24.23,
cairo version 1.17.3) of 2020-10-21

Repository revision: 8a91d055b289979a750b81c4ecfdbe44bdd68481

* * *

Best regards,
Protesilaos

-- 
Protesilaos Stavrou
protesilaos.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Define-new-face-for-log-view-expanded-commit.patch --]
[-- Type: text/x-patch, Size: 1828 bytes --]

From a9d338194793bbf4907ea5a493330bdbcbaa0a13 Mon Sep 17 00:00:00 2001
From: Protesilaos Stavrou <info@protesilaos.com>
Date: Tue, 3 Nov 2020 10:22:27 +0200
Subject: [PATCH] Define new face for log-view expanded commit

* lisp/vc/log-view.el (log-view-commit-body): Define new face.
(log-view-toggle-entry-display): Implement 'log-view-commit-body'
face.
---
 lisp/vc/log-view.el | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index e1c2b976a4..739f84ec5f 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -208,6 +208,19 @@ If it is nil, `log-view-toggle-entry-display' does nothing.")
   "Face for the message header line in `log-view-mode'."
   :group 'log-view)
 
+(defface log-view-commit-body
+  '((((class color) (min-colors 88) (background light))
+     :background "gray95" :foreground "black" :extend t)
+    (((class color) (min-colors 88) (background dark))
+     :background "gray5" :foreground "white" :extend t)
+    (((class color) (min-colors 8) (background light))
+     :foreground "black")
+    (((class color) (min-colors 8) (background dark))
+     :foreground "white"))
+  "Face for the commit body in `log-view-mode'."
+  :version "28.1"
+  :group 'log-view)
+
 (defvar log-view-file-re
   (concat "^\\(?:Working file: \\(?1:.+\\)"                ;RCS and CVS.
           ;; Subversion has no such thing??
@@ -415,7 +428,7 @@ This calls `log-view-expanded-log-entry-function' to do the work."
 	      (insert long-entry "\n")
 	      (add-text-properties
 	       beg (point)
-	       '(font-lock-face font-lock-comment-face log-view-comment t))
+	       '(font-lock-face log-view-commit-body log-view-comment t))
 	      (goto-char opoint))))))))
 
 (defun log-view-beginning-of-defun (&optional arg)
-- 
2.29.2


[-- Attachment #3: vc-print-root-log-after.png --]
[-- Type: image/png, Size: 429462 bytes --]

[-- Attachment #4: vc-print-root-log-before.png --]
[-- Type: image/png, Size: 393111 bytes --]

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

end of thread, other threads:[~2020-11-28 19:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 17:23 bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log Protesilaos Stavrou
2020-11-09 16:14 ` Lars Ingebrigtsen
2020-11-28 18:13 ` Dmitry Gutov
2020-11-28 18:56   ` Protesilaos Stavrou
2020-11-28 19:07     ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).