From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: about xhtml-mode encoding problem Date: Mon, 09 Jul 2007 19:59:31 +0200 Message-ID: <46927783.8050506@gmail.com> References: <469249C1.7080202@luxdo.jp> <9CDB8EBC-92CA-4E16-89B7-A55064C94777@Web.DE> <46925E84.1070107@luxdo.co.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1184004040 18514 80.91.229.12 (9 Jul 2007 18:00:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2007 18:00:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?UTF-8?B?5ZGC44CA5YWL?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 09 20:00:39 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I7xXK-00056r-UJ for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Jul 2007 20:00:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7xXK-0003UR-MF for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Jul 2007 14:00:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I7xX4-0003Tb-Ga for help-gnu-emacs@gnu.org; Mon, 09 Jul 2007 14:00:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I7xX3-0003TH-Na for help-gnu-emacs@gnu.org; Mon, 09 Jul 2007 14:00:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7xX3-0003Su-4j for help-gnu-emacs@gnu.org; Mon, 09 Jul 2007 14:00:21 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I7xX1-0005K0-VH for help-gnu-emacs@gnu.org; Mon, 09 Jul 2007 14:00:20 -0400 Original-Received: from c83-254-133-189.bredband.comhem.se ([83.254.133.189]:64613 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.66) (envelope-from ) id 1I7xWz-0001Fe-5Z; Mon, 09 Jul 2007 20:00:18 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070604 Thunderbird/2.0.0.4 Mnenhy/0.7.5.666 In-Reply-To: <46925E84.1070107@luxdo.co.jp> X-Antivirus: avast! (VPS 000754-5, 2007-07-08), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.133.189 X-Scan-Result: No virus found in message 1I7xWz-0001Fe-5Z. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1I7xWz-0001Fe-5Z c4bf5da5ac3a660d3916409921b2d24b X-detected-kernel: Linux 2.6? (barebone, rare!) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:45565 Archived-At: 呂 克 wrote: > Sorry I had a mistake. > The problem is on *nxhtml-mode*,not xhtml-mode. > > I added these line in my .emacs. > load-file (concat plugin_path "/nxml/autostart.el")) > (setq auto-mode-alist (cons '("\\.jsp$" . nxhtml-mode) > auto-mode-alist)) > (setq auto-mode-alist (cons '("\\.asp$" . nxhtml-mode) > auto-mode-alist)) > (setq auto-mode-alist (cons '("\\.php$" . nxhtml-mode) > auto-mode-alist)) > (setq auto-mode-alist (cons '("\\.phtml$" . nxhtml-mode) > auto-mode-alist)) > > (modify-coding-system-alist 'file "\\.jsp\\'" 'sjis) > (add-to-list 'file-coding-system-alist '("\\.jsp\\'" . sjis)) > (add-to-list 'file-coding-system-alist '("\\.xhtml\\'" . sjis)) > (prefer-coding-system 'sjis) > > But I'm sorry to say all of them doesn't work. > when I save the file it become utf-8. > I'm using emacs 22 on linux and windows xp. Thanks, that was why I asked you which major modes you are using. nxhtml-mode is derived from nxml-mode and I think it handles coding systems a bit differently. Look at write-contents-functions in the buffer. I think it contains nxml-prepare-to-save. That function tries to get the coding system to use from the XML header if the coding system has not been specified explicitly for the buffer through buffer-file-coding-system. Is there an XML header in the buffer in your case? What coding system does it specify?