aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-02-13 20:37:15 +0200
committerEli Zaretskii2023-02-13 20:37:15 +0200
commit4bb27a5ca93f8269d9cd4b85fd948176304236eb (patch)
tree21f7350012e0684b1b1cb96a5eb382fa3e8abdee
parent13bcff3da5ccd1dced73f001e2a18829029507ff (diff)
downloademacs-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.texi18
-rw-r--r--etc/NEWS10
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
1156When the optional @var{label} symbol argument is present however, the 1156@cindex labeled narrowing
1157narrowing is labeled. A labeled narrowing differs from a non-labeled 1157When the optional argument @var{label}, a symbol, is present, the
1158one in several ways: 1158narrowing is @dfn{labeled}. A labeled narrowing differs from a
1159non-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
1178visible on display, and never interfere with narrowings set by the 1179visible on display, and never interfere with narrowings set by the
1179user. 1180user.
1180@end itemize 1181@end itemize
1182
1183If you use @code{with-restriction} with the optional @var{label}
1184argument, we recommend documenting the @var{label} in the doc strings
1185of the functions which use it, so that other Lisp programs your code
1186calls 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
1194When the optional @var{label} argument is present however, the 1200When the optional argument @var{label} is present, the narrowing set
1195narrowing set by @code{with-restriction} with the same @var{label} 1201by @code{with-restriction} with the same @var{label} argument is
1196argument is lifted. 1202lifted.
1197@end defspec 1203@end defspec
diff --git a/etc/NEWS b/etc/NEWS
index db77fdfbb42..35063678f58 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -620,8 +620,14 @@ In buffers in which these display optimizations are in effect, the
620hooks are executed on a narrowed portion of the buffer, whose size is 620hooks are executed on a narrowed portion of the buffer, whose size is
621controlled by the variables 'long-line-optimizations-region-size' and 621controlled 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
624mis-fontifications in these buffers. 624mis-fontifications in these buffers. Modes which are affected by
625these optimizations and by the fact that the buffer is narrowed,
626should adapt and either modify their algorithm so as not to expect the
627entire buffer to be accessible, or, if accessing outside of the
628narrowed region doesn't hurt performance, use the
629'without-restriction' form to temporarily lift the restriction and
630access portions of the buffer outside of the narrowed region.
625 631
626The new function 'long-line-optimizations-p' returns non-nil when 632The new function 'long-line-optimizations-p' returns non-nil when
627these optimizations are in effect in the current buffer. 633these optimizations are in effect in the current buffer.