all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Quotes do not display correctly
Date: Thu, 7 Apr 2016 21:38:25 -0600	[thread overview]
Message-ID: <20160407212604514803951@bob.proulx.com> (raw)
In-Reply-To: <7C71F821-C50E-4E5A-B959-A99C53820080@tenpoint.co.nz>

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



  reply	other threads:[~2016-04-08  3:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07  9:20 Quotes do not display correctly Nick Helm
2016-04-07 14:15 ` Kaushal Modi
2016-04-07 14:16 ` Drew Adams
2016-04-07 15:22 ` Eli Zaretskii
2016-04-08  2:20   ` Nick Helm
2016-04-08  3:38     ` Bob Proulx [this message]
2016-04-15  4:05       ` Nick Helm
2016-04-15 17:34         ` Pascal J. Bourguignon
2016-04-08  7:21     ` Eli Zaretskii
     [not found]     ` <mailman.17.1460086713.7477.help-gnu-emacs@gnu.org>
2016-04-08 18:35       ` Pascal J. Bourguignon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160407212604514803951@bob.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.