]> git.eshelyaron.com Git - emacs.git/commit
Add internal function to enter a labeled restriction
authorGregory Heytings <gregory@heytings.org>
Thu, 6 Jul 2023 17:04:53 +0000 (17:04 +0000)
committerGregory Heytings <gregory@heytings.org>
Thu, 6 Jul 2023 17:14:17 +0000 (17:14 +0000)
commitb741dc7fcde0c601a01470655ceaeeef854ac32e
treee51a18878cf3197c5afa29ad5a5b6ee186a9a97a
parent9b38773a20b43e2354ddf036ffa28e397537da3f
Add internal function to enter a labeled restriction

* src/editfns.c (Finternal__labeled_narrow_to_region): New
function.  A specific function is necessary to avoid unnecessary
slowdowns when 'narrow-to-region'/'widen' are called in a loop.
(Fnarrow_to_region): Remove the call to Fset, which has been moved
into Finternal__labeled_narrow_to_region.
(labeled_narrow_to_region): Use the new function.
(syms_of_editfns): Add the symbol of the new function.

* lisp/subr.el (internal--with-restriction): Use the new function.
lisp/subr.el
src/editfns.c