bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19251: 24.4; LANG not applied in shell command


From: Sebastien Vauban
Subject: bug#19251: 24.4; LANG not applied in shell command
Date: Tue, 02 Dec 2014 10:57:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]