From: Paul Eggert Date: Sat, 30 May 2015 22:29:41 +0000 (-0700) Subject: Remove format2 X-Git-Tag: emacs-25.0.90~1913 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d90a3b186d57ac700a32988b720f76f289740ece;p=emacs.git Remove format2 * 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. --- diff --git a/src/buffer.c b/src/buffer.c index c78d08c53d2..13843a2ac4d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -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); diff --git a/src/dbusbind.c b/src/dbusbind.c index fa26f9e4168..54b0217799d 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -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 { \ diff --git a/src/editfns.c b/src/editfns.c index cddb0d4eae6..c387dc78c7d 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -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); -} DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, doc: /* Return t if two characters match, optionally ignoring case. diff --git a/src/fileio.c b/src/fileio.c index a969d3b2c0f..f0f862a4344 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -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 diff --git a/src/lisp.h b/src/lisp.h index 6d34ce3b052..198f116fe02 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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);