@@ -2682,11 +2682,12 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
2682
2682
records the restriction bounds that were current when the first
2683
2683
labeled restriction was entered (which may be a narrowing that was
2684
2684
set by the user and is visible on display). This alist is used
2685
- internally by narrow-to-region, widen, internal--label-restriction,
2686
- internal--unlabel-restriction and save-restriction. For efficiency
2687
- reasons, an alist is used instead of a buffer-local variable:
2688
- otherwise reset_outermost_restrictions, which is called during each
2689
- redisplay cycle, would have to loop through all live buffers. */
2685
+ internally by narrow-to-region, internal--labeled-narrow-to-region,
2686
+ widen, internal--unlabel-restriction and save-restriction. For
2687
+ efficiency reasons, an alist is used instead of a buffer-local
2688
+ variable: otherwise reset_outermost_restrictions, which is called
2689
+ during each redisplay cycle, would have to loop through all live
2690
+ buffers. */
2690
2691
static Lisp_Object labeled_restrictions ;
2691
2692
2692
2693
/* Add BUF with its list of labeled RESTRICTIONS in the
@@ -2884,7 +2885,6 @@ To gain access to other portions of the buffer, use
2884
2885
`without-restriction' with the same label. */ )
2885
2886
(void )
2886
2887
{
2887
- Fset (Qoutermost_restriction , Qnil );
2888
2888
Lisp_Object buf = Fcurrent_buffer ();
2889
2889
Lisp_Object label = labeled_restrictions_peek_label (buf );
2890
2890
@@ -2981,20 +2981,18 @@ argument. To gain access to other portions of the buffer, use
2981
2981
return Qnil ;
2982
2982
}
2983
2983
2984
- DEFUN ("internal--label-restriction " , Finternal__label_restriction ,
2985
- Sinternal__label_restriction , 1 , 1 , 0 ,
2986
- doc : /* Label the current restriction with LABEL.
2984
+ DEFUN ("internal--labeled-narrow-to-region " , Finternal__labeled_narrow_to_region ,
2985
+ Sinternal__labeled_narrow_to_region , 3 , 3 , 0 ,
2986
+ doc : /* Restrict editing in this buffer to START-END, and label the restriction with LABEL.
2987
2987
2988
2988
This is an internal function used by `with-restriction'. */ )
2989
- (Lisp_Object label )
2989
+ (Lisp_Object start , Lisp_Object end , Lisp_Object label )
2990
2990
{
2991
2991
Lisp_Object buf = Fcurrent_buffer ();
2992
- Lisp_Object outermost_restriction
2993
- = buffer_local_value (Qoutermost_restriction , buf );
2994
- /* If internal--label-restriction is ever called without being
2995
- preceded by narrow-to-region, do nothing. */
2996
- if (NILP (outermost_restriction ))
2997
- return Qnil ;
2992
+ Lisp_Object outermost_restriction = list3 (Qoutermost_restriction ,
2993
+ Fpoint_min_marker (),
2994
+ Fpoint_max_marker ());
2995
+ Fnarrow_to_region (start , end );
2998
2996
if (NILP (labeled_restrictions_peek_label (buf )))
2999
2997
labeled_restrictions_push (buf , outermost_restriction );
3000
2998
labeled_restrictions_push (buf , list3 (label ,
@@ -3003,24 +3001,6 @@ This is an internal function used by `with-restriction'. */)
3003
3001
return Qnil ;
3004
3002
}
3005
3003
3006
- DEFUN ("internal--labeled-narrow-to-region" , Finternal__labeled_narrow_to_region ,
3007
- Sinternal__labeled_narrow_to_region , 3 , 3 , 0 ,
3008
- doc : /* Restrict editing to START-END, and label the restriction with LABEL.
3009
-
3010
- This is an internal function used by `with-restriction'. */ )
3011
- (Lisp_Object start , Lisp_Object end , Lisp_Object label )
3012
- {
3013
- /* Record the accessible range of the buffer when narrow-to-region
3014
- is called, that is, before applying the narrowing. That
3015
- information is used only by internal--label-restriction. */
3016
- Fset (Qoutermost_restriction , list3 (Qoutermost_restriction ,
3017
- Fpoint_min_marker (),
3018
- Fpoint_max_marker ()));
3019
- Fnarrow_to_region (start , end );
3020
- Finternal__label_restriction (label );
3021
- return Qnil ;
3022
- }
3023
-
3024
3004
DEFUN ("internal--unlabel-restriction" , Finternal__unlabel_restriction ,
3025
3005
Sinternal__unlabel_restriction , 1 , 1 , 0 ,
3026
3006
doc : /* If the current restriction is labeled with LABEL, remove its label.
@@ -4875,10 +4855,6 @@ This variable is experimental; email
[email protected] if you need
4875
4855
it to be non-nil. */ );
4876
4856
binary_as_unsigned = false;
4877
4857
4878
- DEFVAR_LISP ("outermost-restriction" , Voutermost_restriction ,
4879
- doc : /* Outermost narrowing bounds, if any. Internal use only. */ );
4880
- Voutermost_restriction = Qnil ;
4881
- Fmake_variable_buffer_local (Qoutermost_restriction );
4882
4858
DEFSYM (Qoutermost_restriction , "outermost-restriction" );
4883
4859
Funintern (Qoutermost_restriction , Qnil );
4884
4860
@@ -4973,7 +4949,6 @@ it to be non-nil. */);
4973
4949
defsubr (& Sdelete_and_extract_region );
4974
4950
defsubr (& Swiden );
4975
4951
defsubr (& Snarrow_to_region );
4976
- defsubr (& Sinternal__label_restriction );
4977
4952
defsubr (& Sinternal__labeled_narrow_to_region );
4978
4953
defsubr (& Sinternal__unlabel_restriction );
4979
4954
defsubr (& Ssave_restriction );
0 commit comments