1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

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.
This commit is contained in:
Paul Eggert 2015-05-30 15:29:41 -07:00
parent 75f8653bfe
commit d90a3b186d
5 changed files with 10 additions and 14 deletions

View 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);

View 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 { \

View 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);
}
DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0,
doc: /* Return t if two characters match, optionally ignoring case.

View 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

View 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);