Subject: Re: bug#1456: Cannot Put Non-ASCII Characters in Init Files

From: Bostjan Vilfan <[email-masked]>
Date: Wed, 10 Dec 2008 09:19:00 -0800 (PST)

Thanks for your answer. 
I hope I now understand the problem. Actually, I already sent a reply to one
comment message, but since I did not cc it to [email-masked],
I am doing so now.

It turned out that of the two problems described in my original bug report, the first
(-*-coding: utf-8-*- in my init file did not work) resulted from not prefixing 
"-*-coding: utf-8-*-" with ";;". 

The second (error "Invalid modifier in a string") was the result of some key redefinitions,
which apparently do not work, or do not work as I thought they would. My original desire
was to provide encodings for some Central European characters that are located in certain
places on the local keyboard. Specifically, they correspond to the US keys ; : ' " [ { ] }
\ | . Therefore, I placed the following code in my init file:

(global-set-key "\C-c;" 'insertch)    ;OK
(global-set-key "\C-c:" 'insertCh)    ;OK
(global-set-key "\C-c'" 'inserttj)    ;OK
(global-set-key "\C-c\"" 'insertTj)    ;OK
(global-set-key "\C-c]" 'insertdj)
(global-set-key "\C-c}" 'insertDj)    ;OK
(global-set-key "\C-c[" 'insertsh)
(global-set-key "\C-c{" 'insertSh)    ;OK
(global-set-key "\C-c\\" 'insertzh)
(global-set-key "\C-c|" 'insertZh)    ;OK

where 'insertch etc. are functions for inserting the appropriate characters. After some
investigation I discovered that one or more of these redefinitions are the cause of
the "Invalid modifier in a string" error. Not wishing to pursue the matter further I simply
took the advice in the manual to accept as user-defined key shortcuts the key sequences
C-c<letter>. After choosing key definitions of that type, my problems went away.

Regards,
bostjanv

________________________________
From: Chong Yidong <[email-masked]>
To: Bostjan Vilfan <[email-masked]>
Cc: [email-masked]
Sent: Wednesday, December 10, 2008 3:06:01 PM
Subject: Re: bug#1456: Cannot Put Non-ASCII Characters in Init Files

> See for example the files buff-menu.el and ibuffer.el in the Emacs
> distribution (you can use M-x locate-library) for the two ways to
> specify coding. Don't forget it must be a comment line in the "first
> line in file" method.
>
> Beyond that, any problem may be specific to your init file. Start with
> an empty one and see that works. Then remove a half at a time from the
> real file until you narrow down the problem. Starting with
> "--debug-init" can also help.

Did you manage to track down the problem?