Don't have C-x = bug out in a "C" locale with non-ASCII chars

* lisp/simple.el (what-cursor-position): Ensure that we always
have a coding system here, even if the locale is "C" (bug#40702).
This commit is contained in:
Stefan Monnier 2020-09-30 05:43:07 +02:00 committed by Lars Ingebrigtsen
parent fcdcdea324
commit 6c0f1c26d2

View file

@ -1533,7 +1533,11 @@ in *Help* buffer. See also the command `describe-char'."
encoded encoding-msg display-prop under-display)
(if (or (not coding)
(eq (coding-system-type coding) t))
(setq coding (default-value 'buffer-file-coding-system)))
(setq coding (or (default-value 'buffer-file-coding-system)
;; A nil value of `buffer-file-coding-system'
;; means "no conversion" which means each byte
;; is a char and vice versa.
'binary)))
(if (eq (char-charset char) 'eight-bit)
(setq encoding-msg
(format "(%d, #o%o, #x%x%s, raw-byte)" char char char char-name-fmt))