aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2015-05-30 15:29:41 -0700
committerPaul Eggert2015-05-30 15:30:47 -0700
commitd90a3b186d57ac700a32988b720f76f289740ece (patch)
treeca4a9bef4c9ba6bc7f03d02766d1c09247763994 /src
parent75f8653bfe0da39acca9dbcb8b021ad033ac6ae9 (diff)
downloademacs-d90a3b186d57ac700a32988b720f76f289740ece.tar.gz
emacs-d90a3b186d57ac700a32988b720f76f289740ece.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c4
-rw-r--r--src/dbusbind.c8
-rw-r--r--src/editfns.c7
-rw-r--r--src/fileio.c4
-rw-r--r--src/lisp.h1
5 files changed, 10 insertions, 14 deletions
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. */)
1666 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) 1666 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
1667 { 1667 {
1668 GCPRO1 (buffer); 1668 GCPRO1 (buffer);
1669 tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ", 1669 AUTO_STRING (format, "Buffer %s modified; kill anyway? ");
1670 BVAR (b, name), make_number (0))); 1670 tem = do_yes_or_no_p (CALLN (Fformat, format, BVAR (b, name)));
1671 UNGCPRO; 1671 UNGCPRO;
1672 if (NILP (tem)) 1672 if (NILP (tem))
1673 return unbind_to (count, Qnil); 1673 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)
233 233
234/* Transform the object to its string representation for debug 234/* Transform the object to its string representation for debug
235 messages. */ 235 messages. */
236#define XD_OBJECT_TO_STRING(object) \ 236static char *
237 SDATA (format2 ("%s", object, Qnil)) 237XD_OBJECT_TO_STRING (Lisp_Object object)
238{
239 AUTO_STRING (format, "%s");
240 return SSDATA (CALLN (Fformat, format, object));
241}
238 242
239#define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \ 243#define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \
240 do { \ 244 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) */)
4500 4500
4501 return val; 4501 return val;
4502} 4502}
4503
4504Lisp_Object
4505format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1)
4506{
4507 AUTO_STRING (format, string1);
4508 return CALLN (Fformat, format, arg0, arg1);
4509}
4510 4503
4511DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, 4504DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0,
4512 doc: /* Return t if two characters match, optionally ignoring case. 4505 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,
1811 xsignal2 (Qfile_already_exists, 1811 xsignal2 (Qfile_already_exists,
1812 build_string ("File already exists"), absname); 1812 build_string ("File already exists"), absname);
1813 GCPRO1 (absname); 1813 GCPRO1 (absname);
1814 tem = format2 ("File %s already exists; %s anyway? ", 1814 AUTO_STRING (format, "File %s already exists; %s anyway? ");
1815 absname, build_string (querystring)); 1815 tem = CALLN (Fformat, format, absname, build_string (querystring));
1816 if (quick) 1816 if (quick)
1817 tem = call1 (intern ("y-or-n-p"), tem); 1817 tem = call1 (intern ("y-or-n-p"), tem);
1818 else 1818 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);
4053 4053
4054/* Defined in editfns.c. */ 4054/* Defined in editfns.c. */
4055extern void insert1 (Lisp_Object); 4055extern void insert1 (Lisp_Object);
4056extern Lisp_Object format2 (const char *, Lisp_Object, Lisp_Object);
4057extern Lisp_Object save_excursion_save (void); 4056extern Lisp_Object save_excursion_save (void);
4058extern Lisp_Object save_restriction_save (void); 4057extern Lisp_Object save_restriction_save (void);
4059extern void save_excursion_restore (Lisp_Object); 4058extern void save_excursion_restore (Lisp_Object);