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

* bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log
  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
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-09 16:14 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 44424

Protesilaos Stavrou <info@protesilaos.com> writes:

> Also attached are a couple of screenshots with the before and after
> states on 'emacs -Q'.
>
> What do you think?

Looks good to me, so I've pushed your change (with an added NEWS entry)
to the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2020-11-28 18:13 UTC (permalink / raw)
  To: Protesilaos Stavrou, 44424

On 03.11.2020 19:23, Protesilaos Stavrou wrote:
> What do you think?

I think the idea is good, but the change in the looks is a bit questionable.

Can we do it without the grey background? It's kind of weird to see it 
surrounded by "unexpanded" log entries that use the default white 
background. And other windows that mostly use the white background.

As we can see on the screenshots you posted yourself, the "before" one 
looks more uniform than the "after".

If there are no alternative ideas on which colors to pick, we can just 
inherit from font-lock-comment-face, to retain the previous looks.





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

* bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log
  2020-11-28 18:13 ` Dmitry Gutov
@ 2020-11-28 18:56   ` Protesilaos Stavrou
  2020-11-28 19:07     ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Protesilaos Stavrou @ 2020-11-28 18:56 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 44424, Protesilaos Stavrou

On 2020-11-28, 20:13 +0200, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 03.11.2020 19:23, Protesilaos Stavrou wrote:
>> What do you think?
>
> I think the idea is good, but the change in the looks is a bit questionable.
>
> Can we do it without the grey background? It's kind of weird to see it
> surrounded by "unexpanded" log entries that use the default white
> background. And other windows that mostly use the white background.
>
> As we can see on the screenshots you posted yourself, the "before" one looks
> more uniform than the "after".
>
> If there are no alternative ideas on which colors to pick, we can just inherit
> from font-lock-comment-face, to retain the previous looks.

I think inheriting from font-lock-comment-face is the best option.
Should I send a patch or you can handle it?


-- 
Protesilaos Stavrou
protesilaos.com





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

* bug#44424: [PATCH] 28.0.50; Use bespoke face for commit message in vc-print-root-log
  2020-11-28 18:56   ` Protesilaos Stavrou
@ 2020-11-28 19:07     ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2020-11-28 19:07 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 44424

On 28.11.2020 20:56, Protesilaos Stavrou wrote:
> Should I send a patch or you can handle it?

If you could, that would be great.





^ permalink raw reply	[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).