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: Wed, 11 Jul 2007 16:41:20 +0200 Message-ID: <4694EC10.9030901@gmail.com> References: <469249C1.7080202@luxdo.jp> <9CDB8EBC-92CA-4E16-89B7-A55064C94777@Web.DE> <46925E84.1070107@luxdo.co.jp> <46927783.8050506@gmail.com> <4694E2EE.3000907@luxdo.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184164923 7147 80.91.229.12 (11 Jul 2007 14:42:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2007 14:42:03 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "lu@luxdo.jp" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 11 16:42:02 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 1I8dOD-0007DH-8b for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 16:42:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8dOC-0004jZ-Ua for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 10:42:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8dNu-0004jQ-DU for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 10:41:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8dNs-0004jE-TR for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 10:41:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8dNs-0004jB-Pk for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 10:41:40 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I8dNr-0007Ae-9q for help-gnu-emacs@gnu.org; Wed, 11 Jul 2007 10:41:40 -0400 Original-Received: from c83-254-133-189.bredband.comhem.se ([83.254.133.189]:63791 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.66) (envelope-from ) id 1I8dNj-0000UU-9M; Wed, 11 Jul 2007 16:41:33 +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: <4694E2EE.3000907@luxdo.jp> X-Antivirus: avast! (VPS 000755-1, 2007-07-11), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.133.189 X-Scan-Result: No virus found in message 1I8dNj-0000UU-9M. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1I8dNj-0000UU-9M ac99485f92a221d368a89674f0bda2f1 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:45602 Archived-At: lu@luxdo.jp wrote: >> 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? > > I'm Sorry to reply late. No problem, I just wondered if you noticed my reply. >> Is there an XML header in the buffer in your case? What coding system >> does it specify? > > I don't know what's the meaning. From the pictures you sent me it looks like your pages are HTML, not XHTML. Is there any reason for you to use HTML instead of the new and in many ways better XHTML? The header in XHTML could look something like this News and Notes about nXhtml As you can see you can specify the encoding there. The corresponding Emacs encoding will be used when saving the file if you are using nxhtml-mode (or nxml-mode). nxhtml-mode is for editing XHTML, not HTML. That is why have had some trouble here. However the package (nXhtml) you download to get nxhtml-mode includes more than just nxhtml-mode. The part that is interesting for you is mumamo-mode which can handle JSP in both HTML and XHTML. If you have followed the installation instructions for nXhtml then mumamo-mode is used for this, but it assumes that the .jsp files are XHTML. If you really want to use HTML then you could customize mumamo-filenames-list. By default the MuMaMo chunk family for .jsp files is "JSP nXhtml Family". You could change that to "JSP HTML Family".