Commit 01fdd7b0 authored by David Byers's avatar David Byers
Browse files

Updates to language handling. Fixed data type bug.

Detailed changes:
> 2003-08-25  David Byers  <byers@lysator.liu.se>
>
> 	* startup.el (kom-start-anew): Use lyskom-default-language instead
> 	of kom-default-language to set the initial language for the
> 	session.
>
> 	* lyskom-rest.el (lyskom-is-loaded): Changed initialization of
> 	language variables to use new function in language.el. Also do not
> 	alter kom-default-language unless it was nil to begin with.
> 	Convert kom-default-language from symbol to list if necessary.
>
> 	* language.el (lyskom-language-from-environment): Moved here from
> 	lyskom-rest.el.
> 	(lyskom-default-language): New function.
>
> 	* completing-read.el (lyskom-read-conf-internal): We use
> 	uconf-stats internally, so don't use conf-stat accessors.
>
parent 0159b7d5
2003-08-25 David Byers <byers@lysator.liu.se>
* startup.el (kom-start-anew): Use lyskom-default-language instead
of kom-default-language to set the initial language for the
session.
* lyskom-rest.el (lyskom-is-loaded): Changed initialization of
language variables to use new function in language.el. Also do not
alter kom-default-language unless it was nil to begin with.
Convert kom-default-language from symbol to list if necessary.
* language.el (lyskom-language-from-environment): Moved here from
lyskom-rest.el.
(lyskom-default-language): New function.
* completing-read.el (lyskom-read-conf-internal): We use
uconf-stats internally, so don't use conf-stat accessors.
2003-08-25 David Byers <davby@ida.liu.se>
Fix problems entering conferences in the edit buffer:
......
......@@ -497,11 +497,11 @@ function work as a name-to-conf-stat translator."
(lyskom-wait-queue 'main)
(delq nil
(mapcar (lambda (conf-stat)
(when (lyskom-completing-match-string string (conf-stat->name conf-stat))
(when (lyskom-completing-match-string string (uconf-stat->name conf-stat))
(lyskom-create-conf-z-info
(conf-stat->name conf-stat)
(conf-stat->conf-type conf-stat)
(conf-stat->conf-no conf-stat))))
(uconf-stat->name conf-stat)
(uconf-stat->conf-type conf-stat)
(uconf-stat->conf-no conf-stat))))
(collector->value result))))))
(candidate-list
(append r-list
......
......@@ -305,6 +305,32 @@ Returns non-nil on success and nil on failure."
(lyskom-traverse-break el)))
(car (car lyskom-languages))))
(defun lyskom-language-from-environment (var)
"Return language name from value of environment variable VAR."
(let ((tmp (getenv var)))
(and tmp
(string-match "^\\([a-z]+\\)" tmp)
(intern (match-string 1 tmp)))))
(defun lyskom-default-language ()
"Return the default language for LysKOM"
(let ((languages (append
(if (listp kom-default-language)
kom-default-language
(list kom-default-language))
(list
(lyskom-language-from-environment "KOMLANGUAGE")
(lyskom-language-from-environment "LC_ALL")
(lyskom-language-from-environment "LC_MESSAGES")
(lyskom-language-from-environment "LANG")))))
(or (lyskom-traverse lang languages
(when (assq lang lyskom-languages)
(lyskom-traverse-break lang)))
(car (car (last lyskom-languages))))))
(eval-and-compile (provide 'lyskom-language))
;;; language.el ends here
......@@ -4223,33 +4223,20 @@ One parameter - the prompt string."
(defvar icon-title-format)
(defvar frame-icon-title-format)
(defun lyskom-language-from-environment (var)
(let ((tmp (getenv var)))
(and tmp
(string-match "^\\([a-z]+\\)" tmp)
(intern (match-string 1 tmp)))))
(if lyskom-is-loaded
nil
;; Fix altered format for kom-default-language
(when (and kom-default-language (symbolp kom-default-language))
(setq kom-default-language (list kom-default-language)))
;; Set up default language
(let ((languages (append
(if (listp kom-default-language)
kom-default-language
(list kom-default-language))
(list
(lyskom-language-from-environment "KOMLANGUAGE")
(lyskom-language-from-environment "LC_ALL")
(lyskom-language-from-environment "LC_MESSAGES")
(lyskom-language-from-environment "LANG")
(car (car (last lyskom-languages)))))))
(lyskom-traverse lang languages
(when (assq lang lyskom-languages)
(setq kom-default-language lang
lyskom-language lang
lyskom-global-language lang)
(lyskom-traverse-break))))
(setq lyskom-language (lyskom-default-language))
(setq lyskom-global-language lyskom-language)
(unless kom-default-language
(setq kom-default-language (list lyskom-language)))
(setq-default lyskom-collate-table lyskom-default-collate-table)
;; We should set lyskom-char-classes to
......
......@@ -642,16 +642,15 @@ shown to other users."
;; If login succeeded, clear the caches and set the language
(when login-successful
(progn (clear-all-caches)
(when (lyskom-set-language kom-default-language 'local)
(unless lyskom-have-one-login
(lyskom-set-language kom-default-language 'global)
(lyskom-maybe-setq-default kom-default-language kom-default-language)
(setq-default lyskom-language (lyskom-first-available-language kom-default-language)))
(lyskom-format-insert-before-prompt
'language-set-to
(lyskom-language-name (lyskom-first-available-language kom-default-language))))
(setq lyskom-have-one-login t)))
(clear-all-caches)
(when (lyskom-set-language (lyskom-default-language) 'local)
(unless lyskom-have-one-login
(lyskom-set-language (lyskom-default-language) 'global)
(setq-default lyskom-language lyskom-language)
(setq-default kom-default-language (list lyskom-language)))
(lyskom-format-insert-before-prompt
'language-set-to (lyskom-language-name (lyskom-default-language))))
(setq lyskom-have-one-login t))
(when ignored-user-area-vars
(lyskom-format-insert-before-prompt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment