Bug 185399
Summary: | emacs forgets about utf keyboard encoding when TERM!=xterm | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Axel Thimm <axel.thimm> |
Component: | emacs | Assignee: | Chip Coldwell <coldwell> |
Status: | CLOSED NEXTRELEASE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 5 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2006-08-03 18:53:13 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Axel Thimm
2006-03-14 12:47:00 UTC
I think this is due to lang-coding-systems-init.el. So a regexp or substring of $TERM needs to be used there instead. BTW what terminal defines TERM to be xterm-16color/256color? Thanks Jens! I'm now using @@ -22,7 +22,7 @@ (require 'un-define)) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) - (if (equal (getenv "TERM") "xterm") + (if (equal (substring (getenv "TERM") 0 5) "xterm") (set-keyboard-coding-system 'utf-8))) ((equal lang "ja") (set-default-coding-systems 'euc-jp) Could you also do the same for linux and linux-c for FC5? Probably something like @@ -23,8 +23,8 @@ (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (let ((term (getenv "TERM"))) - (when (or (equal term "linux") - (equal term "xterm")) + (when (or (equal (substring term 0 5) "linux") + (equal (substring term 0 5) "xterm")) (set-keyboard-coding-system 'utf-8)))) ((equal lang "ja") (set-default-coding-systems 'euc-jp) Wrt where xterm-256color/16color are used: I'm using them with xterm for various apps most notably mutt. And the editor called by mutt (emacs -nw) would not accept german Umlauts, that's how I stumbled over it. I don't think xterm-Ncolor is used by default anywhere in FC4. OK, but I think those substring calls need to be protected against the case when TERM is less than 5 chars. I tested on FC4 against a TERM with less than 5 characters and the result was nil again, which is what one wants. emacs' elist manual on the use of substring isn't specific on what happens if the END is below the length of the string, but it doesn't seem to hurt. BTW I'm no list/elisp expert, substring was the first match I found in the docs, compare-strings might be better. Hmm ok, for me evaluating say (substring "abc" 0 5) gives an error: Debugger entered--Lisp error: (args-out-of-range "abc" 0 5) but maybe the non-interactive behaviour is different? Then maybe something like (substring (concat term " ") 0 5) to be safe? A regular expression seems like the way to go. I'm committing this fix to rawhide/FC-5. $ cvs diff -u lang-coding-systems-init.el Index: lang-coding-systems-init.el =================================================================== RCS file: /cvs/dist/rpms/emacs/devel/lang-coding-systems-init.el,v retrieving revision 1.6 diff -u -r1.6 lang-coding-systems-init.el --- lang-coding-systems-init.el 25 Nov 2005 09:04:10 -0000 1.6 +++ lang-coding-systems-init.el 3 Aug 2006 18:07:44 -0000 @@ -23,8 +23,8 @@ (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (let ((term (getenv "TERM"))) - (when (or (equal term "linux") - (equal term "xterm")) + (when (or (string-match "^linux" term) + (string-match "^xterm" term)) (set-keyboard-coding-system 'utf-8)))) ((equal lang "ja") (set-default-coding-systems 'euc-jp) Fixed in FC-5 (version 21.4-16.1) and rawhide (version 21.4-17). Chip |