unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19251: 24.4; LANG not applied in shell command
@ 2014-12-02  9:57 Sebastien Vauban
  2014-12-02 10:22 ` Ivan Shmakov
       [not found] ` <mailman.15132.1417515793.1147.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Sebastien Vauban @ 2014-12-02  9:57 UTC (permalink / raw)
  To: 19251-ubl+/3LiMTaZdePnXv/OxA

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-02 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02  9:57 bug#19251: 24.4; LANG not applied in shell command Sebastien Vauban
2014-12-02 10:22 ` 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).