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

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

Re: tramp mode locale for dir listings


From: Michael Albinus
Subject: Re: tramp mode locale for dir listings
Date: Sat, 22 Aug 2015 20:39:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hikaru Ichijyo <address@hidden> writes:

Hi,

> When I list directories locally in Dired, they show up the way I like,
> with "C" locale, dotfiles listed first.
>
> When I connect to a remote directory via Tramp, usually I get some other
> locale, with files/dirs aphabetized as though the initial dot of
> dotfiles didn't exist.  This means lots of dotfiles are mixed in with
> regular non-dot files in the listing, but Dired only does this to remote
> machines.
>
> Is there any kind of variable I can set to get a "C" locale for Dired
> listings whether the target is remote or local?

Tramp determines the locale environment on the remote host, and keeps
its value in the cache. Usually, this is something like "LC_ALL=en_US.utf8"
or "LC_ALL=C.utf8". Check the file ~/.emacs.d/tramp for such settings.

You could change it in this file to your preferred value, like "LC_ALL=C".
This must be done *prior* Tramp is activated in Emacs.

With a recent Tramp version (say 2.2.12), it is possible to set this
value in your ~/.emacs (without patching ~/.emacs.d/tramp), like

--8<---------------cut here---------------start------------->8---
(add-to-list 'tramp-connection-properties
             (list (regexp-quote "/ssh:address@hidden:")
                   "locale" "LC_ALL=C"))
--8<---------------cut here---------------end--------------->8---

Read the Tramp manual (info "(tramp) Predefined connection information")

Best regards, Michael.



reply via email to

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