branch: elpa/sweeprolog
commit f57584ac73f870dee1a3bd48d5ad6d7d1e7e6ea4
Author: Eshel Yaron <[email protected]>
Commit: Eshel Yaron <[email protected]>
FIXED: workaround Emacs incompatibility with certain locales
The Emacs Elisp reader only works with locales that have "." as their
decimal separator, but Prolog initialization sets up the locale
according to the environment variables. Therefore we need to reset
the locale after initializing Prolog in case the environment
prescribes a locale with a different decimal separator, such as fr_FR.
See also https://github.com/SWI-Prolog/packages-sweep/issues/1
---
sweeprolog.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sweeprolog.el b/sweeprolog.el
index d2352a9248..475ff62fcd 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -253,6 +253,11 @@ inserted to the input history in
`sweeprolog-top-level-mode' buffers."
"--no-signals"
"-g"
"create_prolog_flag(sweep,true,[access(read_only),type(boolean)])"
+ ;; SWI-Prolog does its own locale initialization, but Emacs's
+ ;; Elisp reader only works with certain values of LC_NUMERIC,
+ ;; so we need to reset it after loading Prolog. This is
+ ;; basically emulating fixup_locale from src/emacs.c:
+ "-g" "setlocale(numeric, _, 'C')"
"-O"
"-l"
(expand-file-name