* tramp mode locale for dir listings
@ 2015-08-21 21:53 Hikaru Ichijyo
2015-08-21 23:09 ` Javier
2015-08-22 18:39 ` Michael Albinus
0 siblings, 2 replies; 4+ messages in thread
From: Hikaru Ichijyo @ 2015-08-21 21:53 UTC (permalink / raw)
To: help-gnu-emacs
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?
--
He that would make his own liberty secure must guard even his enemy from
oppression; for if he violates this duty, he establishes a precedent
that will reach to himself.
--Thomas Paine
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: tramp mode locale for dir listings
2015-08-21 21:53 tramp mode locale for dir listings Hikaru Ichijyo
@ 2015-08-21 23:09 ` Javier
2015-08-21 23:33 ` Hikaru Ichijyo
2015-08-22 18:39 ` Michael Albinus
1 sibling, 1 reply; 4+ messages in thread
From: Javier @ 2015-08-21 23:09 UTC (permalink / raw)
To: help-gnu-emacs
How are you customizing the sorting? The default is aphabetized as
though the initial dot of dotfiles didn't exist.
Are you using .dir-locals.el files to customize the sorting in the
browsed directory or in its parent dirs? Looking for those files is
diabled in tramp for the sake of performance since looking for them in
all the parent dirs would be too slow.
(info "(emacs) Directory Variables")
Emacs searches for `.dir-locals.el' starting in the
directory of the visited file, and moving up the directory tree. To
avoid slowdown, this search is skipped for remote files. If needed,
the search can be extended for remote files by setting the variable
`enable-remote-dir-locals' to `t'.
Hikaru Ichijyo <ichijyo@macross.sdf.jp> wrote:
> 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?
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: tramp mode locale for dir listings
2015-08-21 23:09 ` Javier
@ 2015-08-21 23:33 ` Hikaru Ichijyo
0 siblings, 0 replies; 4+ messages in thread
From: Hikaru Ichijyo @ 2015-08-21 23:33 UTC (permalink / raw)
To: help-gnu-emacs
Javier <nospam@nospam.com> writes:
> How are you customizing the sorting? The default is aphabetized as
> though the initial dot of dotfiles didn't exist.
>
> Are you using .dir-locals.el files to customize the sorting in the
> browsed directory or in its parent dirs? Looking for those files is
> diabled in tramp for the sake of performance since looking for them in
> all the parent dirs would be too slow.
>
> (info "(emacs) Directory Variables")
>
> Emacs searches for `.dir-locals.el' starting in the
> directory of the visited file, and moving up the directory tree. To
> avoid slowdown, this search is skipped for remote files. If needed,
> the search can be extended for remote files by setting the variable
> `enable-remote-dir-locals' to `t'.
I've made no deliberate configurations anywhere in Emacs to set my
locale, so any deviations from default behavior are not being caused by
anything I'm aware of.
My .bashrc does set LC_COLLATE=C, but I don't know if Dired absorbs
environment from your .bashrc or not. For what it's worth, I also have
the same LC_COLLATE=C in most of the remote machines I use, but I'm not
getting that effect when I'm in Tramp.
Basically, I'd like to get LC_COLLATE=C behavior everywhere. Is Dired
affected by environment setup in .bashrc? Is Tramp? .bashrc is the
only place I have any locale settings that I know of.
--
He that would make his own liberty secure must guard even his enemy from
oppression; for if he violates this duty, he establishes a precedent
that will reach to himself.
--Thomas Paine
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: tramp mode locale for dir listings
2015-08-21 21:53 tramp mode locale for dir listings Hikaru Ichijyo
2015-08-21 23:09 ` Javier
@ 2015-08-22 18:39 ` Michael Albinus
1 sibling, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2015-08-22 18:39 UTC (permalink / raw)
To: help-gnu-emacs
Hikaru Ichijyo <ichijyo@macross.sdf.jp> 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:user@randomhost.your.domain:")
"locale" "LC_ALL=C"))
--8<---------------cut here---------------end--------------->8---
Read the Tramp manual (info "(tramp) Predefined connection information")
Best regards, Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-22 18:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-21 21:53 tramp mode locale for dir listings Hikaru Ichijyo
2015-08-21 23:09 ` Javier
2015-08-21 23:33 ` Hikaru Ichijyo
2015-08-22 18:39 ` Michael Albinus
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).