diff options
| author | Eli Zaretskii | 2015-12-03 18:26:39 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-12-03 18:26:39 +0200 |
| commit | e011b22d208f8a2b163721bd2d009b792eb7032c (patch) | |
| tree | 24a642c3beccd3b37b63a3ed8aa421d63f73f3d5 | |
| parent | 1e1aabbc0931b96d6749839c0d25a23377e3a45b (diff) | |
| download | emacs-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.texi | 16 | ||||
| -rw-r--r-- | etc/NEWS | 19 |
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 |
| 636 | described in the corresponding sections. | 636 | described in the corresponding sections. |
| 637 | 637 | ||
| 638 | If your Lisp program needs to make layout decisions, you will find the | ||
| 639 | following function useful: | ||
| 640 | |||
| 641 | @defun window-max-chars-per-line &optional window face | ||
| 642 | This function returns the number of characters displayed in the | ||
| 643 | specified @var{face} in the specified @var{window} (which must be a | ||
| 644 | live window). If @var{face} was remapped (@pxref{Face Remapping}), | ||
| 645 | the information is returned for the remapped face. If omitted or | ||
| 646 | @code{nil}, @var{face} defaults to the default face, and @var{window} | ||
| 647 | defaults to the selected window. Unlike @code{window-body-width}, | ||
| 648 | this function accounts for the actual size of the @var{face}'s font, | ||
| 649 | instead of working in units of frame's canonical character width. It | ||
| 650 | also 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 |
| @@ -181,13 +181,6 @@ for use in Emacs bug reports. | |||
| 181 | hiding character but the default `.' can be used by let-binding the | 181 | hiding character but the default `.' can be used by let-binding the |
| 182 | variable `read-hide-char'. | 182 | variable `read-hide-char'. |
| 183 | 183 | ||
| 184 | ** A new function `window-max-chars-per-line' returns the maximal | ||
| 185 | number of characters that can be displayed on one line. If a face | ||
| 186 | and/or window are provided, these values are used for the | ||
| 187 | calculation. This function is different from `window-body-width' in | ||
| 188 | that it accounts for (i) continuation glyphs, (ii) the size of the | ||
| 189 | font, 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 | |||
| 1230 | characters, which can be used for geometry-related calculations. | 1223 | characters, 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 |
| 1234 | character in the current buffer's default font. If the default face | 1227 | character in the current buffer's default font. If the default face |
| 1235 | is remapped (see `face-remapping-alist'), the value for the remapped | 1228 | is remapped (see `face-remapping-alist'), the value for the remapped |
| 1236 | face is returned. This function complements the existing function | 1229 | face 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 |
| 1241 | the height and average width of characters in a specified face and | 1234 | the height and average width of characters in a specified face and |
| 1242 | window. If FACE is remapped (see `face-remapping-alist'), the | 1235 | window. If FACE is remapped (see `face-remapping-alist'), the |
| 1243 | function returns the information for the remapped face. | 1236 | function returns the information for the remapped face. |
| 1244 | 1237 | ||
| 1238 | +++ | ||
| 1239 | *** A new function `window-max-chars-per-line' returns the maximal | ||
| 1240 | number of characters that can be displayed on one line. If a face | ||
| 1241 | and/or window are provided, these values are used for the | ||
| 1242 | calculation. This function is different from `window-body-width' in | ||
| 1243 | that it accounts for (i) continuation glyphs, (ii) the size of the | ||
| 1244 | font, 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 |