unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: 呂 克 <lu@luxdo.co.jp>
Cc: help-gnu-emacs@gnu.org
Subject: Re: about xhtml-mode encoding problem
Date: Mon, 09 Jul 2007 19:59:31 +0200	[thread overview]
Message-ID: <46927783.8050506@gmail.com> (raw)
In-Reply-To: <46925E84.1070107@luxdo.co.jp>

呂 克 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?

  reply	other threads:[~2007-07-09 17:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09 14:44 about xhtml-mode encoding problem lu
2007-07-09 15:31 ` Peter Dyballa
2007-07-09 16:07   ` lu
2007-07-09 17:08     ` Lennart Borgman (gmail)
2007-07-09 18:00     ` Peter Dyballa
2007-07-09 23:26       ` lu
2007-07-09 23:37       ` about nxhtml-mode " lu
2007-07-11 12:47         ` lu
2007-07-11 13:18           ` Lennart Borgman (gmail)
2007-07-11 14:07             ` lu
2007-07-12 13:56             ` lu
2007-11-25 22:56               ` Lennart Borgman (gmail)
2007-11-26  4:53                 ` Ke Lu
2007-11-26  8:03                   ` Lennart Borgman (gmail)
2007-07-09 16:12   ` about xhtml-mode " 呂 克
2007-07-09 17:59     ` Lennart Borgman (gmail) [this message]
2007-07-11 14:02       ` lu
2007-07-11 14:41         ` Lennart Borgman (gmail)
     [not found]   ` <mailman.3225.1183997250.32220.help-gnu-emacs@gnu.org>
2007-07-09 16:41     ` B. T. Raven
2007-07-09 23:29       ` lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46927783.8050506@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=lu@luxdo.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).