From unknown Sun Jun 15 09:02:14 2025 X-Loop: don@donarmstrong.com Subject: bug#1456: Cannot Put Non-ASCII Characters in Init Files Reply-To: Bostjan Vilfan , 1456@debbugs.gnu.org Resent-From: Bostjan Vilfan Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 29 Nov 2008 18:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1456 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122798112811777 (code B ref -1); Sat, 29 Nov 2008 18:00:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.3 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 29 Nov 2008 17:52:08 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mATHq44d011771 for ; Sat, 29 Nov 2008 09:52:05 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6Tz9-0000gi-4G for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:52:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6Tz5-0000eB-DM for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:52:01 -0500 Received: from [199.232.76.173] (port=59012 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6Tz5-0000e2-4M for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:51:59 -0500 Received: from brunch.mit.edu ([18.92.0.171]:40334) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6Tz4-0001o7-Q5 for bug-gnu-emacs@gnu.org; Sat, 29 Nov 2008 12:51:58 -0500 Received: from brunch.mit.edu (localhost [127.0.0.1]) by brunch.mit.edu (8.13.8+Sun/8.12.10) with ESMTP id mATHpwwJ001497 for ; Sat, 29 Nov 2008 12:51:58 -0500 (EST) Date: Sat, 29 Nov 2008 12:51:58 -0500 (EST) From: Bostjan Vilfan To: bug-gnu-emacs@gnu.org Message-ID: <797499.6984.1227981118313.JavaMail.help@alum.mit.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_6983_7231210.1227981118312" X-detected-operating-system: by monty-python.gnu.org: Solaris 9 ------=_Part_6983_7231210.1227981118312 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit --text follows this line-- Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: This is most probably not a bug; but needs some input from an expert. In Section 57.6.5 of the Emacs manual (Non-ASCII Characters in Init Files) it is stated that to use non-ASCII characters the init file must start with a line of the form: -*-coding: -*- I tried that with coding system equal to utf-8 and got the following error: Debugger entered--Lisp error: (void-variable \337-*-coding:) eval-buffer(# nil "c:/Documents and Settings/Bostjan/My Documents/.emacs.d/init.el" nil t) ; Reading at buffer position 12 load-with-code-conversion("c:/Documents and Settings/Bostjan/My Documents/.emacs.d/init.el" "c:/Documents and Settings/Bostjan/My Documents/.emacs.d/init.el" t t) load("c:/Documents and Settings/Bostjan/My Documents/.emacs.d/init" t t) #[nil ^H\205\276^@ \306=\203^Q^@\307^H\310Q\202A^@ \311=\2033 etc. When I replaced the first line as described above with the following three lines at the end ;; Local Variables: ** ;; coding:utf-8 ** ;; End: ** I got a different error: Debugger entered--Lisp error: (error "Invalid modifier in a string") etc. any advice would be appreciated Regards Bostjan If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file c:/Program Files/GNU/Emacs/emacs-22.3/etc/DEBUG for instructions. In GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-06 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' 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: ENU locale-coding-system: cp1250 default-enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: encoded-kbd-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: M-x o r f i l e "*GNU Emacs*" Recent messages: Preparing diary...done Preparing diary...done Preparing diary...done Preparing diary...done Preparing diary...done Preparing diary...done Preparing diary...done For information about GNU Emacs and the GNU system, type C-h C-a. CHILDREN Loading emacsbug...done ------=_Part_6983_7231210.1227981118312-- From unknown Sun Jun 15 09:02:14 2025 X-Loop: don@donarmstrong.com Subject: bug#1456: Cannot Put Non-ASCII Characters in Init Files Reply-To: Glenn Morris , 1456@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 10 Dec 2008 03:05:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1456 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1456-submit@emacsbugs.donarmstrong.com id=B1456.122887790411657 (code B ref 1456); Wed, 10 Dec 2008 03:05:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 29; hammy, 85; neutral, 59; spammy, 0. spammytokens: hammytokens:0.000-+--emacs, 0.000-+--Emacs, 0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs X-Spam-Status: No, score=-12.4 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1456) by emacsbugs.donarmstrong.com; 10 Dec 2008 02:58:24 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBA2wL9c011649 for <1456@emacsbugs.donarmstrong.com>; Tue, 9 Dec 2008 18:58:23 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LAFGj-00027x-OA; Tue, 09 Dec 2008 21:57:45 -0500 From: Glenn Morris To: Bostjan Vilfan Cc: 1456@debbugs.gnu.org References: <797499.6984.1227981118313.JavaMail.help@alum.mit.edu> X-Spook: Mossad assassinate Lexis-Nexis BLU-97 A/B strategic Abu X-Ran: 1Y|+mEs=:%pYKY'8Ow96}tK*i#m1@aP]jLW,>H3N`X-hSrD%'444A:/Q9>rrRJ8&~zYdkN X-Hue: red X-Attribution: GM Date: Tue, 09 Dec 2008 21:57:45 -0500 In-Reply-To: <797499.6984.1227981118313.JavaMail.help@alum.mit.edu> (Bostjan Vilfan's message of "Sat, 29 Nov 2008 12:51:58 -0500 (EST)") Message-ID: <9gwse868k6.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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. From unknown Sun Jun 15 09:02:14 2025 X-Loop: don@donarmstrong.com Subject: bug#1456: Cannot Put Non-ASCII Characters in Init Files Reply-To: Chong Yidong , 1456@debbugs.gnu.org Resent-From: Chong Yidong Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 10 Dec 2008 14:10:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1456 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1456-submit@emacsbugs.donarmstrong.com id=B1456.12289179593231 (code B ref 1456); Wed, 10 Dec 2008 14:10:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 4; hammy, 75; neutral, 54; spammy, 0. spammytokens: hammytokens:0.000-+--emacs, 0.000-+--Emacs, 0.000-+--H*M:fsf, 0.000-+--H*MI:fsf, 0.000-+--UD:el X-Spam-Status: No, score=-5.5 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1456) by emacsbugs.donarmstrong.com; 10 Dec 2008 14:05:59 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBAE5ugi003224 for <1456@emacsbugs.donarmstrong.com>; Wed, 10 Dec 2008 06:05:57 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id A10A557E1C8; Wed, 10 Dec 2008 09:06:01 -0500 (EST) From: Chong Yidong To: Bostjan Vilfan Cc: 1456@debbugs.gnu.org Date: Wed, 10 Dec 2008 09:06:01 -0500 Message-ID: <87oczkf7li.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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? From unknown Sun Jun 15 09:02:14 2025 X-Loop: don@donarmstrong.com Subject: bug#1456: Cannot Put Non-ASCII Characters in Init Files Reply-To: Bostjan Vilfan , 1456@debbugs.gnu.org Resent-From: Bostjan Vilfan Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 10 Dec 2008 17:20:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1456 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 1456-submit@emacsbugs.donarmstrong.com id=B1456.12289295491555 (code B ref 1456); Wed, 10 Dec 2008 17:20:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 60; hammy, 105; neutral, 130; spammy, 12. spammytokens:0.999-3--Central, 0.989-+--H*c:alternative, 0.975-+--H*F:D*yahoo.com, 0.971-+--desire, 0.969-+--H*MI:yahoo hammytokens:0.000-+--emacs, 0.000-+--Emacs, 0.000-+--UD:el, 0.000-+--m-x, 0.000-+--Mx X-Spam-Status: No, score=-5.5 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER, HTML_MESSAGE autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1456) by emacsbugs.donarmstrong.com; 10 Dec 2008 17:19:09 +0000 Received: from web58601.mail.re3.yahoo.com (web58601.mail.re3.yahoo.com [68.142.236.199]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mBAHJ5JT001549 for <1456@emacsbugs.donarmstrong.com>; Wed, 10 Dec 2008 09:19:06 -0800 Received: (qmail 5608 invoked by uid 60001); 10 Dec 2008 17:19:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Message-ID; b=EchrAYP/UrRGAO+ujUlQck2mQOVgxTD2kUY3xr6RMsOVRjL4DF8tydEdJNJILXE3Xqb0LR1AhA59NZlQcg6IQgU2rxd1pM1yAOCbPBcus8ZQQlKf7yEQxaNgZKffrxwcgoMWDPpi+uw/t5SqqKvfZ22+ScdZshxFI289dYkP6xE=; X-YMail-OSG: afGhs90VM1naKON3zDbMhbddo5dS3MHruLmrcqiM_9ueEVB.z6i1ePOCD4NW9cEQex758dJtRGzlte44wHG_SpG1OhaBwTdn.cwu8wJwid9BCqcoTPf_5EgA2T5uQZnSqIdDmWGhk.5U1VYQpQ7fdvGsLC7bGPCQChbanQJHC6.IVfavoSMWhosrFKM6Yyc4HXqwu5RTLLelYR0MJYP3Fg.dcoY- Received: from [86.61.57.225] by web58601.mail.re3.yahoo.com via HTTP; Wed, 10 Dec 2008 09:19:00 PST X-Mailer: YahooMailRC/1155.32 YahooMailWebService/0.7.260.1 References: <87oczkf7li.fsf@cyd.mit.edu> Date: Wed, 10 Dec 2008 09:19:00 -0800 (PST) From: Bostjan Vilfan To: Chong Yidong Cc: 1456@debbugs.gnu.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1168887846-1228929540=:5452" Message-ID: <301112.5452.qm@web58601.mail.re3.yahoo.com> --0-1168887846-1228929540=:5452 Content-Type: text/plain; charset=us-ascii 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 1456@debbugs.gnu.org, 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. After choosing key definitions of that type, my problems went away. Regards, bostjanv ________________________________ From: Chong Yidong To: Bostjan Vilfan Cc: 1456@debbugs.gnu.org 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? --0-1168887846-1228929540=:5452 Content-Type: text/html; charset=us-ascii
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 1456@debbugs.gnu.org,
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 <cyd@stupidchicken.com>
To: Bostjan Vilfan <bostjanv@alum.mit.edu>
Cc: 1456@emacsbugs.donarmstrong.com
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?

--0-1168887846-1228929540=:5452--