From 1ef49c888848d916be120761d253f120647f3923 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 29 May 2007 05:31:54 +0000 Subject: Bugfixes git-svn-id: file:///svnroot/mailfromd/trunk@1481 7a8a7f39-df28-0410-adc6-e0d955640f24 --- doc/mailfromd.texi | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ elisp/mfl-mode.el | 18 +++++++++++--- src/bi_gettext.m4 | 6 ++++- src/lex.l | 8 ++++-- 4 files changed, 97 insertions(+), 7 deletions(-) diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 30f542c3..bc76dbe9 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -7249,6 +7249,78 @@ the decision based on the cached data, or to @samp{0} otherwise. @subsubsection National Language Support Functions @UNREVISED{} +@deftypefn {Built-in Function} string bindtextdomain (string @var{domain}, @ + string @var{dirname}) +This function sets the base directory of the hierarchy containing +message catalogs for a given message domain. + +@var{domain} is a string identifying the textual domain. If +it is not empty, the base directory for message catalogs belonging to +domain @var{domain} is set to @var{dirname}. It is important that +@var{dirname} be an absolute pathname; otherwise it cannot be +guaranteed that the message catalogs will be found. + +If @var{domain} is @samp{""}, @code{bindtextdomain} returns the +previously set base directory for domain @var{domain}. +@end deftypefn + +@deftypefn {Built-in Function} string dgettext (string @var{domain}, @ + string @var{msgid}) +@code{dgettext} attempts to translate the string @var{msgid} into the +currently active locale, according to the settings of the textual +domain @var{domain}. If there is no translation available, +@code{dgettext} returns @var{msgid} unchanged. +@end deftypefn + +@deftypefn {Built-in Function} string dngettext @ + (string @var{domain}, string @var{msgid}, string @var{msgid_plural}, @ + number @var{n}) +The @code{dngettext} functions attempts to translate a text string +into the language specified by the current locale, by looking up the +appropriate singular or plural form of the translation in a message +catalog, set for the textual domain @var{domain}. + +@xref{Plural forms, Additional functions for plural forms, +Additional functions for plural forms, gettext, GNU gettext +utilities}, for the detailed discussion of the plural form handling in +different languages. +@end deftypefn + +@deftypefn {Library Function} string textdomain (string @var{domain}) +The @code{textdomain} function sets the current message domain to +@var{domain}, if it is not empty. In any case the function returns +the current message domain. The current domain is @samp{mailfromd} +initially. For example, the following sequence of @code{textdomain} +invocations will yield: + +@smallexample +textdomain("") @result{} "mailfromd" +textdomain("myfilter") @result{} "myfilter" +textdomain("") @result{} "myfilter" +@end smallexample + +@end deftypefn + +@deftypefn {Library Function} string gettext (string @var{msgid}) +@code{gettext} attempts to translate the string @var{msgid} into the +currently active locale, according to the settings of the current textual +domain (set using @code{textdomain} function). If there is no +translation available, @code{gettext} returns @var{msgid} unchanged. +@end deftypefn + +@deftypefn {Library Function} string ngettext @ + (string @var{msgid}, string @var{msgid_plural}, number @var{n}) +The @code{ngettext} functions attempts to translate a text string +into the language specified by the current locale, by looking up the +appropriate singular or plural form of the translation in a message +catalog, set for the current textual domain. + +@xref{Plural forms, Additional functions for plural forms, +Additional functions for plural forms, gettext, GNU gettext +utilities}, for the detailed discussion of the plural form handling in +different languages. +@end deftypefn + @node Debugging Functions @subsubsection Debugging Functions diff --git a/elisp/mfl-mode.el b/elisp/mfl-mode.el index aadcab08..eb0bceb1 100644 --- a/elisp/mfl-mode.el +++ b/elisp/mfl-mode.el @@ -151,7 +151,7 @@ (mfl-next-line-indentation))))) (defun mfl-find-line-indentation (regexp) - "Move backwards to the line containing "REGEXP", skipping over + "Move backwards to the line containing REGEXP, skipping over block constructs. Return the indentation of the line, or 0 if no matching line was found." (catch 'found @@ -169,7 +169,7 @@ if no matching line was found." 0)) (defun mfl-find-line-forward (regexp) - "Move forward to the line containing "REGEXP", skipping over + "Move forward to the line containing REGEXP, skipping over block constructs. Return t if the line was found, nil otherwise." (catch 'found (while (not (eobp)) @@ -224,9 +224,19 @@ block constructs. Return t if the line was found, nil otherwise." (beginning-of-line)))))) (defun mfl-newline-and-indent () - "Indent the current line, insert a newline, and then indent again." + "Indent the current line, if necessary, insert a newline, and then indent again. + +The current line is indented if it begins with one of the following +keywords: else, elif, fi, done, when, case. +" (interactive "*") - (mfl-indent-line) + (if (save-excursion + (beginning-of-line) + (skip-chars-forward " \t") + (looking-at (regexp-opt + '("else" "elif" "fi" "done" "when" "case") + 'words))) + (mfl-indent-line)) (newline-and-indent)) diff --git a/src/bi_gettext.m4 b/src/bi_gettext.m4 index 9ab8c01a..20e45d86 100644 --- a/src/bi_gettext.m4 +++ b/src/bi_gettext.m4 @@ -18,7 +18,11 @@ MF_DEFUN(bindtextdomain, STRING, STRING domain, STRING dirname) { - MF_RETURN_STRING(bindtextdomain(domain, dirname)); + char *s = bindtextdomain(domain[0] ? domain : NULL, dirname); + MF_ASSERT(s != NULL, + mf_failure, + "bindtextdomain failed: %s", mu_strerror(errno)); + MF_RETURN_STRING(s); } END diff --git a/src/lex.l b/src/lex.l index cd109a28..7146a403 100644 --- a/src/lex.l +++ b/src/lex.l @@ -176,8 +176,12 @@ ICONST {LOCUS}|{VCONST}|__statedir__|__preproc__ block. The bug report with a patch was sent to bug-m4@gnu.org on - 2007-05-24. Hopefully they'll fix it. - */ + 2007-05-24: + + http://lists.gnu.org/archive/html/bug-m4/2007-05/msg00018.html + + Hopefully it will be fixed in the next release. + */ ^[ \t]*#[ \t]*line[ \t].*\n { struct locus newloc; memset(&newloc, 0, sizeof newloc); -- cgit v1.2.1