all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>, emacs-devel@gnu.org
Subject: Re: Creating a coding system
Date: Sat, 20 Dec 2014 17:52:29 +0100	[thread overview]
Message-ID: <87vbl6gt6a.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87d27ecmwq.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Sun, 21 Dec 2014 01:21:25 +0900")

"Stephen J. Turnbull" <stephen@xemacs.org> writes:

> David Kastrup writes:
>
>  > > The translation table operates on the decoded contents.
>  > 
>  > Why would something be decoded twice in a row?
>
> Who can give a complete description?  I can't, but sometimes it's
> useful, just as sometimes tr(1) is useful.
>
>  > I am missing the big picture here in some manner.  Does decoding not
>  > start from a byte stream but rather from an emacs-utf-8 encoded version
>  > of a byte stream?
>
> Either (see Eli's reply).  But the translation table is an add-on, not
> part of the bytes-to-character coding system itself.

Huh.  Then maybe I am not doing this right.  I want to use a "process
coding system" to efficiently sift through Midi data and leaves some
useful form (a more versatile form would likely be the Lisp reader
equivalent of MidiXML).

> XEmacs's coding system stuff is quite different (don't start, I'm
> trying to be helpful in lieu of a real expert), so I can't be sure,
> but your definition
>
> (define-coding-system 'midi
>   "This converts Midi note-on events to note names"
>   :mnemonic ?M
>   :coding-type 'charset
>   :eol-type 'unix
>   :decode-translation-table 'midi-decode-table
>   :mime-text-unsuitable t)
>
> doesn't match the idioms used throughout the rest of the :coding-type
> 'charset coding systems.

I'd have no idea.  The DOC string for define-coding-system lists the
various possibilities, but does not bother mentioning the actual
_meaning_ of the setting.

> Specifically, I suspect the :charset-list property is required for
> anything useful to happen.

Again, the DOC string for define-coding-system does not bother
mentioning what this is supposed to be for.  And the Elisp manual only
bothers with using coding systems rather than defining them.

> Also, I suspect :coding-type 'charset requires a unibyte charset.

I have no idea.

> I'm not sure it can be made to work for you, as your "characters" seem
> to be multibyte.

I have no idea.  The Midi device I open with make-serial-process
obviously delivers bytes.

> Try adding :charset-list '(latin-1) (or maybe '(raw-text)) to your
> definition.  That should just translate bytes to internal
> representation of the characters with codes 0-255, and then your
> translation table should DTRT.  If that doesn't do the trick, you'll
> have to ask Ken Handa most likely.

It would seem that Handa-san is currently the only documentation for the
coding system details Emacs has.  Some more redundancy might be a good
idea.

-- 
David Kastrup



  reply	other threads:[~2014-12-20 16:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-20  9:05 Creating a coding system David Kastrup
2014-12-20 10:20 ` Thien-Thi Nguyen
2014-12-20 10:42   ` David Kastrup
2014-12-20 13:51 ` Andreas Schwab
2014-12-20 14:19   ` David Kastrup
2014-12-20 14:50     ` Eli Zaretskii
2014-12-20 15:56     ` Thien-Thi Nguyen
2014-12-20 16:11     ` Andreas Schwab
2014-12-20 16:14     ` Andreas Schwab
2014-12-20 16:43       ` David Kastrup
2014-12-20 16:53         ` Eli Zaretskii
2014-12-20 17:38           ` David Kastrup
2014-12-20 18:31             ` Stephen J. Turnbull
2014-12-20 18:40               ` David Kastrup
2014-12-20 18:35             ` Eli Zaretskii
2014-12-20 19:06               ` David Kastrup
2014-12-20 20:02                 ` Eli Zaretskii
2014-12-20 20:11                   ` David Kastrup
2014-12-20 20:45                     ` Eli Zaretskii
2014-12-20 21:15                       ` David Kastrup
2014-12-21 19:46                         ` David Kastrup
2014-12-21 21:25                       ` David Kastrup
2014-12-21  5:54                 ` Stephen J. Turnbull
2014-12-20 16:21     ` Stephen J. Turnbull
2014-12-20 16:52       ` David Kastrup [this message]
2014-12-20 18:34         ` Eli Zaretskii
2014-12-20 18:42           ` David Kastrup
2014-12-23  8:59 ` K. Handa
2014-12-23  9:25   ` David Kastrup
2014-12-24 15:06     ` K. Handa
2014-12-25  6:39       ` David Kastrup
2014-12-29 14:11         ` K. Handa
2014-12-29 14:25           ` David Kastrup

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

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

  git send-email \
    --in-reply-to=87vbl6gt6a.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.org \
    --cc=stephen@xemacs.org \
    /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.
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.