From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Key bindings proposal Date: Thu, 05 Aug 2010 20:55:57 +0900 Message-ID: <87sk2tqnn6.fsf@uwakimon.sk.tsukuba.ac.jp> References: <19534.1494.627000.357123@gargle.gargle.HOWL> <19537.40472.267000.563053@gargle.gargle.HOWL> <176EDAD3B9E54E39870FA3F84A5DDF3C@us.oracle.com> <19542.56658.583000.394397@gargle.gargle.HOWL> <19544.1015.468000.280770@gargle.gargle.HOWL> <87lj8nsndb.fsf@uwakimon.sk.tsukuba.ac.jp> <19545.14451.62000.682223@gargle.gargle.HOWL> <19545.19472.187000.199606@gargle.gargle.HOWL> <19545.20656.500000.91025@gargle.gargle.HOWL> <19545.24079.734000.989637@gargle.gargle.HOWL> <87zkx1rdec.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1281027408 3783 80.91.229.12 (5 Aug 2010 16:56:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 Aug 2010 16:56:48 +0000 (UTC) Cc: Stuart Hacking , Tom , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 05 18:56:45 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oh3kI-0006Zl-Nf for ged-emacs-devel@m.gmane.org; Thu, 05 Aug 2010 18:56:43 +0200 Original-Received: from localhost ([127.0.0.1]:58724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oh3kH-0007ud-SM for ged-emacs-devel@m.gmane.org; Thu, 05 Aug 2010 12:56:41 -0400 Original-Received: from [140.186.70.92] (port=53567 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oh3cK-0000Rz-Ek for emacs-devel@gnu.org; Thu, 05 Aug 2010 12:48:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oh3c7-0007Ul-QE for emacs-devel@gnu.org; Thu, 05 Aug 2010 12:48:27 -0400 Original-Received: from mtps02.sk.tsukuba.ac.jp ([130.158.97.224]:60655) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oh3c7-0007TH-BW for emacs-devel@gnu.org; Thu, 05 Aug 2010 12:48:15 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps02.sk.tsukuba.ac.jp (Postfix) with ESMTP id 0D79F820D; Thu, 5 Aug 2010 20:56:48 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id C48061A46B2; Thu, 5 Aug 2010 20:55:57 +0900 (JST) In-Reply-To: X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" ed3b274cc037 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:128299 Archived-At: Andreas Schwab writes: > "Stephen J. Turnbull" writes: > > The real problems are in getting LISP to be internationalized, ie, > > integrating string-handling with gettext. Should concat look up > > strings? Should the LISP interpreter do it when passing args? etc. > > Of course not. Strings are to be translated when they are presented to > the user, which is a high level concept. Translatable strings must be > explicitly marked. Marked, yes. That's the way gettext works from the programmer's standpoint. In C, that translates to a function call. Cheap. Function calls are not so cheap in LISP, though, nor is allocating strings. And while you perhaps might be happy with code like (defun parental-warning (dependents) (format (gettext "It's %s %s; do you know where your %s are?") (format-time-string "%I") ; URK URK URK! is this right? ; not everybody uses Arabic numerals! (gettext (format-time-string "%p")) ; or is this f-t-s's job? (gettext dependents))) I sure hope Emacs can do better. Eg, it might make sense to have either the interpreter or certain subrs call gettext on marked strings (where the marking is done by the LISP reader on literals). Or it might make sense to have *un*marked strings automatically translated in those contexts. And "high-level"? Maybe, maybe not. In some important cases it may make sense to assemble a large variable string from many pieces. It is not at all obvious to me that passing all strings to top level, where they are translated then concatenated, is always possible, let alone always a sane way to organize a program. P.S. (defsubst _ (s) (gettext s)) doesn't cut it, except as a last resort.