From: Eli Zaretskii <eliz@gnu.org>
To: Jesse Medeiros <jessenzr@gmail.com>
Cc: stefan@marxist.se, emacs-devel@gnu.org
Subject: Re: Patch to vertically center line content when using line-spacing variable
Date: Sat, 07 Sep 2019 12:50:04 +0300 [thread overview]
Message-ID: <83ftl85tbn.fsf@gnu.org> (raw)
In-Reply-To: <CABDXFDktiaBM0Zqxe_6jp9D98FRZbgRJwqu8bqBNE2Dta8stog@mail.gmail.com> (message from Jesse Medeiros on Sat, 31 Aug 2019 21:01:44 -0300)
> From: Jesse Medeiros <jessenzr@gmail.com>
> Date: Sat, 31 Aug 2019 21:01:44 -0300
> Cc: emacs-devel@gnu.org
>
> > The preferred format for patches is to have a commit message in the
> > form of a ChangeLog entry, and to send it as an attached file produced
> > with e.g. "git format-patch -1".
>
> Oh, sorry I missed that. I'm sending the patch in the attachment.
> Thanks for the tips.
Thanks, I have a few minor comments:
> @@ -956,6 +961,7 @@ reset_buffer (register struct buffer *b)
> (b, BVAR (&buffer_defaults, enable_multibyte_characters));
> bset_cursor_type (b, BVAR (&buffer_defaults, cursor_type));
> bset_extra_line_spacing (b, BVAR (&buffer_defaults, extra_line_spacing));
> + bset_line_spacing_vertical_center (b, BVAR (&buffer_defaults, line_spacing_vertical_center));
Please break this long line into two.
> + DEFVAR_PER_BUFFER ("line-spacing-vertical-center",
> + &BVAR (current_buffer, line_spacing_vertical_center), Qnil,
> + doc: /* Non-nil will center the line content vertically
^^^^
"means" instead of "will" follows our style closer.
> +when using `line-spacing' variable. */);
> --- a/src/xdisp.c
> +++ b/src/xdisp.c
> @@ -29294,7 +29294,13 @@ gui_produce_glyphs (struct it *it)
>
> if (extra_line_spacing > 0)
> {
> - it->descent += extra_line_spacing;
> + if (! BVAR (XBUFFER (it->w->contents), line_spacing_vertical_center)) {
> + it->descent += extra_line_spacing;
> + } else {
> + int spacing = extra_line_spacing / 2;
> + it->ascent += spacing;
> + it->descent += spacing;
> + }
Please use our style of putting braces around blocks:
if (something)
{
do_this;
do_that;
}
else
{
do_something_else;
}
Finally, this change warrants an entry in NEWS, please provide one.
I think we should also mention this variable in the ELisp manual,
where we describe the line-spacing feature.
next prev parent reply other threads:[~2019-09-07 9:50 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-31 21:53 Patch to vertically center line content when using line-spacing variable Jesse Medeiros
2019-08-31 22:36 ` Stefan Kangas
2019-09-01 0:01 ` Jesse Medeiros
2019-09-03 0:01 ` Jesse Medeiros
2019-09-07 9:50 ` Eli Zaretskii [this message]
2019-09-08 23:24 ` Jesse Medeiros
2019-09-09 7:39 ` martin rudalics
2019-09-09 8:40 ` Robert Pluim
2019-09-12 12:08 ` Jesse Medeiros
2019-09-12 14:26 ` Robert Pluim
2019-09-12 20:49 ` Jesse Medeiros
2019-09-13 9:35 ` Robert Pluim
2019-09-29 23:54 ` Jesse Medeiros
2019-09-30 7:07 ` Robert Pluim
-- strict thread matches above, loose matches on Subject: below --
2020-01-23 16:32 조성빈
2020-01-23 19:22 ` Eli Zaretskii
2020-02-07 17:06 ` Jesse Medeiros
2020-02-07 18:26 ` Eli Zaretskii
2020-04-05 18:55 ` 조성빈 via "Emacs development discussions.
2020-04-06 21:13 ` Jesse Medeiros
2020-04-07 14:17 ` Eli Zaretskii
2021-04-12 20:24 email
2021-04-25 19:41 ` Lars Ingebrigtsen
2021-04-25 20:15 ` john muhl
2021-04-25 20:21 ` Eli Zaretskii
2021-04-25 23:25 ` Fu Yuan
2021-04-25 23:28 ` Stefan Kangas
2021-04-25 23:56 ` Clément Pit-Claudel
2021-04-26 1:00 ` Stefan Kangas
2021-04-26 14:00 ` Clément Pit-Claudel
2021-04-25 23:56 ` Clément Pit-Claudel
2021-04-26 12:35 ` Eli Zaretskii
2021-04-26 20:04 ` Lars Ingebrigtsen
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=83ftl85tbn.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=jessenzr@gmail.com \
--cc=stefan@marxist.se \
/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).