changeset 4975:c5cb3cb79110

Automatic merge
author Ben Wing <ben@xemacs.org>
date Fri, 05 Feb 2010 04:27:45 -0600
parents fe0d3106cc36 (current diff) 3bf1b0f0c391 (diff)
children f48bf636045f
files src/ChangeLog
diffstat 6 files changed, 62 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Feb 05 04:07:47 2010 -0600
+++ b/src/ChangeLog	Fri Feb 05 04:27:45 2010 -0600
@@ -7,6 +7,40 @@
 
 2010-02-04  Ben Wing  <ben@xemacs.org>
 
+	* emacs.c (SHEBANG_EXE_PROGNAME_LENGTH):
+	* emacs.c (main_1):
+	Restore old definition of SHEBANG_EXE_PROGNAME_LENGTH; not possible
+	to ANSI-concatenate wide and narrow strings.
+	* print.c (write_msg_istring):
+	* print.c (write_msg_cistring):
+	* print.c (write_msg_ascstring):
+	Can't return a value in a void-declared function.
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
+	* filelock.c:
+	* filelock.c (fill_in_lock_file_name):
+	Name the lock symlink file .#FN# instead of .#FN for file FN, so
+	that the link file doesn't have a .c or .el or whatever extension,
+	which confuses programs/functions that search by extension (e.g.
+	etags, byte-recompile-directory, etc.).
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_nodump):
+	* symbols.c (defsymbol):
+	* symbols.c (defkeyword):
+	* symeval.h (DEFVAR_SYMVAL_FWD_OBJECT):
+	Put this back again:
+	
+	Make the various calls to staticpro() instead call staticpro_1(),
+	passing in the name of the C var being staticpro'ed, so that it
+	shows up in staticpro_names.  Otherwise staticpro_names just has
+	1000+ copies of the word `location'.
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
 	* bytecode.c (assert_failed_with_remembered_ops):
 	* bytecode.c (init_opcode_table_multi_op):
 	Declare some things const to shut up G++ v4 warnings.
--- a/src/emacs.c	Fri Feb 05 04:07:47 2010 -0600
+++ b/src/emacs.c	Fri Feb 05 04:27:45 2010 -0600
@@ -937,7 +937,7 @@
 #define SHEBANG_PROGNAME_LENGTH                                         \
   (int)((sizeof (WEXTSTRING (SHEBANG_PROGNAME)) - sizeof (WEXTSTRING (""))))
 #define SHEBANG_EXE_PROGNAME_LENGTH			\
-  (int)(sizeof (WEXTSTRING (SHEBANG_PROGNAME ".exe"))	\
+  (int)(sizeof (WEXTSTRING (SHEBANG_PROGNAME) WEXTSTRING (".exe"))	\
         - sizeof (WEXTSTRING ("")))
 
   {
--- a/src/filelock.c	Fri Feb 05 04:07:47 2010 -0600
+++ b/src/filelock.c	Fri Feb 05 04:27:45 2010 -0600
@@ -1,5 +1,5 @@
 /* Copyright (C) 1985, 86, 87, 93, 94, 96 Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -38,7 +38,7 @@
 
 #ifdef CLASH_DETECTION
 
-/* The strategy: to lock a file FN, create a symlink .#FN in FN's
+/* The strategy: to lock a file FN, create a symlink .#FN# in FN's
    directory, with link data `user@host.pid'.  This avoids a single
    mount (== failure) point for lock files.
 
@@ -67,12 +67,18 @@
    file names, because those are all the same systems that don't have
    symlinks.
 
-   This is compatible with the locking scheme used by Interleaf (which
-   has contributed this implementation for Emacs), and was designed by
-   Ethan Jacobson, Kimbo Mundy, and others.
+   Originally we used a name .#FN without the final #; this may have been
+   compatible with the locking scheme used by Interleaf (which has
+   contributed this implementation for Emacs), and was designed by Ethan
+   Jacobson, Kimbo Mundy, and others.
 
    --karl@cs.umb.edu/karl@hq.ileaf.com.  */
 
+/* NOTE:  We added the final # in the name .#FN# so that programs
+   that e.g. search for all .c files, such as etags, or try to
+   byte-compile all .el files in a directory (byte-recompile-directory),
+   won't get tripped up by the bogus symlink file. --ben */
+
 
 /* Here is the structure that stores information about a lock.  */
 
@@ -93,10 +99,11 @@
     xfree ((i).host, Ibyte *);			\
   } while (0)
 
-/* Write the name of the lock file for FN into LFNAME.  Length will be
-   that of FN plus two more for the leading `.#' plus one for the null.  */
+/* Write the name of the lock file for FN into LFNAME.  Length will be that
+   of FN plus two more for the leading `.#' plus one for the trailing #
+   plus one for the null.  */
 #define MAKE_LOCK_NAME(lock, file) \
-  (lock = alloca_ibytes (XSTRING_LENGTH (file) + 2 + 1), \
+  (lock = alloca_ibytes (XSTRING_LENGTH (file) + 2 + 1 + 1), \
    fill_in_lock_file_name (lock, file))
 
 static void
@@ -116,7 +123,10 @@
   p = lockfile + dirlen;
   *(p++) = '.';
   *(p++) = '#';
-  memcpy (p, file_name + dirlen, XSTRING_LENGTH (fn) - dirlen + 1);
+  memcpy (p, file_name + dirlen, XSTRING_LENGTH (fn) - dirlen);
+  p += XSTRING_LENGTH (fn) - dirlen;
+  *(p++) = '#';
+  *p = '\0';
 }
 
 /* Lock the lock file named LFNAME.
--- a/src/print.c	Fri Feb 05 04:07:47 2010 -0600
+++ b/src/print.c	Fri Feb 05 04:27:45 2010 -0600
@@ -680,14 +680,14 @@
 write_msg_istring (Lisp_Object stream, const Ibyte *str)
 {
   /* This function can GC */
-  return write_istring (stream, IGETTEXT (str));
+  write_istring (stream, IGETTEXT (str));
 }
 
 void
 write_msg_cistring (Lisp_Object stream, const CIbyte *str)
 {
   /* This function can GC */
-  return write_msg_istring (stream, (const Ibyte *) str);
+  write_msg_istring (stream, (const Ibyte *) str);
 }
 
 void
@@ -695,7 +695,7 @@
 {
   /* This function can GC */
   ASSERT_ASCTEXT_ASCII (str);
-  return write_msg_istring (stream, (const Ibyte *) str);
+  write_msg_istring (stream, (const Ibyte *) str);
 }
 
 void
--- a/src/symbols.c	Fri Feb 05 04:07:47 2010 -0600
+++ b/src/symbols.c	Fri Feb 05 04:27:45 2010 -0600
@@ -3621,9 +3621,9 @@
       temp[i] = '-';
   *location = Fintern (make_string ((const Ibyte *) temp, len), Qnil);
   if (dump_p)
-    staticpro (location);
+    staticpro_1 (location, name);
   else
-    staticpro_nodump (location);
+    staticpro_nodump_1 (location, name);
 }
 
 void
@@ -3657,7 +3657,7 @@
   *location = Fintern (make_string_nocopy ((const Ibyte *) name,
 					   strlen (name)),
 		       Qnil);
-  staticpro_nodump (location);
+  staticpro_nodump_1 (location, name);
 }
 
 void
@@ -3666,7 +3666,7 @@
   *location = Fintern (make_string_nocopy ((const Ibyte *) name,
 					   strlen (name)),
 		       Qnil);
-  staticpro (location);
+  staticpro_1 (location, name);
 }
 
 void
--- a/src/symeval.h	Fri Feb 05 04:07:47 2010 -0600
+++ b/src/symeval.h	Fri Feb 05 04:27:45 2010 -0600
@@ -460,7 +460,7 @@
   DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun);	    \
   {									    \
     Lisp_Object *DSF_location = c_location; /* Type check */		    \
-    staticpro (DSF_location);						    \
+    staticpro_1 (DSF_location, lname);					    \
     if (EQ (*DSF_location, Qnull_pointer)) *DSF_location = Qnil;	    \
   }									    \
 } while (0)