]> code.delx.au - gnu-emacs/commitdiff
Remove format2
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 30 May 2015 22:29:41 +0000 (15:29 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 30 May 2015 22:30:47 +0000 (15:30 -0700)
* src/editfns.c, src/lisp.h (format2): Remove.
It is more trouble than it's worth, now that we have CALLN.
This is just a minor refactoring.
* src/buffer.c (Fkill_buffer):
* src/dbusbind.c (XD_OBJECT_TO_STRING):
* src/fileio.c (barf_or_query_if_file_exists):
Adjust to format2 going away.

src/buffer.c
src/dbusbind.c
src/editfns.c
src/fileio.c
src/lisp.h

index c78d08c53d289a160af78b3bcc23e4bd1c9c4d12..13843a2ac4ded8897d59e95850b75008498b4801 100644 (file)
@@ -1666,8 +1666,8 @@ cleaning up all windows currently displaying the buffer to be killed. */)
        && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
       {
         GCPRO1 (buffer);
-        tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
-                                      BVAR (b, name), make_number (0)));
+       AUTO_STRING (format, "Buffer %s modified; kill anyway? ");
+       tem = do_yes_or_no_p (CALLN (Fformat, format, BVAR (b, name)));
        UNGCPRO;
        if (NILP (tem))
          return unbind_to (count, Qnil);
index fa26f9e41680c5059c25fa4569de79584be7beb3..54b0217799dd92d9281c231f14e047396723a396 100644 (file)
@@ -233,8 +233,12 @@ xd_symbol_to_dbus_type (Lisp_Object object)
 
 /* Transform the object to its string representation for debug
    messages.  */
-#define XD_OBJECT_TO_STRING(object)                                    \
-  SDATA (format2 ("%s", object, Qnil))
+static char *
+XD_OBJECT_TO_STRING (Lisp_Object object)
+{
+  AUTO_STRING (format, "%s");
+  return SSDATA (CALLN (Fformat, format, object));
+}
 
 #define XD_DBUS_VALIDATE_BUS_ADDRESS(bus)                              \
   do {                                                                 \
index cddb0d4eae679272f5253ea496c6b3b084ef98c5..c387dc78c7db089612c7c7e89052eb2d6636d40f 100644 (file)
@@ -4500,13 +4500,6 @@ usage: (format STRING &rest OBJECTS)  */)
 
   return val;
 }
-
-Lisp_Object
-format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1)
-{
-  AUTO_STRING (format, string1);
-  return CALLN (Fformat, format, arg0, arg1);
-}
 \f
 DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0,
        doc: /* Return t if two characters match, optionally ignoring case.
index a969d3b2c0fc41741a141e0eb89818183610b801..f0f862a4344a9e5bac8af28e10b235030c6b1ba6 100644 (file)
@@ -1811,8 +1811,8 @@ barf_or_query_if_file_exists (Lisp_Object absname, bool known_to_exist,
        xsignal2 (Qfile_already_exists,
                  build_string ("File already exists"), absname);
       GCPRO1 (absname);
-      tem = format2 ("File %s already exists; %s anyway? ",
-                    absname, build_string (querystring));
+      AUTO_STRING (format, "File %s already exists; %s anyway? ");
+      tem = CALLN (Fformat, format, absname, build_string (querystring));
       if (quick)
        tem = call1 (intern ("y-or-n-p"), tem);
       else
index 6d34ce3b05235abe21c66f1e0a991edb5398ac96..198f116fe027f4622b9520e8d1847a8876ab010a 100644 (file)
@@ -4053,7 +4053,6 @@ extern bool let_shadows_global_binding_p (Lisp_Object symbol);
 
 /* Defined in editfns.c.  */
 extern void insert1 (Lisp_Object);
-extern Lisp_Object format2 (const char *, Lisp_Object, Lisp_Object);
 extern Lisp_Object save_excursion_save (void);
 extern Lisp_Object save_restriction_save (void);
 extern void save_excursion_restore (Lisp_Object);