Make 'narrowing-lock' and 'narrowing-unlock' internal

* src/editfns.c (Finternal__lock_narrowing): Renamed from
'narrowing-lock'.
(Finternal__unlock_narrowing): Renamed from 'narrowing-unlock'.
(unwind_narrow_to_region_locked):
(narrow_to_region_locked):
(syms_of_editfns): Use the new names.

* lisp/subr.el (internal--with-narrowing): Use the new name.
This commit is contained in:
Gregory Heytings 2023-02-09 01:09:10 +00:00
parent a4aa32bdff
commit 97314447e6
2 changed files with 9 additions and 7 deletions

View file

@ -3963,7 +3963,7 @@ detailed description.
(save-restriction (save-restriction
(progn (progn
(narrow-to-region start end) (narrow-to-region start end)
(if tag (narrowing-lock tag)) (if tag (internal--lock-narrowing tag))
(funcall body)))) (funcall body))))
(defun find-tag-default-bounds () (defun find-tag-default-bounds ()

View file

@ -2812,7 +2812,7 @@ narrowing_locks_restore (Lisp_Object buf_and_saved_locks)
static void static void
unwind_narrow_to_region_locked (Lisp_Object tag) unwind_narrow_to_region_locked (Lisp_Object tag)
{ {
Fnarrowing_unlock (tag); Finternal__unlock_narrowing (tag);
Fwiden (); Fwiden ();
} }
@ -2821,7 +2821,7 @@ void
narrow_to_region_locked (Lisp_Object begv, Lisp_Object zv, Lisp_Object tag) narrow_to_region_locked (Lisp_Object begv, Lisp_Object zv, Lisp_Object tag)
{ {
Fnarrow_to_region (begv, zv); Fnarrow_to_region (begv, zv);
Fnarrowing_lock (tag); Finternal__lock_narrowing (tag);
record_unwind_protect (restore_point_unwind, Fpoint_marker ()); record_unwind_protect (restore_point_unwind, Fpoint_marker ());
record_unwind_protect (unwind_narrow_to_region_locked, tag); record_unwind_protect (unwind_narrow_to_region_locked, tag);
} }
@ -2932,7 +2932,8 @@ limit of the locked restriction is used instead of the argument. */)
return Qnil; return Qnil;
} }
DEFUN ("narrowing-lock", Fnarrowing_lock, Snarrowing_lock, 1, 1, 0, DEFUN ("internal--lock-narrowing", Finternal__lock_narrowing,
Sinternal__lock_narrowing, 1, 1, 0,
doc: /* Lock the current narrowing with TAG. doc: /* Lock the current narrowing with TAG.
When restrictions are locked, `narrow-to-region' and `widen' can be When restrictions are locked, `narrow-to-region' and `widen' can be
@ -2967,7 +2968,8 @@ not be used as a stronger variant of normal restrictions. */)
return Qnil; return Qnil;
} }
DEFUN ("narrowing-unlock", Fnarrowing_unlock, Snarrowing_unlock, 1, 1, 0, DEFUN ("internal--unlock-narrowing", Finternal__unlock_narrowing,
Sinternal__unlock_narrowing, 1, 1, 0,
doc: /* Unlock a narrowing locked with (narrowing-lock TAG). doc: /* Unlock a narrowing locked with (narrowing-lock TAG).
Unlocking restrictions locked with `narrowing-lock' should be used Unlocking restrictions locked with `narrowing-lock' should be used
@ -4903,8 +4905,8 @@ it to be non-nil. */);
defsubr (&Sdelete_and_extract_region); defsubr (&Sdelete_and_extract_region);
defsubr (&Swiden); defsubr (&Swiden);
defsubr (&Snarrow_to_region); defsubr (&Snarrow_to_region);
defsubr (&Snarrowing_lock); defsubr (&Sinternal__lock_narrowing);
defsubr (&Snarrowing_unlock); defsubr (&Sinternal__unlock_narrowing);
defsubr (&Ssave_restriction); defsubr (&Ssave_restriction);
defsubr (&Stranspose_regions); defsubr (&Stranspose_regions);
} }