/[emacs]/emacs/src/eval.c
ViewVC logotype

Diff of /emacs/src/eval.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.208 by monnier, Thu May 1 19:38:05 2003 UTC revision 1.209 by rms, Fri May 9 14:01:12 2003 UTC
# Line 117  struct specbinding *specpdl; Line 117  struct specbinding *specpdl;
117    
118  /* Pointer to first unused element in specpdl.  */  /* Pointer to first unused element in specpdl.  */
119    
120  struct specbinding *specpdl_ptr;  volatile struct specbinding *specpdl_ptr;
121    
122  /* Maximum size allowed for specpdl allocation */  /* Maximum size allowed for specpdl allocation */
123    
# Line 3070  unbind_to (count, value) Line 3070  unbind_to (count, value)
3070    
3071    while (specpdl_ptr != specpdl + count)    while (specpdl_ptr != specpdl + count)
3072      {      {
3073        --specpdl_ptr;        /* Copy the binding, and decrement specpdl_ptr, before we do
3074             the work to unbind it.  We decrement first
3075             so that an error in unbinding won't try to unbind
3076             the same entry again, and we copy the binding first
3077             in case more bindings are made during some of the code we run.  */
3078    
3079        if (specpdl_ptr->func != 0)        struct specbinding this_binding = *--specpdl_ptr;
3080          (*specpdl_ptr->func) (specpdl_ptr->old_value);  
3081          if (this_binding.func != 0)
3082            (*this_binding.func) (this_binding.old_value);
3083        /* If the symbol is a list, it is really (SYMBOL WHERE        /* If the symbol is a list, it is really (SYMBOL WHERE
3084           . CURRENT-BUFFER) where WHERE is either nil, a buffer, or a           . CURRENT-BUFFER) where WHERE is either nil, a buffer, or a
3085           frame.  If WHERE is a buffer or frame, this indicates we           frame.  If WHERE is a buffer or frame, this indicates we
# Line 3081  unbind_to (count, value) Line 3087  unbind_to (count, value)
3087           binding.  WHERE nil means that the variable had the default           binding.  WHERE nil means that the variable had the default
3088           value when it was bound.  CURRENT-BUFFER is the buffer that           value when it was bound.  CURRENT-BUFFER is the buffer that
3089           was current when the variable was bound.  */           was current when the variable was bound.  */
3090        else if (CONSP (specpdl_ptr->symbol))        else if (CONSP (this_binding.symbol))
3091          {          {
3092            Lisp_Object symbol, where;            Lisp_Object symbol, where;
3093    
3094            symbol = XCAR (specpdl_ptr->symbol);            symbol = XCAR (this_binding.symbol);
3095            where = XCAR (XCDR (specpdl_ptr->symbol));            where = XCAR (XCDR (this_binding.symbol));
3096    
3097            if (NILP (where))            if (NILP (where))
3098              Fset_default (symbol, specpdl_ptr->old_value);              Fset_default (symbol, this_binding.old_value);
3099            else if (BUFFERP (where))            else if (BUFFERP (where))
3100              set_internal (symbol, specpdl_ptr->old_value, XBUFFER (where), 1);              set_internal (symbol, this_binding.old_value, XBUFFER (where), 1);
3101            else            else
3102              set_internal (symbol, specpdl_ptr->old_value, NULL, 1);              set_internal (symbol, this_binding.old_value, NULL, 1);
3103          }          }
3104        else        else
3105          {          {
3106            /* If variable has a trivial value (no forwarding), we can            /* If variable has a trivial value (no forwarding), we can
3107               just set it.  No need to check for constant symbols here,               just set it.  No need to check for constant symbols here,
3108               since that was already done by specbind.  */               since that was already done by specbind.  */
3109            if (!MISCP (SYMBOL_VALUE (specpdl_ptr->symbol)))            if (!MISCP (SYMBOL_VALUE (this_binding.symbol)))
3110              SET_SYMBOL_VALUE (specpdl_ptr->symbol, specpdl_ptr->old_value);              SET_SYMBOL_VALUE (this_binding.symbol, this_binding.old_value);
3111            else            else
3112              set_internal (specpdl_ptr->symbol, specpdl_ptr->old_value, 0, 1);              set_internal (this_binding.symbol, this_binding.old_value, 0, 1);
3113          }          }
3114      }      }
3115    

Legend:
Removed from v.1.208  
changed lines
  Added in v.1.209

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26