Fix display of ambiguous-width CJK characters in GUI sessions

* lisp/international/characters.el (use-cjk-char-width-table): Fix
to work correctly in GUI sessions on Windows.  (Bug#81489)
This commit is contained in:
Eli Zaretskii 2026-08-01 13:01:13 +03:00
parent cf98d9d725
commit d31d3245ba

View file

@ -1715,8 +1715,15 @@ the value of the variable with `setq'."
(ambiguous-is-wide
(and cjk-ambiguous-chars-are-wide
;; MS-Windows Terminal forces all ambiguous
;; characters to be narrow, even in CJK locales.
(not (and (boundp 'w32--terminal-is-conhost)
;; characters to be narrow, even in CJK locales,
;; assuming the fonts it uses were left at their
;; defaults.
(not (and (eq system-type 'windows-nt)
;; 'window-system' might be nil when this
;; code is called from startup.el, as part
;; of 'set-locale-environment', so we must
;; test 'initial-window-system' instead.
(null initial-window-system)
(null w32--terminal-is-conhost))))))
(map-char-table
(lambda (range _val)