Mercurial > emacs
comparison src/editfns.c @ 13878:2a71500dfb93
(Fmessage_box, Fmessage_or_box):
HAVE_X_MENU renamed to HAVE_MENUS. Doc fixes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 28 Dec 1995 16:48:52 +0000 |
parents | 862fff660446 |
children | 59906ecd9b92 |
comparison
equal
deleted
inserted
replaced
13877:44149f0bf44a | 13878:2a71500dfb93 |
---|---|
1748 } | 1748 } |
1749 | 1749 |
1750 DEFUN ("message-box", Fmessage_box, Smessage_box, 1, MANY, 0, | 1750 DEFUN ("message-box", Fmessage_box, Smessage_box, 1, MANY, 0, |
1751 "Display a message, in a dialog box if possible.\n\ | 1751 "Display a message, in a dialog box if possible.\n\ |
1752 If a dialog box is not available, use the echo area.\n\ | 1752 If a dialog box is not available, use the echo area.\n\ |
1753 The first argument is a control string.\n\ | 1753 The first argument is a format control string, and the rest are data\n\ |
1754 It may contain %s or %d or %c to print successive following arguments.\n\ | 1754 to be formatted under control of the string. See `format' for details.\n\ |
1755 %s means print an argument as a string, %d means print as number in decimal,\n\ | 1755 \n\ |
1756 %c means print a number as a single character.\n\ | |
1757 The argument used by %s must be a string or a symbol;\n\ | |
1758 the argument used by %d or %c must be a number.\n\ | |
1759 If the first argument is nil, clear any existing message; let the\n\ | 1756 If the first argument is nil, clear any existing message; let the\n\ |
1760 minibuffer contents show.") | 1757 minibuffer contents show.") |
1761 (nargs, args) | 1758 (nargs, args) |
1762 int nargs; | 1759 int nargs; |
1763 Lisp_Object *args; | 1760 Lisp_Object *args; |
1769 } | 1766 } |
1770 else | 1767 else |
1771 { | 1768 { |
1772 register Lisp_Object val; | 1769 register Lisp_Object val; |
1773 val = Fformat (nargs, args); | 1770 val = Fformat (nargs, args); |
1774 #ifdef HAVE_X_MENU | 1771 #ifdef HAVE_MENUS |
1775 { | 1772 { |
1776 Lisp_Object pane, menu, obj; | 1773 Lisp_Object pane, menu, obj; |
1777 struct gcpro gcpro1; | 1774 struct gcpro gcpro1; |
1778 pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); | 1775 pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); |
1779 GCPRO1 (pane); | 1776 GCPRO1 (pane); |
1780 menu = Fcons (val, pane); | 1777 menu = Fcons (val, pane); |
1781 obj = Fx_popup_dialog (Qt, menu); | 1778 obj = Fx_popup_dialog (Qt, menu); |
1782 UNGCPRO; | 1779 UNGCPRO; |
1783 return val; | 1780 return val; |
1784 } | 1781 } |
1785 #else | 1782 #else /* not HAVE_MENUS */ |
1786 /* Copy the data so that it won't move when we GC. */ | 1783 /* Copy the data so that it won't move when we GC. */ |
1787 if (! message_text) | 1784 if (! message_text) |
1788 { | 1785 { |
1789 message_text = (char *)xmalloc (80); | 1786 message_text = (char *)xmalloc (80); |
1790 message_length = 80; | 1787 message_length = 80; |
1795 message_text = (char *)xrealloc (message_text, message_length); | 1792 message_text = (char *)xrealloc (message_text, message_length); |
1796 } | 1793 } |
1797 bcopy (XSTRING (val)->data, message_text, XSTRING (val)->size); | 1794 bcopy (XSTRING (val)->data, message_text, XSTRING (val)->size); |
1798 message2 (message_text, XSTRING (val)->size); | 1795 message2 (message_text, XSTRING (val)->size); |
1799 return val; | 1796 return val; |
1800 #endif | 1797 #endif /* not HAVE_MENUS */ |
1801 } | 1798 } |
1802 } | 1799 } |
1803 #ifdef HAVE_X_MENU | 1800 #ifdef HAVE_MENUS |
1804 extern Lisp_Object last_nonmenu_event; | 1801 extern Lisp_Object last_nonmenu_event; |
1805 #endif | 1802 #endif |
1803 | |
1806 DEFUN ("message-or-box", Fmessage_or_box, Smessage_or_box, 1, MANY, 0, | 1804 DEFUN ("message-or-box", Fmessage_or_box, Smessage_or_box, 1, MANY, 0, |
1807 "Display a message in a dialog box or in the echo area.\n\ | 1805 "Display a message in a dialog box or in the echo area.\n\ |
1808 If this command was invoked with the mouse, use a dialog box.\n\ | 1806 If this command was invoked with the mouse, use a dialog box.\n\ |
1809 Otherwise, use the echo area.\n\ | 1807 Otherwise, use the echo area.\n\ |
1808 The first argument is a format control string, and the rest are data\n\ | |
1809 to be formatted under control of the string. See `format' for details.\n\ | |
1810 \n\ | 1810 \n\ |
1811 The first argument is a control string.\n\ | |
1812 It may contain %s or %d or %c to print successive following arguments.\n\ | |
1813 %s means print an argument as a string, %d means print as number in decimal,\n\ | |
1814 %c means print a number as a single character.\n\ | |
1815 The argument used by %s must be a string or a symbol;\n\ | |
1816 the argument used by %d or %c must be a number.\n\ | |
1817 If the first argument is nil, clear any existing message; let the\n\ | 1811 If the first argument is nil, clear any existing message; let the\n\ |
1818 minibuffer contents show.") | 1812 minibuffer contents show.") |
1819 (nargs, args) | 1813 (nargs, args) |
1820 int nargs; | 1814 int nargs; |
1821 Lisp_Object *args; | 1815 Lisp_Object *args; |
1822 { | 1816 { |
1823 #ifdef HAVE_X_MENU | 1817 #ifdef HAVE_MENUS |
1824 if (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) | 1818 if (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) |
1825 return Fmessage_box (nargs, args); | 1819 return Fmessage_box (nargs, args); |
1826 #endif | 1820 #endif |
1827 return Fmessage (nargs, args); | 1821 return Fmessage (nargs, args); |
1828 } | 1822 } |