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 12:41:31 -0500
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)


[...]


I am a C newbie.  I was playing around with editfns.c that would
implement RMS's (message t ..) idea.. , and tried the attached patch.
It seemed to compile fine.  But, compiling via 'make bootstrap' always
fails at the end with a segfault, as seen below.  If I revert to the
original editfns.c, 'make bootstrap' finishes all the way to the end.
Any hints what I am doing wrong?  Thanks.


Loading loadup.el (source)...
(/home/deego/emacscvs-anon/emacs/lisp)
Loading emacs-lisp/byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version.el (source)...
Loading widget...
Loading custom...
Loading emacs-lisp/map-ynp...
Loading cus-start...
Loading international/mule...
Loading international/mule-conf.el (source)...
Loading env...
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 2007-12-10 11:56:34.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 1;
     }
   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]