From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: Creating a coding system Date: Sat, 20 Dec 2014 14:51:24 +0100 Message-ID: <87sigasa3n.fsf@igel.home> References: <87ppbeitcs.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419083520 15131 80.91.229.3 (20 Dec 2014 13:52:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Dec 2014 13:52:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 20 14:51:53 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y2KRk-0001e6-Qd for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2014 14:51:52 +0100 Original-Received: from localhost ([::1]:34451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2KRj-0007od-RM for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2014 08:51:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2KRc-0007ne-8I for emacs-devel@gnu.org; Sat, 20 Dec 2014 08:51:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2KRW-0000F0-Tv for emacs-devel@gnu.org; Sat, 20 Dec 2014 08:51:44 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.9]:49979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2KRM-00007v-V1; Sat, 20 Dec 2014 08:51:29 -0500 Original-Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3k4Sz21Hzfz3hj2S; Sat, 20 Dec 2014 14:51:26 +0100 (CET) Original-Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3k4Sz20R0Rzvh4k; Sat, 20 Dec 2014 14:51:26 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id gXzFvtoEzXXq; Sat, 20 Dec 2014 14:51:25 +0100 (CET) X-Auth-Info: GRfMS3JL5nIOYFciTo8f8qMI81InUkhbOSDMR06BvolYXi/ZONmexf6c0e8TDDpz Original-Received: from igel.home (host-188-174-218-27.customer.m-online.net [188.174.218.27]) by mail.mnet-online.de (Postfix) with ESMTPA; Sat, 20 Dec 2014 14:51:24 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 1000) id A5BCA2C351C; Sat, 20 Dec 2014 14:51:24 +0100 (CET) X-Yow: Are you still an ALCOHOLIC? In-Reply-To: <87ppbeitcs.fsf@fencepost.gnu.org> (David Kastrup's message of "Sat, 20 Dec 2014 10:05:39 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 212.18.0.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180374 Archived-At: David Kastrup writes: > Ok, what am I doing wrong here? Why does decode-coding-string not do > anything here? > > (define-translation-table 'midi-decode-table > (make-translation-table-from-alist > (mapcar > (lambda (p) > (cons (car p) (string-to-vector (cdr p)))) > '(([144 0] . "c,,,,") The translation table operates on the decoded contents. > (prin1 (decode-coding-string "\220\040" 'midi)) (aref (string-make-multibyte "\220\040") 0) => 4194192 Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."