From: Protesilaos Stavrou <info@protesilaos.com>
To: 44424@debbugs.gnu.org
Subject: bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log
Date: Tue, 03 Nov 2020 19:23:30 +0200 [thread overview]
Message-ID: <87eela9wx9.fsf@protesilaos.com> (raw)
[-- 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 --]
next reply other threads:[~2020-11-03 17:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 17:23 Protesilaos Stavrou [this message]
2020-11-09 16:14 ` bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log Lars Ingebrigtsen
2020-11-28 18:13 ` Dmitry Gutov
2020-11-28 18:56 ` Protesilaos Stavrou
2020-11-28 19:07 ` Dmitry Gutov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eela9wx9.fsf@protesilaos.com \
--to=info@protesilaos.com \
--cc=44424@debbugs.gnu.org \
/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 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).