all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Coding system question(s)
@ 2011-03-27 15:19 B. T. Raven
  2011-03-27 17:31 ` Eli Zaretskii
       [not found] ` <mailman.1.1301247103.12231.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: B. T. Raven @ 2011-03-27 15:19 UTC (permalink / raw)
  To: help-gnu-emacs

Coding system for saving file?(default nil)is always the prompt in the
mini-buffer when I do C-x ret f even though I have all these set in .emacs:

   (set-language-environment               'utf-8)
        (set-default-coding-systems             'utf-8)
        (setq file-name-coding-system           'utf-8)
        (setq default-buffer-file-coding-system 'utf-8)
        (setq coding-system-for-write           'utf-8)
        (set-keyboard-coding-system             'utf-8)
        (set-terminal-coding-system          'utf-8)
        (set-clipboard-coding-system            'utf-8)
        (set-selection-coding-system            'utf-8)
        (prefer-coding-system                   'utf-8)
        ;; (set-buffer-process-coding-system 'utf-8 'utf-8)
        (modify-coding-system-alist 'process
"[cC][mM][dD][pP][rR][oO][xX][yY]" 'utf-8-dos)

With w32 build of Emacs what do I have to do to ensure that all plain
text files (.txt, .tex, .el, etc.) are read in and written out in utf-8
encoding? I also have this cookie at the start of all such files:

;; -*- coding: utf-8 -*-
;;  Time-stamp: "2011-02-24 13:07:25 EC"

I have had .emacs this way for a couple of years but I am having
problems editing files created with ver. 22.3 in ver. 23.3
??

Thanks,

Ed


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

* Re: Coding system question(s)
  2011-03-27 15:19 Coding system question(s) B. T. Raven
@ 2011-03-27 17:31 ` Eli Zaretskii
       [not found] ` <mailman.1.1301247103.12231.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2011-03-27 17:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 27 Mar 2011 10:19:22 -0500
> From: "B. T. Raven" <nihil@nihilo.net>
> 
> Coding system for saving file?(default nil)is always the prompt in the
> mini-buffer when I do C-x ret f

Is there a typo somewhere?  "C-x RET f" just sets the encoding of the
current buffer, it doesn't save any file.

> With w32 build of Emacs what do I have to do to ensure that all plain
> text files (.txt, .tex, .el, etc.) are read in and written out in utf-8
> encoding?

M-x set-locale-environment RET utf-8 RET

>         (set-clipboard-coding-system            'utf-8)
>         (set-selection-coding-system            'utf-8)

Don't do that on Windows, you are shooting yourself in the foot.  The
Windows clipboard works in UTF-16 (not UTF-8) by default, and
switching it to UTF-8 is asking for trouble, because Windows doesn't
really understand UTF-8 in the clipboard data.



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

* Re: Coding system question(s)
       [not found] ` <mailman.1.1301247103.12231.help-gnu-emacs@gnu.org>
@ 2011-03-27 18:04   ` B. T. Raven
  0 siblings, 0 replies; 3+ messages in thread
From: B. T. Raven @ 2011-03-27 18:04 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:
>> Date: Sun, 27 Mar 2011 10:19:22 -0500
>> From: "B. T. Raven" <nihil@nihilo.net>
>>
>> Coding system for saving file?(default nil)is always the prompt in the
>> mini-buffer when I do C-x ret f
> 
> Is there a typo somewhere?  "C-x RET f" just sets the encoding of the
> current buffer, it doesn't save any file.

Yes, I know, but why does it default to nil? Couldn't some variable
supply the default here?

From menu bar:

options > Mule > Set coding systems > For saving this buffer

that led me to believe that it was synonymous with

C-x ret c and then C-x C-s

> 
>> With w32 build of Emacs what do I have to do to ensure that all plain
>> text files (.txt, .tex, .el, etc.) are read in and written out in utf-8
>> encoding?
> 
> M-x set-locale-environment RET utf-8 RET
> 
>>         (set-clipboard-coding-system            'utf-8)
>>         (set-selection-coding-system            'utf-8)
> 
> Don't do that on Windows, you are shooting yourself in the foot.  The
> Windows clipboard works in UTF-16 (not UTF-8) by default, and
> switching it to UTF-8 is asking for trouble, because Windows doesn't
> really understand UTF-8 in the clipboard data.

Okay, thanks, Eli. I guess that would cause problems but not the ones I
was having with file/buffer encodings. Multilingual files that I once
had figured out were loading with many octals (/xxx) instead of the
correct glyph. Anyway, I took out those two settings and added:

(set-locale-environment 'utf-8)

in .emacs


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

end of thread, other threads:[~2011-03-27 18:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-27 15:19 Coding system question(s) B. T. Raven
2011-03-27 17:31 ` Eli Zaretskii
     [not found] ` <mailman.1.1301247103.12231.help-gnu-emacs@gnu.org>
2011-03-27 18:04   ` B. T. Raven

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.