[Top][All Lists]

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

Re: Better language detection for tutorial (was: set-locale-environement

From: Andreas Schwab
Subject: Re: Better language detection for tutorial (was: set-locale-environement: strange default detection)
Date: Sun, 22 Jul 2007 17:41:31 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux)

Sascha Wilde <address@hidden> 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."

> +   (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.

> +     (if (< 0 (length locale))
            (> (length locale) 0)


Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

reply via email to

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