1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-10 09:43:26 -08:00
emacs/test/lisp
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
..
align-resources
auth-source-resources
bookmark-resources
calc calc: Improve handling of invalid 'calc-string-maximum-character' 2026-01-17 14:48:06 +02:00
calendar ; calendar-bahai: Move tests and convert to ERT 2026-01-24 13:25:14 +02:00
cedet ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
custom-resources
dabbrev-resources ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dired-resources/insert-directory
emacs-lisp Rename VC outgoing and incoming log commands to include "-root-" 2026-01-14 12:48:02 +00:00
emulation ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
epg-resources
erc ; Don't use cl-letf with generic function in ERC test 2026-01-11 05:25:03 -08:00
eshell ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
faces-resources ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
files-resources Ensure .dir-locals-2.el behavior as documented (bug#75890) 2025-03-22 16:47:27 -04:00
gnus ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
hfy-cmap-resources
image ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
international ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
language ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
loadhist-resources ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
mail ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
mh-e ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
minibuffer-resources
net ; Tramp code cleanup 2026-01-24 10:15:29 +01:00
nxml ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
obsolete ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
org ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
pcmpl-linux-resources
play ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
progmodes Add JSON path utility command to json-ts-mode 2026-01-21 19:27:03 +02:00
saveplace-resources
so-long-tests ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
term ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
textmodes ; Fix one of ispell-tests 2026-01-18 22:15:18 +02:00
time-resources
url ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
use-package ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
vc Automatically detect the VC outgoing base (bug#80006) 2026-01-17 17:17:51 +00:00
xdg-resources
abbrev-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
align-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
allout-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
allout-widgets-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ansi-color-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ansi-osc-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
apropos-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
arc-mode-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
auth-source-pass-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
auth-source-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
autoinsert-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
autorevert-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
battery-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
bookmark-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
buff-menu-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
button-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
calculator-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
char-fold-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
color-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
comint-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
completion-preview-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
completion-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
cus-edit-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
custom-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dabbrev-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
delim-col-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
descr-text-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
desktop-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dired-aux-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dired-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dired-x-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dnd-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
dom-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
edmacro-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
electric-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
elide-head-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
env-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
epg-config-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
epg-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
faces-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ffap-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
filenotify-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
files-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
files-x-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
find-cmd-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
follow-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
font-lock-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
format-spec-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
help-fns-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
help-mode-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
help-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
hfy-cmap-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
hi-lock-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
hl-line-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
htmlfontify-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ibuffer-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ido-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
image-file-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
image-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
imenu-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
info-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
info-xref-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
isearch-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
jit-lock-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
json-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
jsonrpc-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
kmacro-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
loadhist-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
lpr-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ls-lisp-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
man-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
md4-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
minibuffer-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
misc-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
mouse-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
mwheel-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
newcomment-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
obarray-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
paren-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
password-cache-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
pcmpl-linux-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
pcomplete-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
proced-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ps-print-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
register-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
repeat-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
replace-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
rot13-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
savehist-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
saveplace-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
scroll-lock-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
server-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
ses-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
shadowfile-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
shell-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
simple-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
sort-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
soundex-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
speedbar-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
sqlite-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
startup-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
subr-tests.el Support cons cell for 'line-spacing' 2026-01-24 13:32:44 +02:00
tab-bar-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
tabify-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
tar-mode-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
tempo-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
term-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
thingatpt-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
thread-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
time-stamp-tests.el time-stamp-helper-string-used: New test 2026-01-05 15:23:01 -08:00
time-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
timezone-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
uniquify-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
version-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
visual-wrap-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
wdired-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
which-key-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
whitespace-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
wid-edit-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
winner-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
x-dnd-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
xdg-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
xml-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
xt-mouse-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
yank-media-tests.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00