diff options
| author | Eli Zaretskii | 2023-02-13 20:37:15 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-02-13 20:37:15 +0200 |
| commit | 4bb27a5ca93f8269d9cd4b85fd948176304236eb (patch) | |
| tree | 21f7350012e0684b1b1cb96a5eb382fa3e8abdee | |
| parent | 13bcff3da5ccd1dced73f001e2a18829029507ff (diff) | |
| download | emacs-4bb27a5ca93f8269d9cd4b85fd948176304236eb.tar.gz emacs-4bb27a5ca93f8269d9cd4b85fd948176304236eb.zip | |
; Minor docs copyedits
* etc/NEWS: Add text about adapting to long-line optimizations.
* doc/lispref/positions.texi (Narrowing): Improve documentation of
labeled narrowing.
| -rw-r--r-- | doc/lispref/positions.texi | 18 | ||||
| -rw-r--r-- | etc/NEWS | 10 |
2 files changed, 20 insertions, 8 deletions
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index f6a0cf14476..1b32f18922c 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi | |||
| @@ -1153,9 +1153,10 @@ saved bounds. In that case it is equivalent to | |||
| 1153 | body) | 1153 | body) |
| 1154 | @end example | 1154 | @end example |
| 1155 | 1155 | ||
| 1156 | When the optional @var{label} symbol argument is present however, the | 1156 | @cindex labeled narrowing |
| 1157 | narrowing is labeled. A labeled narrowing differs from a non-labeled | 1157 | When the optional argument @var{label}, a symbol, is present, the |
| 1158 | one in several ways: | 1158 | narrowing is @dfn{labeled}. A labeled narrowing differs from a |
| 1159 | non-labeled one in several ways: | ||
| 1159 | 1160 | ||
| 1160 | @itemize @bullet | 1161 | @itemize @bullet |
| 1161 | @item | 1162 | @item |
| @@ -1178,6 +1179,11 @@ Labeled narrowings can only be used in Lisp programs: they are never | |||
| 1178 | visible on display, and never interfere with narrowings set by the | 1179 | visible on display, and never interfere with narrowings set by the |
| 1179 | user. | 1180 | user. |
| 1180 | @end itemize | 1181 | @end itemize |
| 1182 | |||
| 1183 | If you use @code{with-restriction} with the optional @var{label} | ||
| 1184 | argument, we recommend documenting the @var{label} in the doc strings | ||
| 1185 | of the functions which use it, so that other Lisp programs your code | ||
| 1186 | calls could lift the labeled narrowing if and when it needs. | ||
| 1181 | @end defspec | 1187 | @end defspec |
| 1182 | 1188 | ||
| 1183 | @defspec without-restriction [:label label] body | 1189 | @defspec without-restriction [:label label] body |
| @@ -1191,7 +1197,7 @@ restores the saved bounds. In that case it is equivalent to | |||
| 1191 | body) | 1197 | body) |
| 1192 | @end example | 1198 | @end example |
| 1193 | 1199 | ||
| 1194 | When the optional @var{label} argument is present however, the | 1200 | When the optional argument @var{label} is present, the narrowing set |
| 1195 | narrowing set by @code{with-restriction} with the same @var{label} | 1201 | by @code{with-restriction} with the same @var{label} argument is |
| 1196 | argument is lifted. | 1202 | lifted. |
| 1197 | @end defspec | 1203 | @end defspec |
| @@ -620,8 +620,14 @@ In buffers in which these display optimizations are in effect, the | |||
| 620 | hooks are executed on a narrowed portion of the buffer, whose size is | 620 | hooks are executed on a narrowed portion of the buffer, whose size is |
| 621 | controlled by the variables 'long-line-optimizations-region-size' and | 621 | controlled by the variables 'long-line-optimizations-region-size' and |
| 622 | 'long-line-optimizations-bol-search-limit', as if they were in a | 622 | 'long-line-optimizations-bol-search-limit', as if they were in a |
| 623 | 'with-restriction form. This may, in particular, cause occasional | 623 | 'with-restriction' form. This may, in particular, cause occasional |
| 624 | mis-fontifications in these buffers. | 624 | mis-fontifications in these buffers. Modes which are affected by |
| 625 | these optimizations and by the fact that the buffer is narrowed, | ||
| 626 | should adapt and either modify their algorithm so as not to expect the | ||
| 627 | entire buffer to be accessible, or, if accessing outside of the | ||
| 628 | narrowed region doesn't hurt performance, use the | ||
| 629 | 'without-restriction' form to temporarily lift the restriction and | ||
| 630 | access portions of the buffer outside of the narrowed region. | ||
| 625 | 631 | ||
| 626 | The new function 'long-line-optimizations-p' returns non-nil when | 632 | The new function 'long-line-optimizations-p' returns non-nil when |
| 627 | these optimizations are in effect in the current buffer. | 633 | these optimizations are in effect in the current buffer. |