Subject: bug#15402: closed (Re: bug#15402: 24.3; Emacs and Mac OS Dock bad launch behavior)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 29 Sep 2013 17:12:03 +0000

Your bug report

#15402: 24.3; Emacs and Mac OS Dock bad launch behavior

which was filed against the emacs,ns package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
15402: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15402
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#15402: 24.3; Emacs and Mac OS Dock bad launch behavior
From: Jan Djärv <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: Constantine Vetoshev <[email-masked]>, [email-masked]
Date: Sun, 29 Sep 2013 19:11:01 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello.

Finally got round to fixing this.  Closing.

	Jan D.

19 sep 2013 kl. 23:30 skrev Stefan Monnier <[email-masked]>:

>>>> This is NOT required when launching Emacs from the command line!
>>> Typically, the difference between the two is that running Emacs from the
>>> command line runs it with environment variables set by your shell's init
>>> scripts, whereas running it from the GUI does not have those
>>> env-vars set.
>>> IOW please compare M-: process-environment RET in the two cases, it will
>>> probably contain a clue.
>> I already checked, LANG is needed to be set properly in the environment, and
>> it isn't when laucnhng from dock.  M-x setenv doesn't help, as it really
>> doesn't setenv anything (should be renamed IMHO).
> 
> IIRC, under Darwin, everything along the lines of locale-coding-system,
> keyboard-codind-system, terminal-coding-system, etc... should always be
> utf-8.  So we probably don't need to look at LANG to make that decision.
> 
> 
>        Stefan

Subject: 24.3; Emacs and Mac OS Dock bad launch behavior
From: Constantine Vetoshev <[email-masked]>
To: [email-masked]
Date: Tue, 17 Sep 2013 01:25:18 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

When Emacs is launched from its icon in the Mac OS Dock, all modes
derived from term (such as M-x ansi-term) exhibit strange behavior:
printing a long line which contains a Unicode character causes line
truncation and generally puts the terminal in a bad state. Resetting the
terminal fixes the problem.

The problem does NOT occur when Emacs is launched from the command
line, i.e., the terminal modes all work correctly if Emacs is invoked by
running the following at a (non-Emacs) shell:
"/Applications/Emacs.app/Contents/MacOS/Emacs"

The problem does not seem to be related to any Emacs initialization code
in .emacs or init.el. It occurs consistently when all initialization
code is commented out.

Attached is a sample file which causes the problem; just save it, launch a
shell in ansi-term, and cat the file.

In addition, when launched from the Dock, ansi-term requires something
like the following to display Unicode characters correctly:

(defadvice ansi-term (after advice-ansi-term activate)
  (set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))

This is NOT required when launching Emacs from the command line!

In GNU Emacs 24.3.1 (x86_64-apple-darwin12.2.0, NS apple-appkit-1187.34)
 of 2013-03-10 on athena.local
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure '--with-ns''

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t