From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Uwe Brauer Newsgroups: gmane.emacs.devel Subject: Re: [conversion fails] Date: Mon, 12 Feb 2018 11:40:20 +0100 Message-ID: <87sha6o5ij.fsf@mat.ucm.es> References: <878tcbdpf3.fsf@mat.ucm.es> <876078p1gy.fsf@md5i.com> <87tvurldff.fsf@mat.ucm.es> <87wozmnhny.fsf@md5i.com> <8760750vz4.fsf_-_@mat.ucm.es> <87po5aoocr.fsf@md5i.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1518432000 6902 195.159.176.226 (12 Feb 2018 10:40:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2018 10:40:00 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 12 11:39:56 2018 Return-path: Envelope-to: ged-emacs-devel@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 1elBW2-0007VX-Vq for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2018 11:39:19 +0100 Original-Received: from localhost ([::1]:40293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elBY2-0002QN-Ug for ged-emacs-devel@m.gmane.org; Mon, 12 Feb 2018 05:41:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elBXt-0002Or-CM for emacs-devel@gnu.org; Mon, 12 Feb 2018 05:41:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elBXo-0008GR-Kh for emacs-devel@gnu.org; Mon, 12 Feb 2018 05:41:13 -0500 Original-Received: from [195.159.176.226] (port=59984 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1elBXo-0008E4-Ca for emacs-devel@gnu.org; Mon, 12 Feb 2018 05:41:08 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1elBVL-0004vR-7l for emacs-devel@gnu.org; Mon, 12 Feb 2018 11:38:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 48 Original-X-Complaints-To: usenet@blaine.gmane.org Mail-Copies-To: never Cancel-Lock: sha1:K4k+bIKDoHY4+op5qlqBJ5jZ6kI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:222684 Archived-At: > Uwe Brauer writes: > Okay. > I hacked up the following, which is minimally tested, but may work for > you. I tried to use public functions from quail, but the (null (cdr > map)) is probably an implementation detail, and might break in a future > version. There are almost certainly better ways to write this function. > If presented with an ambiguity (like above), it will choose the last > remembered variant (defaulting to 1). > (defun accentuate-region (start end) > "Replace the region by using it as keys using the current input method" > (interactive "r") > (save-excursion > (goto-char start) > (let* ((data (delete-and-extract-region start end)) > (size (length data)) > (idx 0) (cand "")) > (while (< idx size) > (let* ((next-cand (concat cand (list (aref data idx)))) > (map (quail-lookup-key next-cand)) > (def (and map (quail-map-definition map)))) > (if (null map) > (progn > (insert next-cand) > (setq cand "")) > (if (and def (null (cdr map))) > (progn > (insert (quail-get-current-str (length next-cand) def)) > (setq cand "")) > (setq cand next-cand))) > (incf idx))) > (insert cand)))) I tested it with latin-1-pre and it worked, but I tried also greek-ibycus4 And it should translate a) to ἀ But it does not. So I am puzzled. Uwe