unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
@ 2022-09-26 12:44 Protesilaos Stavrou
  2022-09-26 13:20 ` Lars Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Protesilaos Stavrou @ 2022-09-26 12:44 UTC (permalink / raw)
  To: 58092

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

Dear maintainers,

The attached patch replaces some hardcoded face properties in log-edit
buffers with a named face.

The named face allows users/themes to customise how this line is styled.

What do you think?

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

-- 
Protesilaos Stavrou
https://protesilaos.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-log-edit-summary-separator-face.patch --]
[-- Type: text/x-patch, Size: 2078 bytes --]

From ea287b3d918c6a2cf6181c5671187143b3774bd5 Mon Sep 17 00:00:00 2001
Message-Id: <ea287b3d918c6a2cf6181c5671187143b3774bd5.1664196100.git.info@protesilaos.com>
From: Protesilaos Stavrou <info@protesilaos.com>
Date: Mon, 26 Sep 2022 15:41:18 +0300
Subject: [PATCH] Add log-edit-summary-separator face

* etc/NEWS: Report on it.
* lisp/vc/log-edit.el (log-edit-summary-separator): Add new face.
(log-edit-font-lock-keywords): Replace hardcoded face attributes with
named face.
---
 etc/NEWS            | 5 +++++
 lisp/vc/log-edit.el | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 0a5b7bc29c..ced4ece35d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1766,6 +1766,11 @@ Writing shorter summary lines avoids truncation in contexts in which
 Git commands display summary lines.  See the two new user options
 'vc-git-log-edit-summary-target-len' and 'vc-git-log-edit-summary-max-len'.
 
+---
+*** New 'log-edit-summary-separator' face
+Styles the line that separates the log-edit headers from the log-edit
+summary.
+
 ** Message
 
 ---
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index 5290616302..25b47a75af 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -325,6 +325,10 @@ ;;; Actual code
 (defface log-edit-summary '((t :inherit font-lock-function-name-face))
   "Face for the summary in `log-edit-mode' buffers.")
 
+(defface log-edit-summary-separator '((t :height 0.1 :inverse-video t :extend t))
+  "Face for the summary separator line in `log-edit-mode' buffers."
+  :version "29.1")
+
 (defface log-edit-header '((t :inherit font-lock-keyword-face))
   "Face for the headers in `log-edit-mode' buffers.")
 
@@ -393,7 +397,7 @@ (defvar log-edit-font-lock-keywords
          nil lax))
      ("^\n"
       (progn (goto-char (match-end 0)) (1+ (match-end 0))) nil
-      (0 '(face (:height 0.1 :inverse-video t :extend t)
+      (0 '(face log-edit-summary-separator
            display-line-numbers-disable t rear-nonsticky t))))
     (log-edit--match-first-line (0 'log-edit-summary))))
 
-- 
2.37.3


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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 12:44 bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face Protesilaos Stavrou
@ 2022-09-26 13:20 ` Lars Ingebrigtsen
  2022-09-26 13:22 ` Stefan Kangas
  2022-09-26 13:28 ` Dmitry Gutov
  2 siblings, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-26 13:20 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 58092

Protesilaos Stavrou <info@protesilaos.com> writes:

> The named face allows users/themes to customise how this line is styled.
>
> What do you think?

Sounds good to me.

> +(defface log-edit-summary-separator '((t :height 0.1 :inverse-video t :extend t))

Minor nit pick: That's a too-long line.





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 12:44 bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face Protesilaos Stavrou
  2022-09-26 13:20 ` Lars Ingebrigtsen
@ 2022-09-26 13:22 ` Stefan Kangas
  2022-09-26 13:28 ` Dmitry Gutov
  2 siblings, 0 replies; 12+ messages in thread
From: Stefan Kangas @ 2022-09-26 13:22 UTC (permalink / raw)
  To: Protesilaos Stavrou, 58092

Protesilaos Stavrou <info@protesilaos.com> writes:

> From ea287b3d918c6a2cf6181c5671187143b3774bd5 Mon Sep 17 00:00:00 2001
> Message-Id: <ea287b3d918c6a2cf6181c5671187143b3774bd5.1664196100.git.info@protesilaos.com>
> From: Protesilaos Stavrou <info@protesilaos.com>
> Date: Mon, 26 Sep 2022 15:41:18 +0300
> Subject: [PATCH] Add log-edit-summary-separator face
>
> * etc/NEWS: Report on it.

This line is optional, but I'd put it below the main change and say
something like "Announce the new face."

> * lisp/vc/log-edit.el (log-edit-summary-separator): Add new face.
> (log-edit-font-lock-keywords): Replace hardcoded face attributes with
> named face.
> ---
>  etc/NEWS            | 5 +++++
>  lisp/vc/log-edit.el | 6 +++++-
>  2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/etc/NEWS b/etc/NEWS
> index 0a5b7bc29c..ced4ece35d 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -1766,6 +1766,11 @@ Writing shorter summary lines avoids truncation in contexts in which
>  Git commands display summary lines.  See the two new user options
>  'vc-git-log-edit-summary-target-len' and 'vc-git-log-edit-summary-max-len'.
>
> +---
> +*** New 'log-edit-summary-separator' face
> +Styles the line that separates the log-edit headers from the log-edit
> +summary.

I'd say:

    "It is used for the 'log-edit' headers ..."

> +
>  ** Message
>
>  ---
> diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
> index 5290616302..25b47a75af 100644
> --- a/lisp/vc/log-edit.el
> +++ b/lisp/vc/log-edit.el
> @@ -325,6 +325,10 @@ ;;; Actual code
>  (defface log-edit-summary '((t :inherit font-lock-function-name-face))
>    "Face for the summary in `log-edit-mode' buffers.")
>
> +(defface log-edit-summary-separator '((t :height 0.1 :inverse-video t :extend t))

Maybe put the value on a separate line (in case we want to extend it
later)?

> +  "Face for the summary separator line in `log-edit-mode' buffers."
> +  :version "29.1")
> +
>  (defface log-edit-header '((t :inherit font-lock-keyword-face))
>    "Face for the headers in `log-edit-mode' buffers.")
>
> @@ -393,7 +397,7 @@ (defvar log-edit-font-lock-keywords
>           nil lax))
>       ("^\n"
>        (progn (goto-char (match-end 0)) (1+ (match-end 0))) nil
> -      (0 '(face (:height 0.1 :inverse-video t :extend t)
> +      (0 '(face log-edit-summary-separator
>             display-line-numbers-disable t rear-nonsticky t))))
>      (log-edit--match-first-line (0 'log-edit-summary))))

Other than those nits, LGTM (but I didn't test it).





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 12:44 bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face Protesilaos Stavrou
  2022-09-26 13:20 ` Lars Ingebrigtsen
  2022-09-26 13:22 ` Stefan Kangas
@ 2022-09-26 13:28 ` Dmitry Gutov
  2022-09-26 14:06   ` Protesilaos Stavrou
  2 siblings, 1 reply; 12+ messages in thread
From: Dmitry Gutov @ 2022-09-26 13:28 UTC (permalink / raw)
  To: Protesilaos Stavrou, 58092

Hi!

On 26.09.2022 15:44, Protesilaos Stavrou wrote:
> Dear maintainers,
> 
> The attached patch replaces some hardcoded face properties in log-edit
> buffers with a named face.
> 
> The named face allows users/themes to customise how this line is styled.
> 
> What do you think?

LGTM, except perhaps call it headers-separator? It's used to separate 
all the headers, not just summary.





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 13:28 ` Dmitry Gutov
@ 2022-09-26 14:06   ` Protesilaos Stavrou
  2022-09-26 14:32     ` Dmitry Gutov
  2022-09-26 14:40     ` Robert Pluim
  0 siblings, 2 replies; 12+ messages in thread
From: Protesilaos Stavrou @ 2022-09-26 14:06 UTC (permalink / raw)
  To: Dmitry Gutov, 58092; +Cc: Lars Ingebrigtsen, Stefan Kangas

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Mon, 26 Sep 2022 16:28:56 +0300
>
> Hi!
>
> On 26.09.2022 15:44, Protesilaos Stavrou wrote:
>> Dear maintainers,
>> 
>> The attached patch replaces some hardcoded face properties in log-edit
>> buffers with a named face.
>> 
>> The named face allows users/themes to customise how this line is styled.
>> 
>> What do you think?
>
> LGTM, except perhaps call it headers-separator? It's used to separate 
> all the headers, not just summary.

Hello everyone,

I made the changes as you suggested and pushed them as commit
a386833503.  However, I forgot to update the commit message of the
patch: it still mentions the old name of the face
'log-edit-summary-separator' instead of 'log-edit-headers-separator'.

Sorry for this mistake!  Can I revert or amend it?

-- 
Protesilaos Stavrou
https://protesilaos.com





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 14:06   ` Protesilaos Stavrou
@ 2022-09-26 14:32     ` Dmitry Gutov
  2022-09-26 14:40     ` Robert Pluim
  1 sibling, 0 replies; 12+ messages in thread
From: Dmitry Gutov @ 2022-09-26 14:32 UTC (permalink / raw)
  To: Protesilaos Stavrou, 58092; +Cc: Lars Ingebrigtsen, Stefan Kangas

On 26.09.2022 17:06, Protesilaos Stavrou wrote:
>> From: Dmitry Gutov<dgutov@yandex.ru>
>> Date: Mon, 26 Sep 2022 16:28:56 +0300
>>
>> Hi!
>>
>> On 26.09.2022 15:44, Protesilaos Stavrou wrote:
>>> Dear maintainers,
>>>
>>> The attached patch replaces some hardcoded face properties in log-edit
>>> buffers with a named face.
>>>
>>> The named face allows users/themes to customise how this line is styled.
>>>
>>> What do you think?
>> LGTM, except perhaps call it headers-separator? It's used to separate
>> all the headers, not just summary.
> Hello everyone,
> 
> I made the changes as you suggested and pushed them as commit
> a386833503.  However, I forgot to update the commit message of the
> patch: it still mentions the old name of the face
> 'log-edit-summary-separator' instead of 'log-edit-headers-separator'.
> 
> Sorry for this mistake!  Can I revert or amend it?

If it's just in the commit message, then a revert won't help.

And I don't think we have any tools for amending the change log so far.

In any case, NEWS is more important than the commit message. So it's 
probably fine.





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 14:06   ` Protesilaos Stavrou
  2022-09-26 14:32     ` Dmitry Gutov
@ 2022-09-26 14:40     ` Robert Pluim
  2022-09-26 14:49       ` Stefan Kangas
  1 sibling, 1 reply; 12+ messages in thread
From: Robert Pluim @ 2022-09-26 14:40 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: Lars Ingebrigtsen, 58092, Stefan Kangas, Dmitry Gutov

>>>>> On Mon, 26 Sep 2022 17:06:22 +0300, Protesilaos Stavrou <info@protesilaos.com> said:
    Protesilaos> I made the changes as you suggested and pushed them as commit
    Protesilaos> a386833503.  However, I forgot to update the commit message of the
    Protesilaos> patch: it still mentions the old name of the face
    Protesilaos> 'log-edit-summary-separator' instead of 'log-edit-headers-separator'.

    Protesilaos> Sorry for this mistake!  Can I revert or amend it?

amend no. revert yes, but itʼs overkill for just a commit message issue. You
can always run 'make change-history' and fix it in the resulting
ChangeLog file (see admin/notes/repo for the details)

Robert
-- 





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 14:40     ` Robert Pluim
@ 2022-09-26 14:49       ` Stefan Kangas
  2022-09-26 14:55         ` Protesilaos Stavrou
  2022-09-27 15:50         ` Sean Whitton
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Kangas @ 2022-09-26 14:49 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Protesilaos Stavrou, 58092, Lars Ingebrigtsen, Dmitry Gutov

Robert Pluim <rpluim@gmail.com> writes:

> amend no. revert yes, but itʼs overkill for just a commit message issue. You
> can always run 'make change-history' and fix it in the resulting
> ChangeLog file (see admin/notes/repo for the details)

Please don't do that, it will make merging more tricky later.





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 14:49       ` Stefan Kangas
@ 2022-09-26 14:55         ` Protesilaos Stavrou
  2022-09-27 15:50         ` Sean Whitton
  1 sibling, 0 replies; 12+ messages in thread
From: Protesilaos Stavrou @ 2022-09-26 14:55 UTC (permalink / raw)
  To: Stefan Kangas, Robert Pluim; +Cc: Lars Ingebrigtsen, 58092, Dmitry Gutov

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Mon, 26 Sep 2022 16:49:39 +0200
>
> Robert Pluim <rpluim@gmail.com> writes:
>
>> amend no. revert yes, but itʼs overkill for just a commit message issue. You
>> can always run 'make change-history' and fix it in the resulting
>> ChangeLog file (see admin/notes/repo for the details)
>
> Please don't do that, it will make merging more tricky later.

Okay, I will just leave it as-is.  Will be more careful next time.

-- 
Protesilaos Stavrou
https://protesilaos.com

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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-26 14:49       ` Stefan Kangas
  2022-09-26 14:55         ` Protesilaos Stavrou
@ 2022-09-27 15:50         ` Sean Whitton
  2022-09-27 16:15           ` Stefan Kangas
  1 sibling, 1 reply; 12+ messages in thread
From: Sean Whitton @ 2022-09-27 15:50 UTC (permalink / raw)
  To: Stefan Kangas
  Cc: Lars Ingebrigtsen, Robert Pluim, Dmitry Gutov,
	Protesilaos Stavrou, 58092

Hello,

On Mon 26 Sep 2022 at 04:49PM +02, Stefan Kangas wrote:

> Robert Pluim <rpluim@gmail.com> writes:
>
>> amend no. revert yes, but itʼs overkill for just a commit message issue. You
>> can always run 'make change-history' and fix it in the resulting
>> ChangeLog file (see admin/notes/repo for the details)
>
> Please don't do that, it will make merging more tricky later.

Hmm, so it's never okay to do that?  Or is it to be saved for the more
egregrious errors?

-- 
Sean Whitton





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-27 15:50         ` Sean Whitton
@ 2022-09-27 16:15           ` Stefan Kangas
  2022-09-28  0:49             ` Sean Whitton
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Kangas @ 2022-09-27 16:15 UTC (permalink / raw)
  To: Sean Whitton
  Cc: Lars Ingebrigtsen, Robert Pluim, Dmitry Gutov,
	Protesilaos Stavrou, 58092

Sean Whitton <spwhitton@spwhitton.name> writes:

>>> amend no. revert yes, but itʼs overkill for just a commit message issue. You
>>> can always run 'make change-history' and fix it in the resulting
>>> ChangeLog file (see admin/notes/repo for the details)
>>
>> Please don't do that, it will make merging more tricky later.
>
> Hmm, so it's never okay to do that?  Or is it to be saved for the more
> egregrious errors?

It's easier for me (or whoever is charge of merging and/or releases) if
we don't do that, so I'd prefer it if we could reserve it for
particularly nasty mistakes.

However, if it has to be done, please do it in two separate commits: one
that generates the ChangeLog and one that fixes the mistake.





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

* bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face
  2022-09-27 16:15           ` Stefan Kangas
@ 2022-09-28  0:49             ` Sean Whitton
  0 siblings, 0 replies; 12+ messages in thread
From: Sean Whitton @ 2022-09-28  0:49 UTC (permalink / raw)
  To: Stefan Kangas
  Cc: Lars Ingebrigtsen, Robert Pluim, Dmitry Gutov,
	Protesilaos Stavrou, 58092

Hello,

On Tue 27 Sep 2022 at 12:15PM -04, Stefan Kangas wrote:

> Sean Whitton <spwhitton@spwhitton.name> writes:
>
>>>> amend no. revert yes, but itʼs overkill for just a commit message issue. You
>>>> can always run 'make change-history' and fix it in the resulting
>>>> ChangeLog file (see admin/notes/repo for the details)
>>>
>>> Please don't do that, it will make merging more tricky later.
>>
>> Hmm, so it's never okay to do that?  Or is it to be saved for the more
>> egregrious errors?
>
> It's easier for me (or whoever is charge of merging and/or releases) if
> we don't do that, so I'd prefer it if we could reserve it for
> particularly nasty mistakes.
>
> However, if it has to be done, please do it in two separate commits: one
> that generates the ChangeLog and one that fixes the mistake.

Thanks.  I've updated admin/notes/repo with this information.

-- 
Sean Whitton





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

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

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 12:44 bug#58092: 29.0.50; [PATCH] Add log-edit-summary-separator face Protesilaos Stavrou
2022-09-26 13:20 ` Lars Ingebrigtsen
2022-09-26 13:22 ` Stefan Kangas
2022-09-26 13:28 ` Dmitry Gutov
2022-09-26 14:06   ` Protesilaos Stavrou
2022-09-26 14:32     ` Dmitry Gutov
2022-09-26 14:40     ` Robert Pluim
2022-09-26 14:49       ` Stefan Kangas
2022-09-26 14:55         ` Protesilaos Stavrou
2022-09-27 15:50         ` Sean Whitton
2022-09-27 16:15           ` Stefan Kangas
2022-09-28  0:49             ` Sean Whitton

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).