all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Selected encoding disagrees ...
@ 2006-04-10  2:45 Eric Pement
  2006-04-10  8:51 ` Peter Dyballa
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Pement @ 2006-04-10  2:45 UTC (permalink / raw)


I'm using GNU Emacs for WinNT (ver. 21.3.50.1) with html-helper-mode
(v3.0.4jolly) to edit web pages. My web pages usually carry this HTML
directive ... using braces instead of angle brackets:

  {meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"}

When I try to save a page, I get this error message from Emacs:

   ------------
   Selected encoding raw-text-dos disagrees with iso-8859-1-dos
specified by file contents.  Really save (else edit coding cookies and
try again)? (yes or no)
   ------------

The strings "dos", "coding" or "encoding" (case-insensitive match) do
not occur in my .emacs file nor in the html-helper-mode.el file. I know
that Emacs is trying to Do The Right Thing to prevent encoding
corruption. I also know that I can type

   Ctrl-X {RET} f iso-8859-1-dos

to set the file encoding. But I want to avoid this message in the first
place if the filetype is .html or .htm. I never use high-bit characters
in my HTML files; every character is below 0x7F, and thus there is no
chance of character-encoding conflict between raw-text-dos and
iso-8859-1. In the case of my .htm* files, I want to suppress this
warning and keep the selected encoding, but for other filetypes, I'd
like to see the warning.

Can someone please suggest the Lisp code to add to my .emacs file to
accomplish this? Thanks in advance.

--
Eric Pement

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Selected encoding disagrees ...
  2006-04-10  2:45 Selected encoding disagrees Eric Pement
@ 2006-04-10  8:51 ` Peter Dyballa
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Dyballa @ 2006-04-10  8:51 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 10.04.2006 um 04:45 schrieb Eric Pement:

>   {meta http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1"}

Try something like

	(prefer-coding-system                          'iso-8859-1)
	(modify-coding-system-alist 'file "\\.html\\'" 'iso-latin-1-unix)

these are just examples.

--
Greetings

   Pete

Think of XML as Lisp for COBOL programmers.

-- Tony-A (some guy on /.)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-10  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-10  2:45 Selected encoding disagrees Eric Pement
2006-04-10  8:51 ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.