From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Quotes do not display correctly Date: Thu, 7 Apr 2016 21:38:25 -0600 Message-ID: <20160407212604514803951@bob.proulx.com> References: <83k2k9l9ym.fsf@gnu.org> <7C71F821-C50E-4E5A-B959-A99C53820080@tenpoint.co.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1460086725 31355 80.91.229.3 (8 Apr 2016 03:38:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2016 03:38:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 08 05:38:45 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aoNFs-0002Ax-UW for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Apr 2016 05:38:45 +0200 Original-Received: from localhost ([::1]:53698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoNFs-00029c-7l for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Apr 2016 23:38:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoNFe-00026q-KS for help-gnu-emacs@gnu.org; Thu, 07 Apr 2016 23:38:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoNFb-0003af-DZ for help-gnu-emacs@gnu.org; Thu, 07 Apr 2016 23:38:30 -0400 Original-Received: from havoc.proulx.com ([96.88.95.61]:42085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoNFb-0003Zl-8k for help-gnu-emacs@gnu.org; Thu, 07 Apr 2016 23:38:27 -0400 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id 28A26124C for ; Thu, 7 Apr 2016 21:38:26 -0600 (MDT) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id C10FB21237 for ; Thu, 7 Apr 2016 21:38:25 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id A54922DC4D; Thu, 7 Apr 2016 21:38:25 -0600 (MDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <7C71F821-C50E-4E5A-B959-A99C53820080@tenpoint.co.nz> User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 96.88.95.61 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:109733 Archived-At: Nick Helm wrote: > I'm on OS X and I launch Emacs using an Applescript script contained > within an Automator bundle. At startup, it essentially does this >... > Ok, more reading and it looks like it's determined by the default coding > system and language environment that Emacs picks up from the system > during startup. I have $LANG set in my environment, but for some reason > the script isn't seeing it. How are you setting LANG? In a ~/.bashrc file? I don't know anything about Apple OS X but in regular X11 settings in ~/.bashrc files only affect interactive shells and not other programs that are not interactive bash shells. In order to set the environment in X Windows for example one way would be in a .xsessionrc file which is specifically loaded by the window system. I would guess it is similar with other systems. > Changing it to something like this: > > do shell script "export LANG=en_NZ.UTF-8; /Applications/Emacs.app/ > Contents/MacOS/Emacs -Q --daemon " That line break and indent seems unintentional. Mailer problem? I assume it was meant to be this. Which I am going to comment upon. > do shell script "export LANG=en_NZ.UTF-8; /Applications/Emacs.app/Contents/MacOS/Emacs -Q --daemon " > seems to fix the problem, at least standard-display-table remains > unchanged, and the quote chars display correctly in my buffers (and the > rest of Emacs it seems). text-quoting-style now seems to have its > intended effect as well. > > I'm not sure if this is the correct solution, but it seems work. I wanted to comment upon the way you set the variable. That works, obviously. But it isn't very idiomatic. It is possible that the inclusion of a ';' shell metacharacter in the string will require a "/bin/sh -c" to be invoked in order to interpret the script. Often programs optimize the /bin/sh call out if there are no shell meta-characters. But the above requires it. Better would be to use the "env" command to run something in a modified environment. It is one of the POSIX standard commands and very portably found on systems. This avoids the need for shell meta-characters, may allow the system to optimize the shell out, and allows very fine control of the environment. With that it would be: env LANG=en_NZ.UTF-8 /Applications/Emacs.app/Contents/MacOS/Emacs -Q --daemon Having said all of the above I am not sure this is the best solution. This is simply the first environment variable you have set somewhere (~/.bashrc ?) and you may run into other problems. It might be better to figure out how to get your environment set somewhere, such as in the X11 ~/.xsessionrc file case, rather than play the wack-a-mole game hitting individual environment variables one by one as you run into problems not having them. Good Luck and Happy Hacking, Bob