GNU bug report logs - #29645
Feature Request: Locale aware formatting

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Gustaf Waldemarson <gustaf.waldemarson@HIDDEN>; dated Sun, 10 Dec 2017 15:05:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 10 Dec 2017 15:04:08 +0000
From debbugs-submit-bounces <at> Sun Dec 10 10:04:08 2017
Received: from localhost ([]:55502
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1eO39E-0006Z0-4f
	for submit <at>; Sun, 10 Dec 2017 10:04:08 -0500
Received: from ([]:38060)
 by with esmtp (Exim 4.84_2)
 (envelope-from <gustaf.waldemarson@HIDDEN>) id 1eO39C-0006YW-Fp
 for submit <at>; Sun, 10 Dec 2017 10:04:07 -0500
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <gustaf.waldemarson@HIDDEN>) id 1eO395-0001aQ-UO
 for submit <at>; Sun, 10 Dec 2017 10:04:01 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from ([2001:4830:134:3::11]:40307)
 by with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <gustaf.waldemarson@HIDDEN>)
 id 1eO395-0001a6-RG
 for submit <at>; Sun, 10 Dec 2017 10:03:59 -0500
Received: from ([2001:4830:134:3::10]:57263)
 by with esmtp (Exim 4.71)
 (envelope-from <gustaf.waldemarson@HIDDEN>) id 1eO393-0002b3-Qw
 for bug-gnu-emacs@HIDDEN; Sun, 10 Dec 2017 10:03:59 -0500
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <gustaf.waldemarson@HIDDEN>) id 1eO392-0001Vy-3R
 for bug-gnu-emacs@HIDDEN; Sun, 10 Dec 2017 10:03:57 -0500
Received: from ([2a00:1450:400c:c09::235]:43847)
 by with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <gustaf.waldemarson@HIDDEN>)
 id 1eO391-0001UD-Oq
 for bug-gnu-emacs@HIDDEN; Sun, 10 Dec 2017 10:03:56 -0500
Received: by with SMTP id n138so10208660wmg.2
 for <bug-gnu-emacs@HIDDEN>; Sun, 10 Dec 2017 07:03:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025;
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025;
X-Gm-Message-State: AJaThX7xyWxRtcV6uwanXv2N2Mns46jGFl9q3LV16NGei9D4FyAIGKbj
X-Google-Smtp-Source: AGs4zMYCTOg7J1JqC06lh630yRRhZyzCMDYvyzVusmuDzPzEQ5/tquoNWwArXYBddtqFL/RoFO+oP1W0UxVy5JzHg04=
X-Received: by with SMTP id i26mr58313770edb.31.1512918233529;
 Sun, 10 Dec 2017 07:03:53 -0800 (PST)
MIME-Version: 1.0
Received: by with HTTP; Sun, 10 Dec 2017 07:03:52 -0800 (PST)
From: Gustaf Waldemarson <gustaf.waldemarson@HIDDEN>
Date: Sun, 10 Dec 2017 16:03:52 +0100
Message-ID: <CABehr5dgxy_FZY-==rRyWNxHXp7fQ1MW19b8hsQeFLb4MqNwqg@HIDDEN>
Subject: Feature Request: Locale aware formatting
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by Genre and OS details not
X-detected-operating-system: by GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -4.0 (----)


A while ago I started looking for some simple way of writing numbers correctly
formatted to the locale. Specifically, I wanted the output to use the locale's
thousands' grouping characters, if specified. To my knowledge, there's no simple
way of doing this without involving an external process.

Nowadays however, modern versions of `printf` and other formatting functions
support the ' (single-quote) flag for various number specifiers. E.g., my Bash
`printf` can do this:

$ LC_NUMERIC="sv_SE.utf8" printf "%'d\n" 1000000
1 000 000
$ LC_NUMERIC="en_US.utf8" printf "%'d\n" 1000000

I think it would be very useful if `format` and similar formatting functions
implemented this flag as a new feature.


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-12-10 built on ShadowX
Repository revision: ab203e36d5f84a99b6d4b04f1a22ba028be750e3
System Description:    Ubuntu 17.04

Recent messages:
uncompressing emacsbug.el.gz...done
Mark set
Mark saved where search started
When done with a buffer, type C-x #
split-window: Attempt to split minibuffer window
Back to top level
Configuring package markdown-mode...done
When done with a buffer, type C-x #
Making completion list... [2 times]

Configured using:
 'configure --prefix=/home/xaldew/.local

Configured features:

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

Major mode: Markdown

Minor modes in effect:
  poly-markdown-mode: t
  orgtbl-mode: t
  orgstruct-mode: t
  gnus-desktop-notify-mode: t
  diff-auto-refine-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  beacon-mode: t
  flyspell-mode: t
  flycheck-pos-tip-mode: t
  projectile-mode: t
  hes-mode: t
  global-linum-mode: t
  linum-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-company-mode: t
  company-mode: t
  global-anzu-mode: t
  anzu-mode: t
  perspeen-mode: t
  global-atomic-chrome-edit-mode: t
  shell-dirtrack-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  which-key-mode: t
  anyclip-mode: t
  override-global-mode: t
  electric-pair-mode: t
  save-place-mode: t
  global-subword-mode: t
  subword-mode: t
  show-paren-mode: t
  winner-mode: t
  global-auto-revert-mode: t
  xterm-mouse-mode: t
  savehist-mode: t
  ido-everywhere: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

(shadow markdown-mode poly-markdown polymode poly-base polymode-weave
polymode-export polymode-debug polymode-methods poly-lock
polymode-compat polymode-classes eieio-compat polymode-core eieio-custom
eieio-base cl emacsbug ace-window eieio-opt speedbar sb-image ezimage
dframe help-fns radix-tree ielm pp shr svg dom browse-url flow-fill qp
misearch multi-isearch sort gnus-async gnus-bcklg gnus-ml disp-table
gnus-cite bbdb-message sendmail mail-extr org-rmail org-mhe org-irc
org-info org-gnus org-docview doc-view jka-compr image+ image-file
image-mode org-bibtex bibtex org-bbdb org-w3m org-table org-element
avl-tree generator ob-latex ob-plantuml ob-org ob-shell ob-gnuplot
ob-python ob-ditaa ob-dot org org-macro org-footnote org-pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs holidays
hol-loaddefs cal-menu calendar cal-loaddefs nnir gnus-topic
cursor-sensor utf-7 epa-file nnfolder gnus-desktop-notify alert log4e
notifications dbus gntp gnus-demon bbdb-gnus bbdb-mua bbdb-com nnml
gnus-delay gnus-draft gnus-agent gnus-srvr gnus-score score-mode
nnvirtual nntp gnus-cache gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum nndraft nnmh gnus-group gnus-undo ffmpeg
gnus-fun gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo
gnus-spec gnus-int gnus-range gnus-win gnus nnheader mm-archive
network-stream starttls url-cache debbugs-gnu debbugs soap-client
url-http tls gnutls url-auth url-gw nsm url url-proxy url-privacy
url-expand url-methods url-history mailcap rng-xsd rng-dt rng-util
xsd-regexp xml magit-obsolete magit-blame magit-stash magit-bisect
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-branch magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log magit-diff smerge-mode diff-mode
magit-core magit-autorevert magit-process magit-margin magit-mode
magit-git magit-section magit-popup git-commit magit-utils crm log-edit
message rmc puny rfc822 mml mml-sec epa derived epg gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log with-editor async-bytecomp async dired
dired-loaddefs term/tmux term/xterm xterm smart-mode-line-dark-theme
smart-mode-line rich-minority beacon server flymake-proc flymake
warnings auto-complete-config auto-complete form-feed paredit nameless
lisp-mnt flyspell ispell whitespace flycheck-irony irony-diagnostics
irony irony-iotask flycheck-popup-tip popup flycheck-pos-tip pos-tip
flycheck find-func subr-x dash rainbow-delimiters projectile grep
ibuf-ext ibuffer ibuffer-loaddefs ggtags compile ewoc
highlight-escape-sequences linum yasnippet company-oddmuse
company-keywords company-etags etags xref project company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-css company-nxml company-bbdb company-template company pcase
anzu thingatpt perspeen perspeen-tab powerline powerline-separators
powerline-themes atomic-chrome websocket url-cookie url-domsuf url-util
bindat let-alist json map color-theme-approximate color tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
comint ansi-color parse-time format-spec delim-col hydra-examples
windmove rect hydra lv bbdb bbdb-site timezone cus-edit cus-start
cus-load wid-edit ace-link avy google-c-style undo-tree diff cl-extra
help-mode which-key advice anyclip-mode diminish use-package bind-key
easy-mmode finder-inf autoinsert tex-site edmacro kmacro rx info package
epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache url-vars local-autoloads cwarn
cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs elec-pair saveplace cap-words superword
subword time-date paren winner ring autorevert filenotify xt-mouse
tango-dark-theme savehist ido seq byte-opt gv bytecomp byte-compile
cconv cl-loaddefs cl-lib keybinds terminals mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 912071 71062)
 (symbols 48 60551 31)
 (miscs 40 1314 647)
 (strings 32 201909 14533)
 (string-bytes 1 6467819)
 (vectors 16 95875)
 (vector-slots 8 1454683 27488)
 (floats 8 3684 1498)
 (intervals 56 22266 712)
 (buffers 992 44))

Acknowledgement sent to Gustaf Waldemarson <gustaf.waldemarson@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#29645; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.