1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-02 05:32:08 -08:00
emacs/lisp/textmodes
Daniel Mendler e8f26d554b Support cons cell for 'line-spacing'
* etc/NEWS: Announce the change.
* src/dispextern.h (struct glyph_row): Add
'extra_line_spacing_above' member.
(struct it): Add 'extra_line_spacing_above' member.
* src/frame.h (struct frame): Add 'extra_line_spacing_above'
member.  Update comment for 'extra_line_spacing.'
* src/buffer.c (syms_of_buffer): Update the docstring of
'line-spacing' to describe the cons cell usage.
* src/buffer.h (struct buffer): Update comment for
'extra_line_spacing'.
* src/frame.c (gui_set_line_spacing): Handle cons cell value for
'line-spacing'.  Calculate and set 'extra_line_spacing_above'
for both integer and float pairs.
* src/xdisp.c (init_iterator): Initialize 'extra_line_spacing_above'
from buffer or frame 'line-spacing', handling cons cells for both
integer and float values.
(gui_produce_glyphs): Use 'extra_line_spacing_above' to distribute
spacing between ascent and descent.  Update 'max_extra_line_spacing'
calculation.
(resize_mini_window): Take line spacing into account when resizing the
mini window.  Pass height of a single line to 'grow_mini_window' and
'shrink_mini_window'.
* src/window.c (grow_mini_window, shrink_mini_window): Add unit
argument which defines height of a single line.
* src/window.h (grow_mini_window, shrink_mini_window): Adjust function
prototypes accordingly with unit argument.
* lisp/subr.el (total-line-spacing): New function to calculate total
spacing from a number or cons cell.
(posn-col-row): Use total-line-spacing.
* lisp/simple.el (default-line-height): Use 'total-line-spacing'.
* lisp/textmodes/picture.el (picture-mouse-set-point): Use
'total-line-spacing'.
* lisp/window.el (window-default-line-height): Use
'total-line-spacing'.
(window--resize-mini-window): Take 'line-spacing' into account.
* test/lisp/subr-tests.el (total-line-spacing): New test.
* test/src/buffer-tests.el (test-line-spacing): New test.
* doc/emacs/display.texi (Display Custom): Document that
'line-spacing' can be a cons cell.
(Line Height): Document the new cons cell format for 'line-spacing'
to allow vertical centering.

Co-authored-by: Przemysław Alexander Kamiński <alexander@kaminski.se>
Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
2026-01-24 13:32:44 +02:00
..
artist.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
bib-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
bibtex-style.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
bibtex.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
conf-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
css-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dns-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
emacs-authors-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
emacs-news-mode.el ; Remove redundant cl-lib runtime dependencies across lisp/ 2026-01-17 15:32:15 +02:00
enriched.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
fill.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
flyspell.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
glyphless-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
html-ts-mode.el * lisp/textmodes/html-ts-mode.el: Special handling of 'show-paren-mode'. 2026-01-13 09:54:55 +02:00
ispell.el ; Improve docs for last change. 2026-01-14 18:48:56 +00:00
less-css-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
makeinfo.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
markdown-ts-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
mhtml-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
mhtml-ts-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
nroff-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
page-ext.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
page.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
paragraphs.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
picture.el Support cons cell for 'line-spacing' 2026-01-24 13:32:44 +02:00
pixel-fill.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
po.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
refbib.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
refer.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
refill.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
reftex-auc.el ; Remove redundant cl-lib runtime dependencies across lisp/ 2026-01-17 15:32:15 +02:00
reftex-cite.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
reftex-dcr.el ; Remove redundant cl-lib runtime dependencies across lisp/ 2026-01-17 15:32:15 +02:00
reftex-global.el ; Remove redundant cl-lib runtime dependencies across lisp/ 2026-01-17 15:32:15 +02:00
reftex-index.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
reftex-parse.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
reftex-ref.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
reftex-sel.el ; Remove redundant cl-lib runtime dependencies across lisp/ 2026-01-17 15:32:15 +02:00
reftex-toc.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
reftex-vars.el ; Don't mark some symbols as links 2026-01-01 16:12:43 +01:00
reftex.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
remember.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
rst.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
sgml-mode.el sgml-mode.el: Prefer forward-sexp over forward-list 2026-01-13 10:18:46 -05:00
string-edit.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
table.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
tex-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
texinfmt.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
texinfo.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
texnfo-upd.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
text-mode.el New minor mode center-line-mode 2026-01-17 14:33:35 +02:00
tildify.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
toml-ts-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
two-column.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
underline.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
word-wrap-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
yaml-ts-mode.el ; Fix :type of 'yaml-ts-mode-yamllint-options' 2026-01-22 14:52:12 +02:00