[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch to vertically center line content when using line-spacing vari

From: Robert Pluim
Subject: Re: Patch to vertically center line content when using line-spacing variable
Date: Mon, 30 Sep 2019 09:07:28 +0200

>>>>> On Sun, 29 Sep 2019 20:54:01 -0300, Jesse Medeiros <address@hidden> said:

    Jesse> I've worked the on these issues you raised. Hopefully it's all ok 

Nit-picking below, plus one question about the code.

    Jesse> From 9bc5cbb727e5dcac9f774028858e2608d1a23033 Mon Sep 17 00:00:00 
    Jesse> From: Jesse Nazario <address@hidden>
    Jesse> Date: Sun, 8 Sep 2019 20:06:15 -0300
    Jesse> Subject: [PATCH] Center lines vertically with 

    Jesse> When using line-spacing, the new variable 
    Jesse> can be set to non-nil to center the line content
    Jesse> vertically.

We use ChangeLog format commit messages, see CONTRIBUTE for
details. One easy way to get the format right is:

C-x v d      ; runs vc-dir
m            ; mark the file(s) youʼre committing
v            ; runs vc-next-action, which pops up a commit buffer,
             ; where you can write the one-line commit summary,
             ; and then
C-c C-w      ; runs log-edit-generate-changelog-from-diff, which scrapes
             ; the file and function names from the diff
             ; fill in the details about the changes

    Jesse> ---
    Jesse>  doc/lispref/display.texi |  5 +++++
    Jesse>  etc/NEWS                 |  4 ++++
    Jesse>  src/buffer.c             | 14 ++++++++++++++
    Jesse>  src/buffer.h             |  4 ++++
    Jesse>  src/xdisp.c              | 10 +++++++++-
    Jesse>  5 files changed, 36 insertions(+), 1 deletion(-)

    Jesse> diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
    Jesse> index fd6820897f..875c50c6ef 100644
    Jesse> --- a/doc/lispref/display.texi
    Jesse> +++ b/doc/lispref/display.texi
    Jesse> @@ -2195,6 +2195,11 @@ Line Height
    Jesse>  number of pixels put below lines.  A floating-point number specifies
    Jesse>  the spacing relative to the frame's default line height.
    Jesse> +  The @code{line-spacing} parameter creates the space by putting 
    Jesse> +margin only below the line. If you wish to center the line
    Jesse> vertically

Two spaces after '.'

    Jesse> +instead, you can set the variable 
    Jesse> +as non-nin.
    Jesse> +


    Jesse> diff --git a/src/xdisp.c b/src/xdisp.c
    Jesse> index 95895ec3ac..e2c7309f32 100644
    Jesse> --- a/src/xdisp.c
    Jesse> +++ b/src/xdisp.c
    Jesse> @@ -29307,7 +29307,15 @@ gui_produce_glyphs (struct it *it)
    Jesse>    if (extra_line_spacing > 0)
    Jesse>      {
    Jesse> -      it->descent += extra_line_spacing;
    Jesse> +      if (! NILP (BVAR (XBUFFER (it->w->contents),
    Jesse> +                        line_spacing_vertical_center)))

I think you've inverted the test here, should this not be

    if (NILP ....)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]