From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Better language detection for tutorial Date: Sun, 22 Jul 2007 17:44:24 +0200 Message-ID: <854pjwl9yf.fsf@lola.goethe.zz> References: <85ejj5xv4x.fsf@lola.goethe.zz> <86ejj4g3d4.fsf@lola.quinscape.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1185119080 28448 80.91.229.12 (22 Jul 2007 15:44:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 22 Jul 2007 15:44:40 +0000 (UTC) Cc: Sascha Wilde , Thomas Arendsen Hein , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 22 17:44:36 2007 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.50) id 1ICdbo-00017i-7f for ged-emacs-devel@m.gmane.org; Sun, 22 Jul 2007 17:44:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICdbn-0001YU-Jt for ged-emacs-devel@m.gmane.org; Sun, 22 Jul 2007 11:44:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ICdbk-0001XC-0r for emacs-devel@gnu.org; Sun, 22 Jul 2007 11:44:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ICdbj-0001VG-0T for emacs-devel@gnu.org; Sun, 22 Jul 2007 11:44:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ICdbi-0001Uw-Pw for emacs-devel@gnu.org; Sun, 22 Jul 2007 11:44:30 -0400 Original-Received: from mail-in-11.arcor-online.net ([151.189.21.51]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ICdbi-0008H1-BN for emacs-devel@gnu.org; Sun, 22 Jul 2007 11:44:30 -0400 Original-Received: from mail-in-03-z2.arcor-online.net (mail-in-03-z2.arcor-online.net [151.189.8.15]) by mail-in-11.arcor-online.net (Postfix) with ESMTP id 7BBFE12F23; Sun, 22 Jul 2007 17:44:28 +0200 (CEST) Original-Received: from mail-in-04.arcor-online.net (mail-in-04.arcor-online.net [151.189.21.44]) by mail-in-03-z2.arcor-online.net (Postfix) with ESMTP id 648922D3B28; Sun, 22 Jul 2007 17:44:28 +0200 (CEST) Original-Received: from lola.goethe.zz (dslb-084-061-022-107.pools.arcor-ip.net [84.61.22.107]) by mail-in-04.arcor-online.net (Postfix) with ESMTP id 218D91D7144; Sun, 22 Jul 2007 17:44:28 +0200 (CEST) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 118601D1E182; Sun, 22 Jul 2007 17:44:25 +0200 (CEST) In-Reply-To: (Andreas Schwab's message of "Sun\, 22 Jul 2007 17\:41\:31 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Virus-Scanned: ClamAV 0.91.1/3728/Sun Jul 22 07:07:30 2007 on mail-in-04.arcor-online.net X-Virus-Status: Clean X-detected-kernel: Linux 2.4-2.6 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:75301 Archived-At: Andreas Schwab writes: > Sascha Wilde writes: > >> + (defun tutorial-get-language () >> + "Use LC_ALL, LC_MESSAGES, LANG in turn to determine language to use. >> + This is more reliable then current-language-environment, which is not > than `...' >> + intended to chose the language used for messages and documentation." > choose > >> + (let (locale (vars '("LC_ALL" "LC_MESSAGES" "LANG"))) >> + (while (and vars >> + (= 0 (length locale))) ; nil or empty string > zerop or (= (length locale) 0) > >> + (setq locale (getenv (pop vars)))) > > pop is a macro in cl. pop is a Lisp macro in `subr.el'. (pop LISTNAME) Return the first element of LISTNAME's value, and remove it from the list. LISTNAME must be a symbol whose value is a list. If the value is nil, `pop' returns nil but does not actually change the list. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum