all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mac OS and Unicode
@ 2008-02-08 17:59 Florian Lindner
  2008-02-08 21:31 ` Harald Hanche-Olsen
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Florian Lindner @ 2008-02-08 17:59 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,
I'm running GNU Emacs 22.1.1 (i386-apple-darwin9, Carbon Version
1.6.0) von Mac OS X 10.5.1 compiled with Fink. My locale ist
de_DE.UTF-8. Apparently emacs does not use Unicode when saving files.
I have

(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

in my .emacs.

What is missing to make emacs use utf-8 when saving files?
(for me as a complete emacs newbie)

Thanks,

Florian

-- 
I'm using an evaluation license of nemo since 59 days.
You should really try it!
http://www.malcom-mac.com/nemo



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-08 17:59 Mac OS and Unicode Florian Lindner
@ 2008-02-08 21:31 ` Harald Hanche-Olsen
  2008-02-08 22:34   ` Florian Lindner
  2008-02-09  4:22 ` Stefan Monnier
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Harald Hanche-Olsen @ 2008-02-08 21:31 UTC (permalink / raw)
  To: help-gnu-emacs

+ Florian Lindner <Florian.Lindner@xgm.de>:

> Hello,
> I'm running GNU Emacs 22.1.1 (i386-apple-darwin9, Carbon Version
> 1.6.0) von Mac OS X 10.5.1 compiled with Fink. My locale ist
> de_DE.UTF-8.

Ah, but does your emacs see that?  You may wish to reveal that locale
setting not only to emacs, but to all applications that you run, by
defining it in ~/.MacOSX/environment.  The easiest way to create/edit
that file is via the system preference pane RCEnvironment.  Just set the
variable LANG to de_DE.UTF-8.  You need to log out and back in for the
variable to take effect.  (I don't guarantee that this will solve your
problem, but it would surprise me if not.)

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-08 21:31 ` Harald Hanche-Olsen
@ 2008-02-08 22:34   ` Florian Lindner
  2008-02-08 22:54     ` Harald Hanche-Olsen
  0 siblings, 1 reply; 15+ messages in thread
From: Florian Lindner @ 2008-02-08 22:34 UTC (permalink / raw)
  To: help-gnu-emacs

In article <pcoejbnrv8n.fsf@shuttle.math.ntnu.no> Harald
Hanche-Olsen<hanche@math.ntnu.no> wrote:
>  + Florian Lindner <Florian.Lindner@xgm.de>:
>>   Hello,
>>   I'm running GNU Emacs 22.1.1 (i386-apple-darwin9, Carbon Version
>> 1.6.0) von Mac OS X 10.5.1 compiled with Fink. My locale ist
>>   de_DE.UTF-8.

>  Ah, but does your emacs see that?  You may wish to reveal that
> locale setting not only to emacs, but to all applications that you
> run, by defining it in ~/.MacOSX/environment.  The easiest way to
> create/edit that file is via the system preference pane
> RCEnvironment.  Just set the variable LANG to de_DE.UTF-8.  You need
> to log out and back in for the variable to take effect.  (I don't
> guarantee that this will solve yourproblem, but it would surprise me
> if not.)

Well, even if I use the terminal (which has the locale set) to start
emacs it does not work. Furthermore I haven't found the preference
pane you were talking about neither is  ~/.MacOSX existing.

Thanks,

Florian

-- 
I'm using an evaluation license of nemo since 60 days.
You should really try it!
http://www.malcom-mac.com/nemo



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-08 22:34   ` Florian Lindner
@ 2008-02-08 22:54     ` Harald Hanche-Olsen
  2008-02-09 13:06       ` Florian Lindner
  0 siblings, 1 reply; 15+ messages in thread
From: Harald Hanche-Olsen @ 2008-02-08 22:54 UTC (permalink / raw)
  To: help-gnu-emacs

+ Florian Lindner <Florian.Lindner@xgm.de>:

> Well, even if I use the terminal (which has the locale set) to start
> emacs it does not work.

Hmm.  Well, if so it won't help to set the environment variable by other
means.  Just to be sure, you can check the variable "process-environment"
in emacs to check if LANG (if that's the one you're using) is set.  You
check it using C-h v process-environment RET.

> Furthermore I haven't found the preference pane you were talking about
> neither is ~/.MacOSX existing.

Sorry, I should have made myself clear.  That preference pane is not
standard on Mac OS X.  You'll have to download it from the net and
install it.  Google should find it for you.  ~/.MacOSX does not usually
exist either, but RCEnvironment will create it and the environment.plist
file inside it.  (You can edit it by hand, or use the property list
editor, but that requires a bit of knowledge - which can also be gotten
from the net, but using RCEnvironment is easier.)

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-08 17:59 Mac OS and Unicode Florian Lindner
  2008-02-08 21:31 ` Harald Hanche-Olsen
@ 2008-02-09  4:22 ` Stefan Monnier
  2008-02-09  9:28 ` B. Smith-Mannschott
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Stefan Monnier @ 2008-02-09  4:22 UTC (permalink / raw)
  To: help-gnu-emacs

> I'm running GNU Emacs 22.1.1 (i386-apple-darwin9, Carbon Version
> 1.6.0) von Mac OS X 10.5.1 compiled with Fink.  My locale ist
> de_DE.UTF-8.  Apparently emacs does not use Unicode when saving files.

So, you "apparently" found a bug?
More seriously: what makes you think Emacs is not using Unicode when
saving files?

Also, try it with "emacs -Q" to make sure the problem doesn't come from
your .emacs.  My crystal ball tells me you may have some inappropriate
calls to set-language-environment or maybe even
special-display-<something>.


        Stefan



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-08 17:59 Mac OS and Unicode Florian Lindner
  2008-02-08 21:31 ` Harald Hanche-Olsen
  2008-02-09  4:22 ` Stefan Monnier
@ 2008-02-09  9:28 ` B. Smith-Mannschott
  2008-02-09  9:59 ` Peter Dyballa
       [not found] ` <mailman.7203.1202551148.18990.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 15+ messages in thread
From: B. Smith-Mannschott @ 2008-02-09  9:28 UTC (permalink / raw)
  To: Florian Lindner; +Cc: help-gnu-emacs




On Feb 8, 2008, at 18:59, Florian Lindner wrote:

> Hello,
> I'm running GNU Emacs 22.1.1 (i386-apple-darwin9, Carbon Version
> 1.6.0) von Mac OS X 10.5.1 compiled with Fink. My locale ist
> de_DE.UTF-8. Apparently emacs does not use Unicode when saving files.
> I have
>
> (set-terminal-coding-system 'utf-8)
> (set-keyboard-coding-system 'utf-8)
> (prefer-coding-system 'utf-8)
>
> in my .emacs.

I'm doing this in my .emacs and it seems to be working both for 22.1.1  
(terminal) and 22.1.50.1 (Emacs.app).  I can't say how much of it is  
necessary and what might be cargo-cult from previous emacs versions...

(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
(prefer-coding-system 'utf-8)

(when (or (> 21 emacs-major-version)
           (and (= 21 emacs-major-version) (>= 50 emacs-minor-version)))
   (custom-set-variables
    '(current-language-environment "UTF-8")))


Note, however, that my LANG is set differently than yours:

[bsmith@Meheadable:~/.emacs.config]
$ echo $LANG
en_US.utf-8

When I initially installed Mac OS X 10.5, I noted that the man program  
doesn't work when the language is set to German.  I don't know if this  
has since been resolved, nor do I know if it's limited to just man or  
perhaps part of a larger problem in OS X.

You might investigate this possibility if the code above doesn't  
help.  Try switching to US English and logging out and back in again  
and see if it works then.

// ben




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-08 17:59 Mac OS and Unicode Florian Lindner
                   ` (2 preceding siblings ...)
  2008-02-09  9:28 ` B. Smith-Mannschott
@ 2008-02-09  9:59 ` Peter Dyballa
       [not found] ` <mailman.7203.1202551148.18990.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 15+ messages in thread
From: Peter Dyballa @ 2008-02-09  9:59 UTC (permalink / raw)
  To: Florian Lindner; +Cc: help-gnu-emacs


Am 08.02.2008 um 18:59 schrieb Florian Lindner:

> What is missing to make emacs use utf-8 when saving files?


Carbon Emacs *can* save in UTF-8. Make sure that you do not have any  
settings that make a particular type of files saved non-UTF-8 (as I  
have for TeX, for example). The mode-line contains information about  
the encoding. If it's not starting with ``-u:´´ then you can change  
this from a menu: Options -> Mule -> Set Coding System -> For Saving  
This Buffer – C-x RET f <your choice> RET. *Messages* and *scratch*  
should be UTF-8, when there's nothing that prevents it.


The command ``defaults´´ works also on ~/.MacOSX/environment.plist.  
For example:

	defaults write ${HOME}/.MacOSX/environment LANG <your choice>
	setenv MANPATH `defaults read "${HOME}/.MacOSX/environment" MANPATH`	 
~/.cshrc
	export PATH=$(defaults read "${HOME}/.MacOSX/environment" PATH)		 
~/.bash_login

--
Mit friedvollen Grüßen

   Pete

We also sponsor National Invisible Chronic Illness Awareness Week  
annually in September.
Join the millions






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-08 22:54     ` Harald Hanche-Olsen
@ 2008-02-09 13:06       ` Florian Lindner
  2008-02-09 17:56         ` Harald Hanche-Olsen
  0 siblings, 1 reply; 15+ messages in thread
From: Florian Lindner @ 2008-02-09 13:06 UTC (permalink / raw)
  To: help-gnu-emacs

In article <pcoy79vxdn5.fsf@shuttle.math.ntnu.no> Harald
Hanche-Olsen<hanche@math.ntnu.no> wrote:
>  + Florian Lindner <Florian.Lindner@xgm.de>:
>>   Well, even if I use the terminal (which has the locale set) to
>> start emacs it does not work.

>  Hmm.  Well, if so it won't help to set the environment variable by
> other means.  Just to be sure, you can check the variable
> "process-environment" in emacs to check if LANG (if that's the one
> you're using) is set.  Youcheck it using C-h v process-environment
>  RET.

Ok, now I see it's set correctly if emacs is started from terminal.app
but not when started with Spotlight.
>>   Furthermore I haven't found the preference pane you were talking
>> about neither is ~/.MacOSX existing.

>  Sorry, I should have made myself clear.  That preference pane is not
> standard on Mac OS X.  You'll have to download it from the net and
> install it.  Google should find it for you.  ~/.MacOSX does not
> usually exist either, but RCEnvironment will create it and the
> environment.plist file inside it.  (You can edit it by hand, or use
> the property list editor, but that requires a bit of knowledge -
> which can also be gottenfrom the net, but using RCEnvironment is
>  easier.)

I have created that file and edited with the property list editor.

florian@r098153 ~: cat .MacOSX/environment.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"<http://www.apple.com/DTDs/PropertyList-1.0.dtd>"><plist
version="1.0">
<dict>
	<key>LANG</key>
	<string>de_DE.UTF-8</string>
</dict>
</plist>

and rebooted my machine. But still C-h v process-environment shows no
LANG variable when started from spotlight.

Regards,

Florian

-- 
I'm using an evaluation license of nemo since 60 days.
You should really try it!
http://www.malcom-mac.com/nemo



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
       [not found] ` <mailman.7203.1202551148.18990.help-gnu-emacs@gnu.org>
@ 2008-02-09 13:25   ` Florian Lindner
  2008-02-09 14:58     ` Peter Dyballa
  2008-02-10 18:21     ` Peter Dyballa
  0 siblings, 2 replies; 15+ messages in thread
From: Florian Lindner @ 2008-02-09 13:25 UTC (permalink / raw)
  To: help-gnu-emacs

In article <mailman.7203.1202551148.18990.help-gnu-emacs@gnu.org>
PeterDyballa <Peter_Dyballa@Web.DE> wrote:
>  Am 08.02.2008 um 18:59 schrieb Florian Lindner:
>>   What is missing to make emacs use utf-8 when saving files?

>  Carbon Emacs *can* save in UTF-8. Make sure that you do not have any
> settings that make a particular type of files saved non-UTF-8 (as I
> have for TeX, for example). The mode-line contains information about
> the encoding. If it's not starting with ``-u:«« then you can change
> this from a menu: Options -> Mule -> Set Coding System -> For Saving
> This Buffer ? C-x RET f <your choice> RET. *Messages* and *scratch*
> should be UTF-8, when there's nothing that prevents it.

>  The command ``defaults«« works also on ~/.MacOSX/environment.plist.
> For example:

>  	defaults write ${HOME}/.MacOSX/environment LANG <your choice>

I've tried this but emacs still does not have the LANG variable (C-h v
process-environment) when started from Spotlight.
>  	setenv MANPATH `defaults read "${HOME}/.MacOSX/environment"
> MANPATH`  ~/.cshrc
>  	export PATHhdefaults read "${HOME}/.MacOSX/environment" PATH)		 
>  ~/.bash_login

>  --
>  Mit friedvollen Gr٤en

>     Pete

>  We also sponsor National Invisible Chronic Illness Awareness Week
> annually in September.
>  Join the millions





-- 
I'm using an evaluation license of nemo since 60 days.
You should really try it!
http://www.malcom-mac.com/nemo



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-09 13:25   ` Florian Lindner
@ 2008-02-09 14:58     ` Peter Dyballa
  2008-02-10 18:21     ` Peter Dyballa
  1 sibling, 0 replies; 15+ messages in thread
From: Peter Dyballa @ 2008-02-09 14:58 UTC (permalink / raw)
  To: Florian Lindner; +Cc: help-gnu-emacs


Am 09.02.2008 um 14:25 schrieb Florian Lindner:

>>  	defaults write ${HOME}/.MacOSX/environment LANG <your choice>
>
> I've tried this but emacs still does not have the LANG variable (C-h v
> process-environment) when started from Spotlight.
>>

Can you be a bit more precise about the version of GNU Emacs? Help  
menu -> Send Bug Report or M-x report-emacs-bug RET gives some more  
details than emacs-version. Very useful is to launch Emacs with -Q,  
so that all customisation, from system and from user, is not loaded.

>>
> I'm using an evaluation license of nemo since 60 days.
> You should really try it!
> http://www.malcom-mac.com/nemo

For Sushi?

--
Mit friedvollen Grüßen

   Pete

                (This space left blank for technical reasons.)






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-09 13:06       ` Florian Lindner
@ 2008-02-09 17:56         ` Harald Hanche-Olsen
  2008-02-09 20:29           ` Peter Dyballa
       [not found]           ` <mailman.7231.1202588996.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 15+ messages in thread
From: Harald Hanche-Olsen @ 2008-02-09 17:56 UTC (permalink / raw)
  To: help-gnu-emacs

+ Florian Lindner <Florian.Lindner@xgm.de>:

> and rebooted my machine. But still C-h v process-environment shows no
> LANG variable when started from spotlight.

Rebooting was overkill:  Logging in and out is enough.  But I can
confirm that starting programs from spotlight does not set the
environment as described here:

  http://developer.apple.com/qa/qa2001/qa1067.html

This must be a bug.  I'll report it to Apple as such, but don't hold
your breath waiting for a fix.  (We're now totally off topic for this
newsgroup, by the way.)

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-09 17:56         ` Harald Hanche-Olsen
@ 2008-02-09 20:29           ` Peter Dyballa
       [not found]           ` <mailman.7231.1202588996.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 15+ messages in thread
From: Peter Dyballa @ 2008-02-09 20:29 UTC (permalink / raw)
  To: Harald Hanche-Olsen; +Cc: help-gnu-emacs


Am 09.02.2008 um 18:56 schrieb Harald Hanche-Olsen:

> I can confirm that starting programs from spotlight


How do you do that? Clicking twice on a file that SpotLight has  
found? Or am I, still using Tiger, missing something as a left-behind?

On Tiger I can see that an application launched this way has the full  
environment ...

--
Greetings

   Pete

They that can give up essential liberty to obtain a little temporary  
safety deserve neither liberty nor safety.
		-Benjamin Franklin, Historical Review of Pennsylvania.







^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
       [not found]           ` <mailman.7231.1202588996.18990.help-gnu-emacs@gnu.org>
@ 2008-02-09 21:09             ` Harald Hanche-Olsen
  2008-02-10  9:29               ` Peter Dyballa
  0 siblings, 1 reply; 15+ messages in thread
From: Harald Hanche-Olsen @ 2008-02-09 21:09 UTC (permalink / raw)
  To: help-gnu-emacs

+ Peter Dyballa <Peter_Dyballa@Web.DE>:

> Am 09.02.2008 um 18:56 schrieb Harald Hanche-Olsen:
>
>> I can confirm that starting programs from spotlight
>
>
> How do you do that? Clicking twice on a file that SpotLight has found?

Click the spotlight icon in the menu bar, type "terminal" in the text
field (Terminal.app will show up as the top hit), type return.

- Harald


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-09 21:09             ` Harald Hanche-Olsen
@ 2008-02-10  9:29               ` Peter Dyballa
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Dyballa @ 2008-02-10  9:29 UTC (permalink / raw)
  To: Harald Hanche-Olsen; +Cc: help-gnu-emacs


Am 09.02.2008 um 22:09 schrieb Harald Hanche-Olsen:

>> How do you do that? Clicking twice on a file that SpotLight has  
>> found?
>
> Click the spotlight icon in the menu bar, type "terminal" in the text
> field (Terminal.app will show up as the top hit), type return.


I tried it with GraphicConvertor, because Terminal is always running,  
and on Tiger it had the standard environment, as ps could show.  
Although I had to launch it with double-clicking the found file. A  
return only separated the window of found items from the Apple bar.

--
Greetings

   Pete

A child of five could understand this!  Fetch me a child of five.






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Mac OS and Unicode
  2008-02-09 13:25   ` Florian Lindner
  2008-02-09 14:58     ` Peter Dyballa
@ 2008-02-10 18:21     ` Peter Dyballa
  1 sibling, 0 replies; 15+ messages in thread
From: Peter Dyballa @ 2008-02-10 18:21 UTC (permalink / raw)
  To: Florian Lindner; +Cc: help-gnu-emacs


Am 09.02.2008 um 14:25 schrieb Florian Lindner:

> I've tried this but emacs still does not have the LANG variable (C-h v
> process-environment) when started from Spotlight.


If all fails, there is one ressort left.

	(getenv "LANG")

can retrieve in ~/.emacs (or some other init file) this environment  
variable's value (which can be assigned to some auxiliary variable).  
When LANG is empty, then a statement like

	(setenv "LANG" "de_DE.UTF-8")

would set LANG in Emacs' process-environment. Otherwise this  
statement is not necessary.

--
Mit friedvollen Grüßen

   Pete

Patriotismus ist die Überzeugung, dass unser Vaterland allen anderen  
Ländern überlegen ist, weil wir darin geboren wurden.
                                         (George Bernard Shaw)






^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-02-10 18:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-08 17:59 Mac OS and Unicode Florian Lindner
2008-02-08 21:31 ` Harald Hanche-Olsen
2008-02-08 22:34   ` Florian Lindner
2008-02-08 22:54     ` Harald Hanche-Olsen
2008-02-09 13:06       ` Florian Lindner
2008-02-09 17:56         ` Harald Hanche-Olsen
2008-02-09 20:29           ` Peter Dyballa
     [not found]           ` <mailman.7231.1202588996.18990.help-gnu-emacs@gnu.org>
2008-02-09 21:09             ` Harald Hanche-Olsen
2008-02-10  9:29               ` Peter Dyballa
2008-02-09  4:22 ` Stefan Monnier
2008-02-09  9:28 ` B. Smith-Mannschott
2008-02-09  9:59 ` Peter Dyballa
     [not found] ` <mailman.7203.1202551148.18990.help-gnu-emacs@gnu.org>
2008-02-09 13:25   ` Florian Lindner
2008-02-09 14:58     ` Peter Dyballa
2008-02-10 18:21     ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.