[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 7f967b1: Port recent ngettext stub to non-glibc
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 7f967b1: Port recent ngettext stub to non-glibc |
Date: |
Mon, 25 Mar 2019 18:21:03 -0400 (EDT) |
branch: master
commit 7f967b1658114530a19d34d93151804452cc724f
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Port recent ngettext stub to non-glibc
* src/editfns.c: Don’t try to call glibc ngettext;
we’re not ready for that yet.
(Fngettext): Do not restrict integer arguments to fixnums.
Improve doc string a bit.
---
src/editfns.c | 34 +++++++++-------------------------
1 file changed, 9 insertions(+), 25 deletions(-)
diff --git a/src/editfns.c b/src/editfns.c
index ab48cdb..bfffadc 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -53,12 +53,6 @@ along with GNU Emacs. If not, see
<https://www.gnu.org/licenses/>. */
#include "window.h"
#include "blockinput.h"
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "gettext.h"
-#endif
-
static void update_buffer_properties (ptrdiff_t, ptrdiff_t);
static Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool);
@@ -2845,30 +2839,20 @@ usage: (save-restriction &rest BODY) */)
/* i18n (internationalization). */
DEFUN ("ngettext", Fngettext, Sngettext, 3, 3, 0,
- doc: /* Return the plural form of the translation of the string.
-This function is similar to the `gettext' function as it finds the message
-catalogs in the same way. But it takes two extra arguments. The MSGID
-parameter must contain the singular form of the string to be converted.
-It is also used as the key for the search in the catalog.
-The MSGID_PLURAL parameter is the plural form. The parameter N is used
-to determine the plural form. If no message catalog is found MSGID is
-returned if N is equal to 1, otherwise MSGID_PLURAL. */)
+ doc: /* Return the translation of MSGID (plural MSGID_PLURAL) depending
on N.
+MSGID is the singular form of the string to be converted;
+use it as the key for the search in the translation catalog.
+MSGID_PLURAL is the plural form. Use N to select the proper translation.
+If no message catalog is found, MSGID is returned if N is equal to 1,
+otherwise MSGID_PLURAL. */)
(Lisp_Object msgid, Lisp_Object msgid_plural, Lisp_Object n)
{
CHECK_STRING (msgid);
CHECK_STRING (msgid_plural);
- CHECK_FIXNUM (n);
+ CHECK_INTEGER (n);
-#ifdef _LIBGETTEXT_H
- return build_string (ngettext (SSDATA (msgid),
- SSDATA (msgid_plural),
- XFIXNUM (n)));
-#else
- if (XFIXNUM (n) == 1)
- return msgid;
- else
- return msgid_plural;
-#endif
+ /* Placeholder implementation until we get our act together. */
+ return EQ (n, make_fixnum (1)) ? msgid : msgid_plural;
}
DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 7f967b1: Port recent ngettext stub to non-glibc,
Paul Eggert <=