[Top][All Lists]

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

Re: Fixing numerous `message' bugs..

From: Jason Rumney
Subject: Re: Fixing numerous `message' bugs..
Date: Mon, 10 Dec 2007 18:04:01 +0000
User-agent: Thunderbird (Windows/20071031)

Dave Goel wrote:
> [...]
> 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.
You're returning 1, where a Lisp_Object is expected.

I'd refactor your changes to the following, to make it clearer what is
actually being changed (most of the diff you posted is whitespace
changes due to increased nesting):

   if (NILP (args[0])
       message (0);
       return args[0];
+  else 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 1;
+    }
       register Lisp_Object val;
       val = Fformat (nargs, args);

reply via email to

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