emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacsweblogs] i18n


From: Stephen J. Turnbull
Subject: Re: [Emacsweblogs] i18n
Date: Mon, 01 Feb 2010 17:51:36 +0900

Mark A. Hershberger writes:

 > I don't know enough to say whether _"string" is a viable way to mark up
 > text in Emacs Lisp, but my first guess is that it isn't -- not without
 > work done to the internals.

It's not.

 > However, we could define a _ function so that we can wrap strings like
 > this:
 > 
 >     (_ "message")
 > 
 > It wouldn't be a simple, but could work.

Oh, that's simple enough, and would work.  IMHO, it's way too ugly,
though.  If you're going to do that, you might as well just

(defun gettext (message &optional domainname category) ...)

(see gettext(3) for the optional arguments, taken from dcgettext) and
use that.  Perhaps more (Common) Lispy would be keyword arguments,
with the idea of building them into an internationalized version of
format (and a fortiori message and princ y amigos).  And once you've
got `gettext', (defsubst _ (&rest args) (apply #'gettext args)) is
easy and efficient if you really must have it.

What would probably be best if you want reader syntax for this would
be some variation on #_"string".  This would also require work on the
internals, but wouldn't be that hard to do.  The question is "Too
ugly?"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]