emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [conversion fails]


From: Uwe Brauer
Subject: Re: [conversion fails]
Date: Mon, 12 Feb 2018 11:40:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

   > Uwe Brauer <address@hidden> 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 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]