unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lele Gaifax <lele@metapensiero.it>
To: 23812@debbugs.gnu.org
Subject: bug#23812: 25.0.95; Minor glitch in dired listing due to non English host language
Date: Tue, 21 Jun 2016 10:31:59 +0200	[thread overview]
Message-ID: <87a8ifhri8.fsf@metapensiero.it> (raw)

When I enter in a `dired` mode, I see something like the following at the top
of the buffer:

  /home/lele/something:
  total used in directorye 8 available 24407396
  drwxrwxr-x 2 lele lele 4096 giu 21 10:02 .
  drwxr-xr-x 5 lele lele 4096 giu 21 10:02 ..

Note the “directorye” glitch: I think it is caused by the fact that the
function `insert-directory` in lisp/files.el assumes the underlying `ls`
command operates in an English environment, in particular in the first line
where it emits with the disk space usage, and perform a simple replace of
"total" with "total used in directory".

This is what I get with a plain `ls -la`:

  $ ls -la
  totale 8
  drwxrwxr-x 2 lele lele 4096 giu 21 10:02 .
  drwxr-xr-x 5 lele lele 4096 giu 21 10:02 ..

while it assumes an output like:

  $ LANG=en ls -la
  total 8
  drwxrwxr-x 2 lele lele 4096 Jun 21 10:02 .
  drwxr-xr-x 5 lele lele 4096 Jun 21 10:02 ..

Given that the function unconditionally inserts an English phrase, the
easiest-but-consistent workaround could be explicitly executing `ls` with
`$LANG` set to "en".

A more elaborated approach could be extracting only the number in the first
line of the `ls` output instead of matching "total": in this way it would
support also languages that swap the order (that is, that translate that line
to something equivalent “8 bytes in total”).

Thank you,
ciao, lele.


In GNU Emacs 25.0.95.2 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
 of 2016-06-14 built on nautilus
Repository revision: f5261917191336d052ad8586b2d9fd62ba46c3c4
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
System Description:	Debian GNU/Linux unstable (sid)

Configured using:
 'configure --prefix /usr/local/emacs25'

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS NOTIFY GNUTLS LIBXML2 FREETYPE XFT
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: it_IT.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Dired by name

-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.





             reply	other threads:[~2016-06-21  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  8:31 Lele Gaifax [this message]
2020-12-15  7:09 ` bug#23812: 25.0.95; Minor glitch in dired listing due to non English host language Lars Ingebrigtsen
2020-12-15  7:48   ` Lele Gaifax
2020-12-15 16:56     ` Drew Adams
2020-12-15 16:50   ` Eli Zaretskii
2020-12-17 11:20     ` Lars Ingebrigtsen
2021-12-01 22:28       ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8ifhri8.fsf@metapensiero.it \
    --to=lele@metapensiero.it \
    --cc=23812@debbugs.gnu.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 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).