aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorKaroly Lorentey2005-10-23 22:47:29 +0000
committerKaroly Lorentey2005-10-23 22:47:29 +0000
commit6dc59f76f49a35140b3bbdeb9c495609f8e55f3a (patch)
tree3694df29f4ce4ab94220bd377cd0d32b64f98b0a /src/lread.c
parenta095475c5f316eed7b27f6e0e6df52dae53dc2a5 (diff)
parentc286104c51b4510ead8e92d265a84aa661ddbf97 (diff)
downloademacs-6dc59f76f49a35140b3bbdeb9c495609f8e55f3a.tar.gz
emacs-6dc59f76f49a35140b3bbdeb9c495609f8e55f3a.zip
Merged from miles@gnu.org--gnu-2005 (patch 610-614)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-610 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-611 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-612 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-613 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-614 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-429
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/lread.c b/src/lread.c
index 94fb5ddb155..43c7bf6cfc2 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -670,6 +670,11 @@ If optional fourth arg NOSUFFIX is non-nil, don't try adding
670If optional fifth arg MUST-SUFFIX is non-nil, insist on 670If optional fifth arg MUST-SUFFIX is non-nil, insist on
671 the suffix `.elc' or `.el'; don't accept just FILE unless 671 the suffix `.elc' or `.el'; don't accept just FILE unless
672 it ends in one of those suffixes or includes a directory name. 672 it ends in one of those suffixes or includes a directory name.
673
674Loading a file records its definitions, and its `provide' and
675`require' calls, in an element of `load-history' whose
676car is the file name loaded. See `load-history'.
677
673Return t if file exists. */) 678Return t if file exists. */)
674 (file, noerror, nomessage, nosuffix, must_suffix) 679 (file, noerror, nomessage, nosuffix, must_suffix)
675 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; 680 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
@@ -678,7 +683,7 @@ Return t if file exists. */)
678 register int fd = -1; 683 register int fd = -1;
679 int count = SPECPDL_INDEX (); 684 int count = SPECPDL_INDEX ();
680 Lisp_Object temp; 685 Lisp_Object temp;
681 struct gcpro gcpro1; 686 struct gcpro gcpro1, gcpro2;
682 Lisp_Object found, efound; 687 Lisp_Object found, efound;
683 /* 1 means we printed the ".el is newer" message. */ 688 /* 1 means we printed the ".el is newer" message. */
684 int newer = 0; 689 int newer = 0;
@@ -725,7 +730,8 @@ Return t if file exists. */)
725 int size = SBYTES (file); 730 int size = SBYTES (file);
726 Lisp_Object tmp[2]; 731 Lisp_Object tmp[2];
727 732
728 GCPRO1 (file); 733 found = Qnil;
734 GCPRO2 (file, found);
729 735
730 if (! NILP (must_suffix)) 736 if (! NILP (must_suffix))
731 { 737 {
@@ -812,6 +818,8 @@ Return t if file exists. */)
812 struct stat s1, s2; 818 struct stat s1, s2;
813 int result; 819 int result;
814 820
821 GCPRO2 (file, found);
822
815 if (!safe_to_load_p (fd)) 823 if (!safe_to_load_p (fd))
816 { 824 {
817 safe_p = 0; 825 safe_p = 0;
@@ -828,7 +836,6 @@ Return t if file exists. */)
828 836
829 compiled = 1; 837 compiled = 1;
830 838
831 GCPRO1 (efound);
832 efound = ENCODE_FILE (found); 839 efound = ENCODE_FILE (found);
833 840
834#ifdef DOS_NT 841#ifdef DOS_NT
@@ -838,7 +845,6 @@ Return t if file exists. */)
838 SSET (efound, SBYTES (efound) - 1, 0); 845 SSET (efound, SBYTES (efound) - 1, 0);
839 result = stat ((char *)SDATA (efound), &s2); 846 result = stat ((char *)SDATA (efound), &s2);
840 SSET (efound, SBYTES (efound) - 1, 'c'); 847 SSET (efound, SBYTES (efound) - 1, 'c');
841 UNGCPRO;
842 848
843 if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) 849 if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
844 { 850 {
@@ -848,12 +854,13 @@ Return t if file exists. */)
848 /* If we won't print another message, mention this anyway. */ 854 /* If we won't print another message, mention this anyway. */
849 if (!NILP (nomessage)) 855 if (!NILP (nomessage))
850 { 856 {
851 Lisp_Object file; 857 Lisp_Object msg_file;
852 file = Fsubstring (found, make_number (0), make_number (-1)); 858 msg_file = Fsubstring (found, make_number (0), make_number (-1));
853 message_with_string ("Source file `%s' newer than byte-compiled file", 859 message_with_string ("Source file `%s' newer than byte-compiled file",
854 file, 1); 860 msg_file, 1);
855 } 861 }
856 } 862 }
863 UNGCPRO;
857 } 864 }
858 } 865 }
859 else 866 else
@@ -872,12 +879,12 @@ Return t if file exists. */)
872 } 879 }
873 } 880 }
874 881
882 GCPRO2 (file, found);
883
875#ifdef WINDOWSNT 884#ifdef WINDOWSNT
876 emacs_close (fd); 885 emacs_close (fd);
877 GCPRO1 (efound);
878 efound = ENCODE_FILE (found); 886 efound = ENCODE_FILE (found);
879 stream = fopen ((char *) SDATA (efound), fmode); 887 stream = fopen ((char *) SDATA (efound), fmode);
880 UNGCPRO;
881#else /* not WINDOWSNT */ 888#else /* not WINDOWSNT */
882 stream = fdopen (fd, fmode); 889 stream = fdopen (fd, fmode);
883#endif /* not WINDOWSNT */ 890#endif /* not WINDOWSNT */
@@ -904,7 +911,6 @@ Return t if file exists. */)
904 message_with_string ("Loading %s...", file, 1); 911 message_with_string ("Loading %s...", file, 1);
905 } 912 }
906 913
907 GCPRO1 (file);
908 record_unwind_protect (load_unwind, make_save_value (stream, 0)); 914 record_unwind_protect (load_unwind, make_save_value (stream, 0));
909 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); 915 record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
910 specbind (Qload_file_name, found); 916 specbind (Qload_file_name, found);
@@ -912,8 +918,8 @@ Return t if file exists. */)
912 load_descriptor_list 918 load_descriptor_list
913 = Fcons (make_number (fileno (stream)), load_descriptor_list); 919 = Fcons (make_number (fileno (stream)), load_descriptor_list);
914 load_in_progress++; 920 load_in_progress++;
915 readevalloop (Qget_file_char, stream, file, Feval, 921 readevalloop (Qget_file_char, stream, (! NILP (Vpurify_flag) ? file : found),
916 0, Qnil, Qnil, Qnil, Qnil); 922 Feval, 0, Qnil, Qnil, Qnil, Qnil);
917 unbind_to (count, Qnil); 923 unbind_to (count, Qnil);
918 924
919 /* Run any load-hooks for this file. */ 925 /* Run any load-hooks for this file. */
@@ -3880,7 +3886,7 @@ when the corresponding call to `provide' is made. */);
3880 Vafter_load_alist = Qnil; 3886 Vafter_load_alist = Qnil;
3881 3887
3882 DEFVAR_LISP ("load-history", &Vload_history, 3888 DEFVAR_LISP ("load-history", &Vload_history,
3883 doc: /* Alist mapping source file names to symbols and features. 3889 doc: /* Alist mapping file names to symbols and features.
3884Each alist element is a list that starts with a file name, 3890Each alist element is a list that starts with a file name,
3885except for one element (optional) that starts with nil and describes 3891except for one element (optional) that starts with nil and describes
3886definitions evaluated from buffers not visiting files. 3892definitions evaluated from buffers not visiting files.
@@ -3889,7 +3895,10 @@ and cons cells of the form `(provide . FEATURE)', `(require . FEATURE)',
3889`(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'. 3895`(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'.
3890An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)', 3896An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)',
3891and means that SYMBOL was an autoload before this file redefined it 3897and means that SYMBOL was an autoload before this file redefined it
3892as a function. */); 3898as a function.
3899
3900For a preloaded file, the file name recorded is relative to the main Lisp
3901directory. These names are converted to absolute by `file-loadhist-lookup'. */);
3893 Vload_history = Qnil; 3902 Vload_history = Qnil;
3894 3903
3895 DEFVAR_LISP ("load-file-name", &Vload_file_name, 3904 DEFVAR_LISP ("load-file-name", &Vload_file_name,