* the -*-coding: -*- stuff doesn't check for invalid codings
@ 2005-07-09 2:18 Dan Jacobson
2005-07-11 17:16 ` Kevin Rodgers
0 siblings, 1 reply; 4+ messages in thread
From: Dan Jacobson @ 2005-07-09 2:18 UTC (permalink / raw)
No error is reported to the user if he uses
;-*-coding: utf8;-*-
instead of
;-*-coding: utf-8;-*-
I.e., the -*-coding: -*- stuff doesn't check for invalid codings.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: the -*-coding: -*- stuff doesn't check for invalid codings
2005-07-09 2:18 the -*-coding: -*- stuff doesn't check for invalid codings Dan Jacobson
@ 2005-07-11 17:16 ` Kevin Rodgers
2005-07-14 19:05 ` Kevin Rodgers
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2005-07-11 17:16 UTC (permalink / raw)
Dan Jacobson wrote:
> No error is reported to the user if he uses
> ;-*-coding: utf8;-*-
> instead of
> ;-*-coding: utf-8;-*-
>
> I.e., the -*-coding: -*- stuff doesn't check for invalid codings.
Sure it does, it just doesn't report it (see set-auto-coding):
(or (coding-system-p coding-system)
(setq coding-system nil))
Is (error "Invalid coding system: %s" coding-system) really what
we want?
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: the -*-coding: -*- stuff doesn't check for invalid codings
2005-07-11 17:16 ` Kevin Rodgers
@ 2005-07-14 19:05 ` Kevin Rodgers
2005-07-14 20:00 ` Juanma Barranquero
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2005-07-14 19:05 UTC (permalink / raw)
>> I.e., the -*-coding: -*- stuff doesn't check for invalid codings.
>
> Sure it does, it just doesn't report it (see set-auto-coding):
>
> (or (coding-system-p coding-system)
> (setq coding-system nil))
>
> Is (error "Invalid coding system: %s" coding-system) really what
> we want instead of (setq coding-system nil)?
I think it would be better to signal an error there than to fall back on
the default coding system, since the author of the file clearly intends
that a specific coding system be used.
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: the -*-coding: -*- stuff doesn't check for invalid codings
2005-07-14 19:05 ` Kevin Rodgers
@ 2005-07-14 20:00 ` Juanma Barranquero
0 siblings, 0 replies; 4+ messages in thread
From: Juanma Barranquero @ 2005-07-14 20:00 UTC (permalink / raw)
Cc: bug-gnu-emacs
On 7/14/05, Kevin Rodgers <ihs_4664@yahoo.com> wrote:
> I think it would be better to signal an error there than to fall back on
> the default coding system, since the author of the file clearly intends
> that a specific coding system be used.
>From the Python docs:
"If a comment in the first or second line of the Python script matches
the regular expression coding[=:]\s*([-\w.]+), this comment is
processed as an encoding declaration; the first group of this
expression names the encoding of the source code file. The recommended
forms of this expression are
# -*- coding: <encoding-name> -*-
which is recognized also by GNU Emacs, and
# vim:fileencoding=<encoding-name>
which is recognized by Bram Moolenaar's VIM."
The Python encodings are largely those of Emacs, but with some
differences. For example, coding: latin_1 is valid for Python,
unrecognized by Emacs.
Not sure whether this is an argument for throwing an error, or adding
more aliases to Emacs encodings, though.
--
/L/e/k/t/u
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-07-14 20:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-09 2:18 the -*-coding: -*- stuff doesn't check for invalid codings Dan Jacobson
2005-07-11 17:16 ` Kevin Rodgers
2005-07-14 19:05 ` Kevin Rodgers
2005-07-14 20:00 ` Juanma Barranquero
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.