unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame
@ 2014-01-31  1:53 varun
  2014-01-31 13:23 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: varun @ 2014-01-31  1:53 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I have been having this problem in v24.3 (worked fine in v23.1.1). When I
try to connect to the server from a new frame created by running the
command emacsclient -nw -c filename, it does not set the terminal coding
system (init.el: (set-terminal-coding-system 'utf-8)).

I see a bug was filed (link included below) and fixed in emacs-23 branch.
Does that mean it was not carried over and patched in v24.3.1. If that is
the case how can I request the patch to be carried over to v24.3. And if
not, what am I missing? And how can I debug and look for what might be
causing the issue in my case? (I know the init file is loading correctly
because there are no warnings/errors in the messages buffer; other settings
are loading and working correctly.)

bug#7840:
https://lists.gnu.org/archive/html/emacs-bug-tracker/2011-02/msg00070.html

Thanks


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

* Re: v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame
  2014-01-31  1:53 v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame varun
@ 2014-01-31 13:23 ` Stefan Monnier
  2014-01-31 23:43   ` varun
       [not found]   ` <mailman.13417.1391211851.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2014-01-31 13:23 UTC (permalink / raw)
  To: help-gnu-emacs

> I have been having this problem in v24.3 (worked fine in v23.1.1). When I
> try to connect to the server from a new frame created by running the
> command emacsclient -nw -c filename, it does not set the terminal coding
> system (init.el: (set-terminal-coding-system 'utf-8)).

set-terminal-coding-system changes the coding system of the *current*
terminal, so it does not affect terminals you might create later
(e.g. with emacsclient).

You might like to use tty-setup-hook to run set-terminal-coding-system
after every emacsclient connection.  But a simpler solution might be to
make sure your locale is using utf-8, so that Emacs's terminals will all
default to using utf-8 as well.


        Stefan




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

* Re: v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame
  2014-01-31 13:23 ` Stefan Monnier
@ 2014-01-31 23:43   ` varun
       [not found]   ` <mailman.13417.1391211851.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: varun @ 2014-01-31 23:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Thanks Stefan for the responding.

I looked at the init.el file and have the following entry that sets the
locale:
(setq locale-coding-system 'utf-8)

Is this not enough or am I not using it correctly?


Got these from:
https://stackoverflow.com/questions/2901541/which-coding-system-should-i-use-in-emacs
(setq utf-translate-cjk-mode nil) ; disable CJK coding/encoding
(Chinese/Japanese/Korean characters)
  (set-language-environment 'utf-8)
  (set-keyboard-coding-system 'utf-8-mac) ; For old Carbon emacs on OS X
only
  (setq locale-coding-system 'utf-8)
  (set-default-coding-systems 'utf-8)
  (set-terminal-coding-system 'utf-8)
  (unless (eq system-type 'windows-nt)
   (set-selection-coding-system 'utf-8))
  (prefer-coding-system 'utf-8)

Thanks



On Fri, Jan 31, 2014 at 8:23 AM, Stefan Monnier <monnier@iro.umontreal.ca>wrote:

> > I have been having this problem in v24.3 (worked fine in v23.1.1). When I
> > try to connect to the server from a new frame created by running the
> > command emacsclient -nw -c filename, it does not set the terminal coding
> > system (init.el: (set-terminal-coding-system 'utf-8)).
>
> set-terminal-coding-system changes the coding system of the *current*
> terminal, so it does not affect terminals you might create later
> (e.g. with emacsclient).
>
> You might like to use tty-setup-hook to run set-terminal-coding-system
> after every emacsclient connection.  But a simpler solution might be to
> make sure your locale is using utf-8, so that Emacs's terminals will all
> default to using utf-8 as well.
>
>
>         Stefan
>
>
>


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

* Re: v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame
       [not found]   ` <mailman.13417.1391211851.10748.help-gnu-emacs@gnu.org>
@ 2014-02-01  4:41     ` Stefan Monnier
  2014-02-01  5:30       ` varun
       [not found]       ` <mailman.13426.1391232654.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2014-02-01  4:41 UTC (permalink / raw)
  To: help-gnu-emacs

> I looked at the init.el file and have the following entry that sets the
> locale:
> (setq locale-coding-system 'utf-8)

> Is this not enough or am I not using it correctly?

No, the locale is something that comes from outside Emacs, for instance
set in the $LANG environment variable.


        Stefan


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

* Re: v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame
  2014-02-01  4:41     ` Stefan Monnier
@ 2014-02-01  5:30       ` varun
       [not found]       ` <mailman.13426.1391232654.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: varun @ 2014-02-01  5:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Stefan,

I have struggled this for hours upon end for many days and over a period of
weeks, finally settling for v23.1.1 and then using a function bound to C-c
q in v24.3.1 to set the terminal encoding within emacs after the frame was
open.

The solution you have provided is extremely simple and elegant, got rid of
many lines of code in the init.el file and finally some peace of mind.

I can't thank you enough for helping me out with this.

Thanks a ton!


On Fri, Jan 31, 2014 at 11:41 PM, Stefan Monnier
<monnier@iro.umontreal.ca>wrote:

> > I looked at the init.el file and have the following entry that sets the
> > locale:
> > (setq locale-coding-system 'utf-8)
>
> > Is this not enough or am I not using it correctly?
>
> No, the locale is something that comes from outside Emacs, for instance
> set in the $LANG environment variable.
>
>
>         Stefan
>


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

* Re: v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame
       [not found]       ` <mailman.13426.1391232654.10748.help-gnu-emacs@gnu.org>
@ 2014-02-01  5:36         ` Rusi
  0 siblings, 0 replies; 6+ messages in thread
From: Rusi @ 2014-02-01  5:36 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, February 1, 2014 11:00:10 AM UTC+5:30, varun wrote:
> Stefan,

> I have struggled this for hours upon end for many days and over a period of
> weeks, finally settling for v23.1.1 and then using a function bound to C-c
> q in v24.3.1 to set the terminal encoding within emacs after the frame was
> open.

> The solution you have provided is extremely simple and elegant, got rid of
> many lines of code in the init.el file and finally some peace of mind.

> I can't thank you enough for helping me out with this.

> Thanks a ton!

Glad to see it working...  However assuming a standard linux: Setting
a locale variable like that means something higher-up (or is it
inner-down :-) ) is not configured

Searching for "configure locale linux" will throw up things like
https://wiki.debian.org/Locale

Tailor to your distro/OS


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

end of thread, other threads:[~2014-02-01  5:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-31  1:53 v24.3.1: set-terminal-coding-system is not working when connecting to the server through a new frame varun
2014-01-31 13:23 ` Stefan Monnier
2014-01-31 23:43   ` varun
     [not found]   ` <mailman.13417.1391211851.10748.help-gnu-emacs@gnu.org>
2014-02-01  4:41     ` Stefan Monnier
2014-02-01  5:30       ` varun
     [not found]       ` <mailman.13426.1391232654.10748.help-gnu-emacs@gnu.org>
2014-02-01  5:36         ` Rusi

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).