emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fileio.c


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/fileio.c
Date: Mon, 05 May 2003 14:13:09 -0400

Index: emacs/src/fileio.c
diff -c emacs/src/fileio.c:1.483 emacs/src/fileio.c:1.484
*** emacs/src/fileio.c:1.483    Fri Apr 11 06:59:02 2003
--- emacs/src/fileio.c  Mon May  5 14:13:08 2003
***************
*** 183,188 ****
--- 183,189 ----
  
  /* Functions to be called to create text property annotations for file.  */
  Lisp_Object Vwrite_region_annotate_functions;
+ Lisp_Object Qwrite_region_annotate_functions;
  
  /* During build_annotations, each time an annotation function is called,
     this holds the annotations made by the previous functions.  */
***************
*** 5217,5223 ****
    Lisp_Object p, res;
    struct gcpro gcpro1, gcpro2;
    Lisp_Object original_buffer;
!   int i;
  
    XSETBUFFER (original_buffer, current_buffer);
  
--- 5218,5224 ----
    Lisp_Object p, res;
    struct gcpro gcpro1, gcpro2;
    Lisp_Object original_buffer;
!   int i, used_global = 0;
  
    XSETBUFFER (original_buffer, current_buffer);
  
***************
*** 5227,5232 ****
--- 5228,5242 ----
    while (CONSP (p))
      {
        struct buffer *given_buffer = current_buffer;
+       if (EQ (Qt, XCAR (p)) && !used_global)
+       { /* Use the global value of the hook.  */
+         Lisp_Object arg[2];
+         used_global = 1;
+         arg[0] = Fdefault_value (Qwrite_region_annotate_functions);
+         arg[1] = XCDR (p);
+         p = Fappend (2, arg);
+         continue;
+       }
        Vwrite_region_annotations_so_far = annotations;
        res = call2 (XCAR (p), start, end);
        /* If the function makes a different buffer current,
***************
*** 6449,6456 ****
  insert before the first byte written).  The POSITIONs must be sorted into
  increasing order.  If there are several functions in the list, the several
  lists are merged destructively.  Alternatively, the function can return
! with a different buffer current and value nil.*/);
    Vwrite_region_annotate_functions = Qnil;
  
    DEFVAR_LISP ("write-region-annotations-so-far",
               &Vwrite_region_annotations_so_far,
--- 6459,6471 ----
  insert before the first byte written).  The POSITIONs must be sorted into
  increasing order.  If there are several functions in the list, the several
  lists are merged destructively.  Alternatively, the function can return
! with a different buffer current; in that case it should pay attention
! to the annotations returned by previous functions and listed in
! `write-region-annotations-so-far'.*/);
    Vwrite_region_annotate_functions = Qnil;
+   staticpro (&Qwrite_region_annotate_functions);
+   Qwrite_region_annotate_functions
+     = intern ("write-region-annotate-functions");
  
    DEFVAR_LISP ("write-region-annotations-so-far",
               &Vwrite_region_annotations_so_far,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]