From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: How to translate LaTeX into UTF-8 in Elisp? Date: Tue, 04 Jul 2017 13:18:43 +0200 Message-ID: <87mv8kfo18.fsf@fastmail.fm> References: <87shpyfj2q.fsf@mbork.pl> <87bmp2rud7.fsf@jane> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1499167653 26052 195.159.176.226 (4 Jul 2017 11:27:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Jul 2017 11:27:33 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 25.2.50.1 Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 04 13:27:29 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dSLzI-0006Jy-UA for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jul 2017 13:27:25 +0200 Original-Received: from localhost ([::1]:40529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLzO-0003IA-0A for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Jul 2017 07:27:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLr2-0003eu-J5 for help-gnu-emacs@gnu.org; Tue, 04 Jul 2017 07:18:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLqx-0005UF-KL for help-gnu-emacs@gnu.org; Tue, 04 Jul 2017 07:18:52 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56095) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSLqx-0005TP-38 for help-gnu-emacs@gnu.org; Tue, 04 Jul 2017 07:18:47 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 4949720A21; Tue, 4 Jul 2017 07:18:45 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Tue, 04 Jul 2017 07:18:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=WmeIToopLdycGyMtUM 7R32UdEpeoX0T6v9l6NbN7aUQ=; b=uj7EX2sOz7Rk6tIThSeCldLCDorqZDEE8D ec7ZolKgLin4ccU8WWv5eBPgil4nikDOq98PiudOfkBLPmIEEnR98vpY3oZxkI++ u29t5LZjwM0vXD51Z322ZxcwY/LS8UjslDw2yiBS6axb7q+4Bkx0rPupZzCXujsn OZpySGEo+iGrk8R7R9DRu0OinKK58Pyd9p2VdaPixa1qIGYDY6mDIiefLYbcLWbP AR0CcyVbsYMtkxS+EGnSI7zI+wmxqnO63oWiwf7LLQkMcPZgurDVsSnlOYHzByl5 UiNO2+PvrIcB70tShfKTF4hMeCXSgfN5p0U/esV7p1pP0zlei4cA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=WmeIToopLdycGyMtUM7R32UdEpeoX0T6v9l6NbN7aUQ=; b=sGj+J4tR v+03CFNC+A5ACQeArIMC5AvEzqTTS3SErUTjOdn5gB8eusX0nfLR9j9UF1UVW0vA cX+5/1moNPRJSVv4SzcLGBK3b2bUfGVTWz634Adot+5PV/oqGKqMvh/UocTgEVd8 7ml8wbBhrdfL3D+++2gqtVY/mdL5nrnUwvNVfsYRjWCbIZwKhsOKl6dkNKXdqhx5 xb21n6+Ez+jc6plzxjfVjyxHYtWfg2cBz7Iap6hNjv5791zJ7r31TG2OlwsOWBiJ U+dRscA1eMkdHBBlwBM8730zKdQ3vb5o6zvuMwAVxshJMhbmM1kv4rRY3g3dx5Fh fo2R7Nf7XfNPUA== X-ME-Sender: X-Sasl-enc: D01vKgOTjiqhfRj5L92YGEEhHzm8PWUKVKf5/eTIWhtF 1499167124 Original-Received: from IdeaPad.messagingengine.com (eruc066.goemobile.de [134.76.38.66]) by mail.messagingengine.com (Postfix) with ESMTPA id AEFED7E81C; Tue, 4 Jul 2017 07:18:44 -0400 (EDT) In-reply-to: <87bmp2rud7.fsf@jane> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113692 Archived-At: On Mon, Jul 03 2017, Marcin Borkowski wrote: > On 2016-12-08, at 18:04, Marcin Borkowski > wrote: > >> Hi all, >> >> I have a string with embedded sequences like "\'e" or "\H{o}". >> The >> Emacs TeX input method knows how to convert them into "é" or >> "ő" (when >> typing, of course). Is there a way to use that to perform >> similar >> conversions in a string? > > Hi all, > > I'm revisiting this old thread now. Since I got no satisfying > answers > back then, here is my plan for solution. I'm going first to map > \', \` > etc. onto /names/ (this is a rather short list!), construct a > Unicode > name of the character I want and then use =ucs-names=. > > For instance, \' maps to "ACUTE", then \'a will map to "LATIN > SMALL > LETTER A ACUTE" and this can be fed into =char-from-name=. > > It is a horrible hack, but it should work. Any better ideas? Have you tried looking into the input method mechanism that translates "\'e" into "é"? The info on how do such translations is stored somewhere somehow, so it should in principle be possible to use it to do the translations you want. I don't know very much about quail (I define a few custom input methods in my init files, but that's about it), but it looks like the info is stored as an alist somewhere of the form ("\\'e" ?é). Perhaps you've already explored this idea and found it too unwieldy, but you didn't mention it anywhere. -- Joost Kremers Life has its moments