Subject: bug#7233: 24.0.50; language-environments interact badly with LANG settings

From: Miles Bader <[email-masked]>
Date: Mon, 18 Oct 2010 07:51:54 +0900

If you have an environment-specified language setting like LANG; for
instance if you start Emacs by doing:

   LANG=ja_JP.UTF-8  emacs

but you _also_ have a customized language environment, e.g., your .emacs
file does:

   (custom-set-variables
    '(current-language-environment "Japanese"))

... then the latter overrides the former, even when it probably
shouldn't.  In particular, it overrides the default coding, specifically
`default-file-name-coding-system', although the latter is exactly what
the coding portion of LANG seems intended to specify.

[In the case of the Japanese language environment, the customization
above changes `default-file-name-coding-system' to be
`japanese-iso-8bit', and also I wonder how useful that is as a default
-- at least around here, the coding systems that seem to be used for
encoding file names seem to either be UTF-8 (on modernish linu/macos) or
Shift-JIS (windows).]

BTW, I didn't notice this before because I have a line in my .emacs that
does (prefer-coding-system 'utf-8) after loading my customizations --
however, "M-x customize-themes" seems to _re-evaluate_ all of one's
customizations, which trashed my fix... maybe that's a separate bug??

Thanks,

-Miles

In GNU Emacs 24.0.50.8 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2010-10-18 on catnip
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP.UTF-8
  value of $XMODIFIERS: @im=SCIM
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Dired by date

Minor modes in effect:
  rcirc-track-minor-mode: t
  minibuffer-electric-default-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-h v f i l e - n a m SPC c o SPC <return> C-x n <tab> 
<tab> <return> C-x C-v / t m p <return> C-x p C-x 1 
C-x g C-h v M-p d e f a SPC <return> C-x 1 C-v C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-x 
C-v / t m p <return> g <escape> x c u s t o m i z e 
- t h e SPC <return> C-v C-n C-n C-n C-p C-a <return> 
C-x d g C-x s C-x k <return> <escape> x r e p o r t 
SPC e m <backspace> <backspace> <return>

Recent messages:
Checking new news...
Opening nntp server on news.individual.net...done
Reading active file via nnml...done
Opening nntp server on news.gmane.org...done
Reading active file via nndraft...done
Checking new news...done
Type C-x 1 to delete the help window.
Starting new Ispell process [default] ...
Parsing /home/miles/.mailrc... done
Scanning for dabbrevs...100%

Load-path shadows:
/usr/share/emacs23/site-lisp/magit hides /usr/share/emacs/site-lisp/magit
/usr/share/emacs23/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup

Features:
(shadow sort dabbrev emacsbug mail-extr face-remap flyspell ispell
warnings my-mode-line-theme cus-edit gnus-topic parse-time byte-opt
bytecomp byte-compile nnml auth-source netrc gnus-delay gnus-draft
gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache
gnus-msg gnus-art mm-uu mml2015 epg-config mm-view smime password-cache
dig mailcap gnus-sum gnus-group gnus-undo nndraft nnmh nnoo nnmail
mail-source format-spec gnus-start gnus-spec gnus-int gnus-range
gnus-win dired pp help-mode view lua-mode-autoloads package reporter
server uniquify rcirc time-date ring minibuf-eldef gnus gnus-ems
nnheader gnus-util wid-edit cus-start cus-load derived advice help-fns
advice-preload easy-mmode message sendmail regexp-opt rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils
gmm-utils mailheader japan-util tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
loaddefs button minibuffer faces cus-face files text-properties overlay
md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)

-- 
`Life is a boundless sea of bitterness'