]> git.eshelyaron.com Git - emacs.git/commit
Reworked locked narrowing.
authorGregory Heytings <gregory@heytings.org>
Fri, 25 Nov 2022 17:51:01 +0000 (17:51 +0000)
committerGregory Heytings <gregory@heytings.org>
Fri, 25 Nov 2022 17:51:39 +0000 (18:51 +0100)
commit9dee6df39cd14be78ff96cb24169842f4772488a
tree6f9ffed71e3684ac7a7f6a76025363ec4fa668ff
parentba9315b1641b483f2bf843c38dcdba0cd1643a55
Reworked locked narrowing.

* src/editfns.c: (narrowing_locks): New alist to hold the narrowing
locks and their buffers.
(narrowing_lock_get_bound, narrowing_lock_peek_tag)
(narrowing_lock_push, narrowing_lock_pop): New functions to access
and update 'narrowing_locks'.
(reset_outermost_narrowings, unwind_reset_outermost_narrowing):
Functions moved from src/xdisp.c, and rewritten with the above
functions.
(Fwiden): Use the above functions. Update docstring.
(Fnarrow_to_region, Fnarrowing_lock, Fnarrowing_unlock): Use the above
functions.
(syms_of_editfns): Remove the 'narrowing-locks' variable.

* src/lisp.h: Make 'reset_outermost_narrowings' externally visible.

* src/xdisp.c (reset_outermost_narrowings)
unwind_reset_outermost_narrowing): Functions moved to src/editfns.c.

* lisp/subr.el (with-locked-narrowing): Improved macro, with a helper
function.
lisp/subr.el
src/editfns.c
src/lisp.h
src/xdisp.c