emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/src/lread.c
Date: Fri, 21 Oct 2005 12:54:14 -0400

Index: emacs/src/lread.c
diff -c emacs/src/lread.c:1.339 emacs/src/lread.c:1.340
*** emacs/src/lread.c:1.339     Sun Aug  7 12:33:17 2005
--- emacs/src/lread.c   Fri Oct 21 16:54:13 2005
***************
*** 669,674 ****
--- 669,679 ----
  If optional fifth arg MUST-SUFFIX is non-nil, insist on
   the suffix `.elc' or `.el'; don't accept just FILE unless
   it ends in one of those suffixes or includes a directory name.
+ 
+ Loading a file records its definitions, and its `provide' and
+ `require' calls, in an element of `load-history' whose
+ car is the file name loaded.  See `load-history'.
+ 
  Return t if file exists.  */)
       (file, noerror, nomessage, nosuffix, must_suffix)
       Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
***************
*** 677,683 ****
    register int fd = -1;
    int count = SPECPDL_INDEX ();
    Lisp_Object temp;
!   struct gcpro gcpro1;
    Lisp_Object found, efound;
    /* 1 means we printed the ".el is newer" message.  */
    int newer = 0;
--- 682,688 ----
    register int fd = -1;
    int count = SPECPDL_INDEX ();
    Lisp_Object temp;
!   struct gcpro gcpro1, gcpro2;
    Lisp_Object found, efound;
    /* 1 means we printed the ".el is newer" message.  */
    int newer = 0;
***************
*** 724,730 ****
        int size = SBYTES (file);
        Lisp_Object tmp[2];
  
!       GCPRO1 (file);
  
        if (! NILP (must_suffix))
        {
--- 729,736 ----
        int size = SBYTES (file);
        Lisp_Object tmp[2];
  
!       found = Qnil;
!       GCPRO2 (file, found);
  
        if (! NILP (must_suffix))
        {
***************
*** 811,816 ****
--- 817,824 ----
          struct stat s1, s2;
          int result;
  
+         GCPRO2 (file, found);
+ 
          if (!safe_to_load_p (fd))
            {
              safe_p = 0;
***************
*** 827,833 ****
  
          compiled = 1;
  
-         GCPRO1 (efound);
          efound = ENCODE_FILE (found);
  
  #ifdef DOS_NT
--- 835,840 ----
***************
*** 837,843 ****
          SSET (efound, SBYTES (efound) - 1, 0);
          result = stat ((char *)SDATA (efound), &s2);
          SSET (efound, SBYTES (efound) - 1, 'c');
-         UNGCPRO;
  
          if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
            {
--- 844,849 ----
***************
*** 847,858 ****
              /* If we won't print another message, mention this anyway.  */
              if (!NILP (nomessage))
                {
!                 Lisp_Object file;
!                 file = Fsubstring (found, make_number (0), make_number (-1));
                  message_with_string ("Source file `%s' newer than 
byte-compiled file",
!                                      file, 1);
                }
            }
        }
      }
    else
--- 853,865 ----
              /* If we won't print another message, mention this anyway.  */
              if (!NILP (nomessage))
                {
!                 Lisp_Object msg_file;
!                 msg_file = Fsubstring (found, make_number (0), make_number 
(-1));
                  message_with_string ("Source file `%s' newer than 
byte-compiled file",
!                                      msg_file, 1);
                }
            }
+         UNGCPRO;
        }
      }
    else
***************
*** 871,882 ****
        }
      }
  
  #ifdef WINDOWSNT
    emacs_close (fd);
-   GCPRO1 (efound);
    efound = ENCODE_FILE (found);
    stream = fopen ((char *) SDATA (efound), fmode);
-   UNGCPRO;
  #else  /* not WINDOWSNT */
    stream = fdopen (fd, fmode);
  #endif /* not WINDOWSNT */
--- 878,889 ----
        }
      }
  
+   GCPRO2 (file, found);
+ 
  #ifdef WINDOWSNT
    emacs_close (fd);
    efound = ENCODE_FILE (found);
    stream = fopen ((char *) SDATA (efound), fmode);
  #else  /* not WINDOWSNT */
    stream = fdopen (fd, fmode);
  #endif /* not WINDOWSNT */
***************
*** 903,909 ****
        message_with_string ("Loading %s...", file, 1);
      }
  
-   GCPRO1 (file);
    record_unwind_protect (load_unwind, make_save_value (stream, 0));
    record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
    specbind (Qload_file_name, found);
--- 910,915 ----
***************
*** 911,918 ****
    load_descriptor_list
      = Fcons (make_number (fileno (stream)), load_descriptor_list);
    load_in_progress++;
!   readevalloop (Qget_file_char, stream, file, Feval,
!               0, Qnil, Qnil, Qnil, Qnil);
    unbind_to (count, Qnil);
  
    /* Run any load-hooks for this file.  */
--- 917,924 ----
    load_descriptor_list
      = Fcons (make_number (fileno (stream)), load_descriptor_list);
    load_in_progress++;
!   readevalloop (Qget_file_char, stream, (! NILP (Vpurify_flag) ? file : 
found),
!               Feval, 0, Qnil, Qnil, Qnil, Qnil);
    unbind_to (count, Qnil);
  
    /* Run any load-hooks for this file.  */
***************
*** 3879,3885 ****
    Vafter_load_alist = Qnil;
  
    DEFVAR_LISP ("load-history", &Vload_history,
!              doc: /* Alist mapping source file names to symbols and features.
  Each alist element is a list that starts with a file name,
  except for one element (optional) that starts with nil and describes
  definitions evaluated from buffers not visiting files.
--- 3885,3891 ----
    Vafter_load_alist = Qnil;
  
    DEFVAR_LISP ("load-history", &Vload_history,
!              doc: /* Alist mapping file names to symbols and features.
  Each alist element is a list that starts with a file name,
  except for one element (optional) that starts with nil and describes
  definitions evaluated from buffers not visiting files.
***************
*** 3888,3894 ****
  `(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'.
  An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)',
  and means that SYMBOL was an autoload before this file redefined it
! as a function.  */);
    Vload_history = Qnil;
  
    DEFVAR_LISP ("load-file-name", &Vload_file_name,
--- 3894,3903 ----
  `(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'.
  An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)',
  and means that SYMBOL was an autoload before this file redefined it
! as a function.
! 
! For a preloaded file, the file name recorded is relative to the main Lisp
! directory.  These names are converted to absolute by `file-loadhist-lookup'.  
*/);
    Vload_history = Qnil;
  
    DEFVAR_LISP ("load-file-name", &Vload_file_name,




reply via email to

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