emacs-devel
[Top][All Lists]
Advanced

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

Re: Fixing numerous `message' bugs..


From: Dave Goel
Subject: Re: Fixing numerous `message' bugs..
Date: Mon, 10 Dec 2007 14:05:17 -0500
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

>>   
> You're returning 1, where a Lisp_Object is expected.

Thanks.  I corrected it to return val, but still get the same segfault
upon "make bootstrap".  Attached is the current diff, but it is much
easier to simply read the new function I am trying -- 



DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
       doc: /* Display a message at the bottom of the screen.
.
.
usage: (message FORMAT-STRING &rest ARGS)  */)
     (nargs, args)
     int nargs;
     Lisp_Object *args;
{
  if (Fequal(args[0],Qt))
  {
    register Lisp_Object val; 
    Lisp_Object argb[2]; 
    argb[0]=build_string ("%s"); 
    argb[1]=args[1]; 
    val = Fformat (2, argb); 
    message3 (val, SBYTES (val), STRING_MULTIBYTE (val)); 
    return val;
  }
  else
    {
      if (NILP (args[0])
          || (STRINGP (args[0])
              && SBYTES (args[0]) == 0))
        {
          message (0);
          return args[0];
        }
      else
        {
          register Lisp_Object val;
          val = Fformat (nargs, args);
          message3 (val, SBYTES (val), STRING_MULTIBYTE (val));
          return val;
        }
    }
}


The error remains:
.
Loading loadup.el (source)...
.
Loading emacs-lisp/byte-run...
.
.
Loading format...
Loading bindings...
Loading files...
Loading cus-face...
Loading faces...
Loading button...
Loading startup...
make[3]: *** [emacs] Segmentation fault
make[3]: Leaving directory
..
make[2]: *** [src] Error 2


--- editfns.c   2007-12-10 11:56:42.000000000 -0500
+++ editfnsmy.c.200711  2007-12-10 13:59:36.000000000 -0500
@@ -3221,25 +3221,40 @@
 any existing message; this lets the minibuffer contents show.  See
 also `current-message'.
 
+If the first argument is t, the function is equivalent to calling 
+(message "%s" second-argument).
+
 usage: (message FORMAT-STRING &rest ARGS)  */)
      (nargs, args)
      int nargs;
      Lisp_Object *args;
 {
-  if (NILP (args[0])
-      || (STRINGP (args[0])
-         && SBYTES (args[0]) == 0))
+  if (Fequal(args[0],Qt))
     {
-      message (0);
-      return args[0];
+      register Lisp_Object val; 
+      Lisp_Object argb[2]; 
+      argb[0]=build_string ( "%s" ); 
+      argb[1]=args[1]; 
+      val = Fformat (2, argb); 
+      message3 (val, SBYTES (val), STRING_MULTIBYTE (val)); 
+      return val;
     }
   else
     {
-      register Lisp_Object val;
-      val = Fformat (nargs, args);
-      message3 (val, SBYTES (val), STRING_MULTIBYTE (val));
-      return val;
-    }
+      if (NILP (args[0])
+         || (STRINGP (args[0])
+             && SBYTES (args[0]) == 0))
+       {
+         message (0);
+         return args[0];
+       }
+      else
+       {
+         register Lisp_Object val;
+         val = Fformat (nargs, args);
+         message3 (val, SBYTES (val), STRING_MULTIBYTE (val));
+         return val;
+       }}
 }
 
 DEFUN ("message-box", Fmessage_box, Smessage_box, 1, MANY, 0,

reply via email to

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