working system
This commit is contained in:
commit
e0ad4ea627
53 changed files with 2927 additions and 0 deletions
26
lisp/init-locales.el
Normal file
26
lisp/init-locales.el
Normal file
|
@ -0,0 +1,26 @@
|
|||
;;; init-locales.el --- Configure default locale -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
(defun sanityinc/locale-var-encoding (v)
|
||||
"Return the encoding portion of the locale string V, or nil if missing."
|
||||
(when v
|
||||
(save-match-data
|
||||
(let ((case-fold-search t))
|
||||
(when (string-match "\\.\\([^.]*\\)\\'" v)
|
||||
(intern (downcase (match-string 1 v))))))))
|
||||
|
||||
(dolist (varname '("LC_ALL" "LANG" "LC_CTYPE"))
|
||||
(let ((encoding (sanityinc/locale-var-encoding (getenv varname))))
|
||||
(unless (memq encoding '(nil utf8 utf-8))
|
||||
(message "Warning: non-UTF8 encoding in environment variable %s may cause interop problems with this Emacs configuration." varname))))
|
||||
|
||||
(when (fboundp 'set-charset-priority)
|
||||
(set-charset-priority 'unicode))
|
||||
(prefer-coding-system 'utf-8)
|
||||
(setq locale-coding-system 'utf-8)
|
||||
(unless (eq system-type 'windows-nt)
|
||||
(set-selection-coding-system 'utf-8))
|
||||
|
||||
(provide 'init-locales)
|
||||
;;; init-locales.el ends here
|
Loading…
Add table
Add a link
Reference in a new issue