all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: 19251-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org
Subject: bug#19251: 24.4; LANG not applied in shell command
Date: Tue, 02 Dec 2014 10:57:21 +0100	[thread overview]
Message-ID: <867fyatlvi.fsf@example.com> (raw)

Hello,

I'm trying to automate the update of some Git project with:

--8<---------------cut here---------------start------------->8---
  (defun config-update ()
    "Update config."
    (interactive)
    (message "Updating config...")
    (cd config--directory)
    (let ((ret (shell-command-to-string "LANG=en_US git pull --rebase")))
      (if (string-match "Already up-to-date." ret)
          (message "Configuration already up-to-date.")
        (princ ret)
        (message "Configuration updated."))))
--8<---------------cut here---------------end--------------->8---

On my machine (Windows 8 with Cygwin), that works as expected.

On one friend's machine (some Linux variant), whatever the answer of
`git pull' (something new or nothing new), he will always have the
impression that the project has just been updated:

  ┌────
  │ Updating config...
  │ La branche courante master est à jour.
  │ 
  │ Configuration updated.
  └────

This is because my function looks for the string "Already up-to-date" in
Git's output, and his output is in French -- while I forced LANG to
en_US.

So, why is LANG not respected in `shell-command-to-string'?

Best regards,
  Seb

-- 
Sebastien Vauban





             reply	other threads:[~2014-12-02  9:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02  9:57 Sebastien Vauban [this message]
2014-12-02 10:22 ` bug#19251: 24.4; LANG not applied in shell command Ivan Shmakov
     [not found] ` <mailman.15132.1417515793.1147.bug-gnu-emacs@gnu.org>
     [not found]   ` <mailman.15132.1417515793.1147.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2014-12-02 12:22     ` Sebastien Vauban
2014-12-02 12:50       ` Ivan Shmakov

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=867fyatlvi.fsf@example.com \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=19251-ubl+/3LiMTaZdePnXv/OxA@public.gmane.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.