呂 克 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?
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs