1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

Minor improvements to labeled narrowing

* lisp/subr.el (internal--with-narrowing):
(internal--without-narrowing): Remove unnecessary 'progn'.

* etc/NEWS: Mention 'with-narrowing' in the entry about long
lines.

* doc/lispref/positions.texi (Narrowing): Fix typo.

* doc/lispref/display.texi (Auto Faces): Use @pxref.

* doc/lispref/commands.texi (Command Overview): Use @pxref.
This commit is contained in:
Gregory Heytings 2023-02-13 10:23:39 +00:00
parent 4297039bd1
commit dcb2379a46
5 changed files with 13 additions and 14 deletions

View File

@ -100,8 +100,8 @@ emacs, The GNU Emacs Manual}) runs these two hooks just as a keyboard
command does.
Note that, when the buffer text includes very long lines, these two
hooks are called as if they were in a @code{with-narrowing} form (see
@ref{Narrowing}), with a
hooks are called as if they were in a @code{with-narrowing} form
(@pxref{Narrowing}), with a
@code{long-line-optimizations-in-command-hooks} label and with the
buffer narrowed to a portion around point.

View File

@ -3503,7 +3503,7 @@ usually assign faces to around 400 to 600 characters at each call.
Note that, when the buffer text includes very long lines, these
functions are called as if they were in a @code{with-narrowing} form
(see @ref{Narrowing}), with a
(@pxref{Narrowing}), with a
@code{long-line-optimizations-in-fontification-functions} label and
with the buffer narrowed to a portion around @var{pos}.
@end defvar

View File

@ -1193,5 +1193,5 @@ restores the saved bounds. In that case it is equivalent to
When the optional @var{label} argument is present however, the
narrowing set by @code{with-narrowing} with the same @var{label}
argument are lifted.
argument is lifted.
@end defspec

View File

@ -619,8 +619,9 @@ In buffers in which these display optimizations are in effect, the
'fontification-functions', 'pre-command-hook' and 'post-command-hook'
hooks are executed on a narrowed portion of the buffer, whose size is
controlled by the options 'long-line-optimizations-region-size' and
'long-line-optimizations-bol-search-limit'. This may, in particular,
cause occasional mis-fontifications in these buffers.
'long-line-optimizations-bol-search-limit', as if they were in a
'with-narrowing' form. This may, in particular, cause occasional
mis-fontifications in these buffers.
The new function 'long-line-optimizations-p' returns non-nil when
these optimizations are in effect in the current buffer.

View File

@ -3961,10 +3961,9 @@ same LABEL argument.
(defun internal--with-narrowing (start end body &optional label)
"Helper function for `with-narrowing', which see."
(save-restriction
(progn
(narrow-to-region start end)
(if label (internal--lock-narrowing label))
(funcall body))))
(narrow-to-region start end)
(if label (internal--lock-narrowing label))
(funcall body)))
(defmacro without-narrowing (&rest rest)
"Execute BODY without restrictions.
@ -3984,10 +3983,9 @@ are lifted.
(defun internal--without-narrowing (body &optional label)
"Helper function for `without-narrowing', which see."
(save-restriction
(progn
(if label (internal--unlock-narrowing label))
(widen)
(funcall body))))
(if label (internal--unlock-narrowing label))
(widen)
(funcall body)))
(defun find-tag-default-bounds ()
"Determine the boundaries of the default tag, based on text at point.