aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2015-12-03 18:26:39 +0200
committerEli Zaretskii2015-12-03 18:26:39 +0200
commite011b22d208f8a2b163721bd2d009b792eb7032c (patch)
tree24a642c3beccd3b37b63a3ed8aa421d63f73f3d5
parent1e1aabbc0931b96d6749839c0d25a23377e3a45b (diff)
downloademacs-e011b22d208f8a2b163721bd2d009b792eb7032c.tar.gz
emacs-e011b22d208f8a2b163721bd2d009b792eb7032c.zip
Document 'window-max-chars-per-line'
* doc/lispref/windows.texi (Window Sizes): Document 'window-max-chars-per-line'.
-rw-r--r--doc/lispref/windows.texi16
-rw-r--r--etc/NEWS19
2 files changed, 26 insertions, 9 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index ead2f7a52f6..5c7947eeca6 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -635,6 +635,22 @@ Functions for retrieving the height and/or width of window dividers
635(@pxref{Scroll Bars}), and display margins (@pxref{Display Margins}) are 635(@pxref{Scroll Bars}), and display margins (@pxref{Display Margins}) are
636described in the corresponding sections. 636described in the corresponding sections.
637 637
638If your Lisp program needs to make layout decisions, you will find the
639following function useful:
640
641@defun window-max-chars-per-line &optional window face
642This function returns the number of characters displayed in the
643specified @var{face} in the specified @var{window} (which must be a
644live window). If @var{face} was remapped (@pxref{Face Remapping}),
645the information is returned for the remapped face. If omitted or
646@code{nil}, @var{face} defaults to the default face, and @var{window}
647defaults to the selected window. Unlike @code{window-body-width},
648this function accounts for the actual size of the @var{face}'s font,
649instead of working in units of frame's canonical character width. It
650also accounts for space used by the continuation glyph, if
651@var{window} lacks one or both of its fringes.
652@end defun
653
638@cindex fixed-size window 654@cindex fixed-size window
639@vindex window-min-height 655@vindex window-min-height
640@vindex window-min-width 656@vindex window-min-width
diff --git a/etc/NEWS b/etc/NEWS
index 0bde705af8c..ad7d81703e0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -181,13 +181,6 @@ for use in Emacs bug reports.
181hiding character but the default `.' can be used by let-binding the 181hiding character but the default `.' can be used by let-binding the
182variable `read-hide-char'. 182variable `read-hide-char'.
183 183
184** A new function `window-max-chars-per-line' returns the maximal
185number of characters that can be displayed on one line. If a face
186and/or window are provided, these values are used for the
187calculation. This function is different from `window-body-width' in
188that it accounts for (i) continuation glyphs, (ii) the size of the
189font, and (iii) the specified window.
190
191** New possible value for `system-type': nacl. 184** New possible value for `system-type': nacl.
192 185
193** Emacs can now load shared/dynamic libraries (modules). 186** Emacs can now load shared/dynamic libraries (modules).
@@ -1230,18 +1223,26 @@ In particular, it now returns the average width of the font's
1230characters, which can be used for geometry-related calculations. 1223characters, which can be used for geometry-related calculations.
1231 1224
1232+++ 1225+++
1233**** A new function `default-font-width' returns the average width of a 1226*** A new function `default-font-width' returns the average width of a
1234character in the current buffer's default font. If the default face 1227character in the current buffer's default font. If the default face
1235is remapped (see `face-remapping-alist'), the value for the remapped 1228is remapped (see `face-remapping-alist'), the value for the remapped
1236face is returned. This function complements the existing function 1229face is returned. This function complements the existing function
1237`default-font-height'. 1230`default-font-height'.
1238 1231
1239+++ 1232+++
1240***** New functions `window-font-height' and `window-font-width' return 1233*** New functions `window-font-height' and `window-font-width' return
1241the height and average width of characters in a specified face and 1234the height and average width of characters in a specified face and
1242window. If FACE is remapped (see `face-remapping-alist'), the 1235window. If FACE is remapped (see `face-remapping-alist'), the
1243function returns the information for the remapped face. 1236function returns the information for the remapped face.
1244 1237
1238+++
1239*** A new function `window-max-chars-per-line' returns the maximal
1240number of characters that can be displayed on one line. If a face
1241and/or window are provided, these values are used for the
1242calculation. This function is different from `window-body-width' in
1243that it accounts for (i) continuation glyphs, (ii) the size of the
1244font, and (iii) the specified window.
1245
1245--- 1246---
1246** New utilities in subr-x.el: 1247** New utilities in subr-x.el:
1247*** New macros `if-let' and `when-let' allow defining bindings and to 1248*** New macros `if-let' and `when-let' allow defining bindings and to