unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Problem with clipboard
@ 2007-03-05  2:34 neverov_dg
  2007-03-05  4:31 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: neverov_dg @ 2007-03-05  2:34 UTC (permalink / raw)
  To: help-gnu-emacs

Hi!

I'm running emacs on WinXP and have problems with inserting text from
clipboard. When I select text in MS Word or Firefox and paste it into
emacs it inserts symbols in latin-1 encoding, but I want him to insert
text in windows-1251-dos encoding.

When I use:

M-x set-next-selection-coding-system RET windows-1251-dos RET

and paste text all work fine, but just one time. I try to use

M-x set-selection-coding-system RET windows-1251-dos RET

but it doesn't help, text is inserted in latin-1 encoding.

Encoding-specific section in my .emacs:

(set-language-environment "Russian")
(define-coding-system-alias 'windows-1251 'cp1251)
(set-buffer-file-coding-system 'cp1251-dos)
(set-default-coding-systems 'cp1251-dos)
(set-terminal-coding-system 'windows-1251-dos)
(set-selection-coding-system 'cp1251-dos)
(prefer-coding-system 'cp1251-dos)

My emacs-version is:
GNU Emacs 22.0.93.1 (i386-mingw-nt5.1.2600) of 2007-02-01 on LENNART-69DE564 (patched)

How can I fix it?

----
Neverov Dmitry

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

* Re: Problem with clipboard
  2007-03-05  2:34 Problem with clipboard neverov_dg
@ 2007-03-05  4:31 ` Eli Zaretskii
  2007-03-05  4:55   ` Re[2]: " neverov_dg
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2007-03-05  4:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 5 Mar 2007 09:34:10 +0700
> From: neverov_dg@nkmk.ru
> 
> I'm running emacs on WinXP and have problems with inserting text from
> clipboard. When I select text in MS Word or Firefox and paste it into
> emacs it inserts symbols in latin-1 encoding, but I want him to insert
> text in windows-1251-dos encoding.
> 
> When I use:
> 
> M-x set-next-selection-coding-system RET windows-1251-dos RET
> 
> and paste text all work fine, but just one time. I try to use
> 
> M-x set-selection-coding-system RET windows-1251-dos RET
> 
> but it doesn't help, text is inserted in latin-1 encoding.
> 
> Encoding-specific section in my .emacs:
> 
> (set-language-environment "Russian")
> (define-coding-system-alias 'windows-1251 'cp1251)
> (set-buffer-file-coding-system 'cp1251-dos)
> (set-default-coding-systems 'cp1251-dos)
> (set-terminal-coding-system 'windows-1251-dos)
> (set-selection-coding-system 'cp1251-dos)
> (prefer-coding-system 'cp1251-dos)

What happens if you try this in "emacs -Q"?

(On Windows XP, it's almost never the right thing to force Emacs into
some specific encoding when working with the clipboard.)

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

* Re[2]: Problem with clipboard
  2007-03-05  4:31 ` Eli Zaretskii
@ 2007-03-05  4:55   ` neverov_dg
  2007-03-05 20:59     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: neverov_dg @ 2007-03-05  4:55 UTC (permalink / raw)
  To: help-gnu-emacs

>> Date: Mon, 5 Mar 2007 09:34:10 +0700
>> From: neverov_dg@nkmk.ru
>> 
>> I'm running emacs on WinXP and have problems with inserting text from
>> clipboard. When I select text in MS Word or Firefox and paste it into
>> emacs it inserts symbols in latin-1 encoding, but I want him to insert
>> text in windows-1251-dos encoding.
>> 
>> When I use:
>> 
>> M-x set-next-selection-coding-system RET windows-1251-dos RET
>> 
>> and paste text all work fine, but just one time. I try to use
>> 
>> M-x set-selection-coding-system RET windows-1251-dos RET
>> 
>> but it doesn't help, text is inserted in latin-1 encoding.
>> 
>> Encoding-specific section in my .emacs:
>> 
>> (set-language-environment "Russian")
>> (define-coding-system-alias 'windows-1251 'cp1251)
>> (set-buffer-file-coding-system 'cp1251-dos)
>> (set-default-coding-systems 'cp1251-dos)
>> (set-terminal-coding-system 'windows-1251-dos)
>> (set-selection-coding-system 'cp1251-dos)
>> (prefer-coding-system 'cp1251-dos)

> What happens if you try this in "emacs -Q"?

> (On Windows XP, it's almost never the right thing to force Emacs into
> some specific encoding when working with the clipboard.)

Wow, all works fine :). emacs -Q doesn't use my .emacs, so it seems
that I have wrong configuration in it...

Now I have just:

(set-input-method "russian-computer")
(set-default-coding-systems 'windows-1251-dos)
(set-buffer-file-coding-system 'windows-1251-dos)
(prefer-coding-system 'windows-1251-dos)

in .emacs and all works fine.

Thanks!
---------------------------------
Neverov Dmitry

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

* Re: Problem with clipboard
  2007-03-05  4:55   ` Re[2]: " neverov_dg
@ 2007-03-05 20:59     ` Eli Zaretskii
  2007-03-06  1:28       ` Re[2]: " neverov_dg
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2007-03-05 20:59 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 5 Mar 2007 11:55:54 +0700
> From: neverov_dg@nkmk.ru
> 
> Wow, all works fine :). emacs -Q doesn't use my .emacs, so it seems
> that I have wrong configuration in it...

Glad I could help.

> Now I have just:
> 
> (set-input-method "russian-computer")
> (set-default-coding-systems 'windows-1251-dos)
> (set-buffer-file-coding-system 'windows-1251-dos)
> (prefer-coding-system 'windows-1251-dos)
> 
> in .emacs and all works fine.

Any reason why you should keep the latter two?  What is the default
value of buffer-file-coding-system in "emacs -Q"?

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

* Re[2]: Problem with clipboard
  2007-03-05 20:59     ` Eli Zaretskii
@ 2007-03-06  1:28       ` neverov_dg
  0 siblings, 0 replies; 5+ messages in thread
From: neverov_dg @ 2007-03-06  1:28 UTC (permalink / raw)
  To: help-gnu-emacs

> Any reason why you should keep the latter two?  What is the default
> value of buffer-file-coding-system in "emacs -Q"?

Value of buffer-file-coding-system  in "emacs -Q" is undecided-dos.

I try to comment these lines:

(set-buffer-file-coding-system 'windows-1251-dos)
(prefer-coding-system 'windows-1251-dos)

After that file in windows-1251 encoding opened using iso-latin-1-dos
encoding. When I uncoment the last line emacs opens file in
windows-1251. I also change line

(set-input-method "russian-computer")

to

(set-language-environment "Russian")

So now I have:

(set-language-environment "Russian")
(set-default-coding-systems 'windows-1251-dos)
(prefer-coding-system 'windows-1251-dos)

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

end of thread, other threads:[~2007-03-06  1:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05  2:34 Problem with clipboard neverov_dg
2007-03-05  4:31 ` Eli Zaretskii
2007-03-05  4:55   ` Re[2]: " neverov_dg
2007-03-05 20:59     ` Eli Zaretskii
2007-03-06  1:28       ` Re[2]: " neverov_dg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).