Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* w3m.el (w3m-language): Allow the value like "Japanese (UTF-8)" of

 current-language-environment.

* w3m-symbol.el (w3m-symbol): Ditto.

* w3mhack.el (w3mhack-makeinfo): Use locale-coding-system for Emacs or
 terminal-coding-system for XEmacs to encode Japanese messages.
  • Loading branch information...
commit 268f420364c0f011cd494625a6bdbd4af0c06201 1 parent 09db05a
yamaoka authored
Showing with 48 additions and 17 deletions.
  1. +10 −0 ChangeLog
  2. +11 −2 w3m-symbol.el
  3. +3 −1 w3m.el
  4. +24 −14 w3mhack.el
View
10 ChangeLog
@@ -1,3 +1,13 @@
+2009-01-09 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * w3m.el (w3m-language): Allow the value like "Japanese (UTF-8)" of
+ current-language-environment.
+
+ * w3m-symbol.el (w3m-symbol): Ditto.
+
+ * w3mhack.el (w3mhack-makeinfo): Use locale-coding-system for Emacs or
+ terminal-coding-system for XEmacs to encode Japanese messages.
+
2009-01-09 Naohiro Aota <naota@elisp.net>
* w3m.el (w3m-create-text-page, w3m-goto-url): Check if the url is
View
13 w3m-symbol.el
@@ -1,6 +1,6 @@
;;; w3m-symbol.el --- Stuffs to replace symbols for emacs-w3m -*- coding: iso-2022-7bit; -*-
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009
;; ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
;; Author: ARISAWA Akihiro <ari@mbf.sphere.ne.jp>
@@ -184,6 +184,8 @@
(funcall w3m-use-symbol))
(t w3m-use-symbol)))
+(eval-when-compile (defvar current-language-environment))
+
(defun w3m-symbol ()
(cond (w3m-symbol
(if (symbolp w3m-symbol)
@@ -193,7 +195,14 @@
w3m-mule-unicode-symbol))
((let ((lang (or w3m-language
(and (boundp 'current-language-environment)
- (symbol-value 'current-language-environment)))))
+ current-language-environment
+ ;; In XEmacs 21.5 it may be the one like
+ ;; "Japanese (UTF-8)".
+ (if (string-match "[\t ]+("
+ current-language-environment)
+ (substring current-language-environment
+ 0 (match-beginning 0))
+ current-language-environment)))))
(when (boundp (intern (format "w3m-%s-symbol" lang)))
(symbol-value (intern (format "w3m-%s-symbol" lang))))))
(t w3m-default-symbol)))
View
4 w3m.el
@@ -282,7 +282,9 @@ The value of `w3m-user-agent' is used for the field body."
(defcustom w3m-language
(if (and (boundp 'current-language-environment)
- (string= "Japanese" (symbol-value 'current-language-environment)))
+ ;; In XEmacs 21.5 it may be the one like "Japanese (UTF-8)".
+ (string-match "\\`Japanese"
+ (symbol-value 'current-language-environment)))
"Japanese")
"*Your preferred language used in emacs-w3m sessions."
:group 'w3m
View
38 w3mhack.el
@@ -1,6 +1,6 @@
;;; w3mhack.el --- a hack to setup the environment for building w3m
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; TSUCHIYA Masatoshi <tsuchiya@namazu.org>
;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
@@ -822,22 +822,32 @@ NOTE: This function must be called from the top directory."
'message
(cond ((featurep 'mule)
;; Encode messages to terminal.
- (byte-compile
- (cond ((featurep 'xemacs)
- `(lambda (fmt &rest args)
- (unless (and (string-equal fmt "%s clean")
- (equal (car args)
- buffer-file-name))
+ (let ((coding
+ (or (and (boundp 'current-language-environment)
+ (string-match
+ "\\`Japanese"
+ current-language-environment)
+ (or (and (boundp 'locale-coding-system)
+ locale-coding-system)
+ (and (boundp 'terminal-coding-system)
+ terminal-coding-system)))
+ 'iso-2022-7bit)))
+ (byte-compile
+ (cond ((featurep 'xemacs)
+ `(lambda (fmt &rest args)
+ (unless (and (string-equal fmt "%s clean")
+ (equal (car args)
+ buffer-file-name))
+ (funcall ,si:message "%s"
+ (encode-coding-string
+ (apply 'format fmt args)
+ ',coding)))))
+ (t
+ `(lambda (fmt &rest args)
(funcall ,si:message "%s"
(encode-coding-string
(apply 'format fmt args)
- 'iso-2022-7bit)))))
- (t
- `(lambda (fmt &rest args)
- (funcall ,si:message "%s"
- (encode-coding-string
- (apply 'format fmt args)
- 'iso-2022-7bit)))))))
+ ',coding))))))))
((featurep 'xemacs)
(byte-compile
`(lambda (fmt &rest args)
Please sign in to comment.
Something went wrong with that request. Please try again.