aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJim Porter2024-07-27 20:48:38 -0700
committerJim Porter2024-08-04 10:46:28 -0700
commitf70a6ea0ea86ef461e40d20664a75a92d02679ea (patch)
tree63b555139d21a08e2701acfd23b1cca9f0300025 /doc
parent0756f3085ea948c945e309e2ce347fc5ab836574 (diff)
downloademacs-f70a6ea0ea86ef461e40d20664a75a92d02679ea.tar.gz
emacs-f70a6ea0ea86ef461e40d20664a75a92d02679ea.zip
Add support for variable-pitch fonts in 'visual-wrap-prefix-mode'
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Allow passing BUFFER to use the face remappings from that buffer when calculating the width. * lisp/visual-wrap.el (visual-wrap--prefix): Rename to... (visual-wrap--adjust-prefix): ... this, and support PREFIX as a number. (visual-wrap-fill-context-prefix): Make obsolete in favor of... (visual-wrap--content-prefix): ... this. (visual-wrap-prefix-function): Extract inside of loop into... (visual-wrap--apply-to-line): ... this. * doc/lispref/display.texi (Size of Displayed Text): Update documentation for 'string-pixel-width'. * etc/NEWS: Announce this change.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/display.texi6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 195464ef7f5..d28ff9ead26 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2385,9 +2385,11 @@ The optional arguments @var{x-limit} and @var{y-limit} have the same
2385meaning as with @code{window-text-pixel-size}. 2385meaning as with @code{window-text-pixel-size}.
2386@end defun 2386@end defun
2387 2387
2388@defun string-pixel-width string 2388@defun string-pixel-width string &optional buffer
2389This is a convenience function that uses @code{window-text-pixel-size} 2389This is a convenience function that uses @code{window-text-pixel-size}
2390to compute the width of @var{string} (in pixels). 2390to compute the width of @var{string} (in pixels). If @var{buffer} is
2391non-@code{nil}, use any face remappings (@pxref{Face Remapping}) from
2392that buffer when computing the width of @var{string}.
2391@end defun 2393@end defun
2392 2394
2393@defun line-pixel-height 2395@defun line-pixel-height