]> code.delx.au - gnu-emacs/blobdiff - src/lread.c
Bump version to 24.1.
[gnu-emacs] / src / lread.c
index 218efd90b364504974e931195e9bf68887a10326..b6135429b4848f32b89d2c74e89f288a9eed3588 100644 (file)
@@ -839,7 +839,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
            }
 
          /* Stop scanning if no colon was found before end marker.  */
-         if (!in_file_vars)
+         if (!in_file_vars || ch == '\n' || ch == EOF)
            break;
 
          while (i > 0 && (var[i - 1] == ' ' || var[i - 1] == '\t'))
@@ -863,8 +863,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
                  ch = READCHAR;
                }
              if (! in_file_vars)
-               /* The value was terminated by an end-marker, which
-                  remove.  */
+               /* The value was terminated by an end-marker, which remove.  */
                i -= 3;
              while (i > 0 && (val[i - 1] == ' ' || val[i - 1] == '\t'))
                i--;
@@ -4169,17 +4168,17 @@ init_lread (void)
       if (! NILP (Fequal (dump_path, Vload_path)))
        {
          Vload_path = decode_env_path (0, normal);
-         if (!NILP (Vinstallation_directory))
+         if (no_site_lisp || !NILP (Vinstallation_directory))
            {
              Lisp_Object tem, tem1, sitelisp;
 
              /* Remove "site-lisp" dirs from front of path temporarily
                 and store them in sitelisp, then conc them on at the
                 end so they're always first in path.
-                 Note that this won't work if you used a
-                 --enable-locallisppath element that does not happen
+                Note that this won't work if you used a
+                --enable-locallisppath element that does not happen
                 to contain "site-lisp" in its name.
-              */
+             */
              sitelisp = Qnil;
              while (1)
                {
@@ -4195,93 +4194,96 @@ init_lread (void)
                    break;
                }
 
-             /* Add to the path the lisp subdir of the
-                installation dir, if it exists.  */
-             tem = Fexpand_file_name (build_string ("lisp"),
-                                      Vinstallation_directory);
-             tem1 = Ffile_exists_p (tem);
-             if (!NILP (tem1))
+             if (!NILP (Vinstallation_directory))
                {
-                 if (NILP (Fmember (tem, Vload_path)))
-                   {
-                     turn_off_warning = 1;
-                     Vload_path = Fcons (tem, Vload_path);
-                   }
-               }
-             else
-               /* That dir doesn't exist, so add the build-time
-                  Lisp dirs instead.  */
-               Vload_path = nconc2 (Vload_path, dump_path);
-
-             /* Add leim under the installation dir, if it exists.  */
-             tem = Fexpand_file_name (build_string ("leim"),
-                                      Vinstallation_directory);
-             tem1 = Ffile_exists_p (tem);
-             if (!NILP (tem1))
-               {
-                 if (NILP (Fmember (tem, Vload_path)))
-                   Vload_path = Fcons (tem, Vload_path);
-               }
-
-             /* Add site-lisp under the installation dir, if it exists.  */
-             if (!no_site_lisp)
-               {
-                 tem = Fexpand_file_name (build_string ("site-lisp"),
+                 /* Add to the path the lisp subdir of the
+                    installation dir, if it exists.  */
+                 tem = Fexpand_file_name (build_string ("lisp"),
                                           Vinstallation_directory);
                  tem1 = Ffile_exists_p (tem);
                  if (!NILP (tem1))
                    {
                      if (NILP (Fmember (tem, Vload_path)))
-                       Vload_path = Fcons (tem, Vload_path);
+                       {
+                         turn_off_warning = 1;
+                         Vload_path = Fcons (tem, Vload_path);
+                       }
                    }
-               }
-
-             /* If Emacs was not built in the source directory,
-                and it is run from where it was built, add to load-path
-                the lisp, leim and site-lisp dirs under that directory.  */
-
-             if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
-               {
-                 Lisp_Object tem2;
+                 else
+                   /* That dir doesn't exist, so add the build-time
+                      Lisp dirs instead.  */
+                   Vload_path = nconc2 (Vload_path, dump_path);
 
-                 tem = Fexpand_file_name (build_string ("src/Makefile"),
+                 /* Add leim under the installation dir, if it exists.  */
+                 tem = Fexpand_file_name (build_string ("leim"),
                                           Vinstallation_directory);
                  tem1 = Ffile_exists_p (tem);
-
-                 /* Don't be fooled if they moved the entire source tree
-                    AFTER dumping Emacs.  If the build directory is indeed
-                    different from the source dir, src/Makefile.in and
-                    src/Makefile will not be found together.  */
-                 tem = Fexpand_file_name (build_string ("src/Makefile.in"),
-                                          Vinstallation_directory);
-                 tem2 = Ffile_exists_p (tem);
-                 if (!NILP (tem1) && NILP (tem2))
+                 if (!NILP (tem1))
                    {
-                     tem = Fexpand_file_name (build_string ("lisp"),
-                                              Vsource_directory);
-
                      if (NILP (Fmember (tem, Vload_path)))
                        Vload_path = Fcons (tem, Vload_path);
+                   }
 
-                     tem = Fexpand_file_name (build_string ("leim"),
-                                              Vsource_directory);
+                 /* Add site-lisp under the installation dir, if it exists.  */
+                 if (!no_site_lisp)
+                   {
+                     tem = Fexpand_file_name (build_string ("site-lisp"),
+                                              Vinstallation_directory);
+                     tem1 = Ffile_exists_p (tem);
+                     if (!NILP (tem1))
+                       {
+                         if (NILP (Fmember (tem, Vload_path)))
+                           Vload_path = Fcons (tem, Vload_path);
+                       }
+                   }
 
-                     if (NILP (Fmember (tem, Vload_path)))
-                       Vload_path = Fcons (tem, Vload_path);
+                 /* If Emacs was not built in the source directory,
+                    and it is run from where it was built, add to load-path
+                    the lisp, leim and site-lisp dirs under that directory.  */
 
-                     if (!no_site_lisp)
+                 if (NILP (Fequal (Vinstallation_directory, Vsource_directory)))
+                   {
+                     Lisp_Object tem2;
+
+                     tem = Fexpand_file_name (build_string ("src/Makefile"),
+                                              Vinstallation_directory);
+                     tem1 = Ffile_exists_p (tem);
+
+                     /* Don't be fooled if they moved the entire source tree
+                        AFTER dumping Emacs.  If the build directory is indeed
+                        different from the source dir, src/Makefile.in and
+                        src/Makefile will not be found together.  */
+                     tem = Fexpand_file_name (build_string ("src/Makefile.in"),
+                                              Vinstallation_directory);
+                     tem2 = Ffile_exists_p (tem);
+                     if (!NILP (tem1) && NILP (tem2))
                        {
-                         tem = Fexpand_file_name (build_string ("site-lisp"),
+                         tem = Fexpand_file_name (build_string ("lisp"),
                                                   Vsource_directory);
 
                          if (NILP (Fmember (tem, Vload_path)))
                            Vload_path = Fcons (tem, Vload_path);
+
+                         tem = Fexpand_file_name (build_string ("leim"),
+                                                  Vsource_directory);
+
+                         if (NILP (Fmember (tem, Vload_path)))
+                           Vload_path = Fcons (tem, Vload_path);
+
+                         if (!no_site_lisp)
+                           {
+                             tem = Fexpand_file_name (build_string ("site-lisp"),
+                                                      Vsource_directory);
+
+                             if (NILP (Fmember (tem, Vload_path)))
+                               Vload_path = Fcons (tem, Vload_path);
+                           }
                        }
-                   }
-               }
+                   } /* Vinstallation_directory != Vsource_directory */
+               }     /* if Vinstallation_directory */
              if (!NILP (sitelisp) && !no_site_lisp)
                Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path);
-           } /* if Vinstallation_directory */
+           } /* if Vinstallation_directory || no_site_lisp */
        }     /* if dump_path == Vload_path */
     }
   else                          /* !initialized */
@@ -4592,7 +4594,8 @@ to load.  See also `load-dangerous-libraries'.  */);
 Non-nil means that the code in the current buffer should be evaluated
 with lexical binding.
 This variable is automatically set from the file variables of an
-interpreted Lisp file read using `load'.  */);
+interpreted Lisp file read using `load'.  Unlike other file local
+variables, this must be set in the first line of a file.  */);
   Fmake_variable_buffer_local (Qlexical_binding);
 
   DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list,