From: Robert Pluim <rpluim@gmail.com>
To: Jesse Medeiros <jessenzr@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, Stefan Kangas <stefan@marxist.se>,
emacs-devel@gnu.org
Subject: Re: Patch to vertically center line content when using line-spacing variable
Date: Mon, 09 Sep 2019 10:40:33 +0200 [thread overview]
Message-ID: <m2k1ah7tha.fsf@gmail.com> (raw)
In-Reply-To: <CABDXFDnXYBqDUTZGbh65__ZFCveET-XgTB-MgeO3kJ77mZx6tw@mail.gmail.com> (Jesse Medeiros's message of "Sun, 8 Sep 2019 20:24:50 -0300")
>>>>> On Sun, 8 Sep 2019 20:24:50 -0300, Jesse Medeiros <jessenzr@gmail.com> said:
Jesse> When using line-spacing, the new variable line-spacing-vertical-center
Jesse> can be set to non-nil to center the line content vertically.
Jesse> ---
Jesse> doc/lispref/frames.texi | 5 +++++
Jesse> etc/NEWS | 4 ++++
Jesse> src/buffer.c | 14 ++++++++++++++
Jesse> src/buffer.h | 4 ++++
Jesse> src/xdisp.c | 9 ++++++++-
Jesse> 5 files changed, 35 insertions(+), 1 deletion(-)
Hmm, should this be customizable, like 'line-spacing' is? In any case,
I think the doc string of 'line-spacing' should refer to this new
variable as well.
Also: could this not work as a new type of value for 'line-spacing'
instead? Something like
'(both . 5)
to mean 5 pixels above and below?
Jesse> diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
Jesse> index 618ea16fcf..75a6725f03 100644
Jesse> --- a/doc/lispref/frames.texi
Jesse> +++ b/doc/lispref/frames.texi
Jesse> @@ -1857,6 +1857,11 @@ Layout Parameters
Jesse> Additional space to leave below each text line, in pixels (a positive
Jesse> integer). @xref{Line Height}, for more information.
Jesse> +@vindex line-spacing-vertical-center@r{, a frame parameter}
Jesse> +@item line-spacing-vertical-center
Jesse> +If non-nil, centers the line content vertically when using
Jesse> +using the @code{line-spacing} variable.
Jesse> +
I donʼt think you implemented this as a frame parameter, which means the
documentation should go in "@node Line Height" in display.texi, or you
could implement the frame parameter as well. [1]
Jesse> if (extra_line_spacing > 0)
Jesse> {
Jesse> - it->descent += extra_line_spacing;
Jesse> + if (! BVAR (XBUFFER (it->w->contents), line_spacing_vertical_center))
I think this currently works because Qnil == 0, for now, but you should
probably use NILP.
Footnotes:
[1] line-spacing can be a frame parameter, per-buffer, or a newline overlay
property. Implementing all three is probably overkill.
next prev parent reply other threads:[~2019-09-09 8:40 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
2019-09-08 23:24 ` Jesse Medeiros
2019-09-09 7:39 ` martin rudalics
2019-09-09 8:40 ` Robert Pluim [this message]
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=m2k1ah7tha.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=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).