[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
- quail input methods and conversion functions, Uwe Brauer, 2018/02/02
- Re: quail input methods and conversion functions, Michael Welsh Duggan, 2018/02/07
- Re: quail input methods and conversion functions, Uwe Brauer, 2018/02/08
- Re: quail input methods and conversion functions, Michael Welsh Duggan, 2018/02/09
- [conversion fails] (was: quail input methods and conversion functions), Uwe Brauer, 2018/02/10
- Re: [conversion fails], Michael Welsh Duggan, 2018/02/11
- Re: [conversion fails], Uwe Brauer, 2018/02/12
- Re: [conversion fails],
Uwe Brauer <=
- Re: [conversion fails], Michael Welsh Duggan, 2018/02/12
- Re: [conversion fails], Uwe Brauer, 2018/02/13
- Re: [conversion fails], Uwe Brauer, 2018/02/13
- Re: [conversion fails], Michael Welsh Duggan, 2018/02/13
- Re: [conversion fails], Uwe Brauer, 2018/02/13
- Re: [conversion fails], Michael Welsh Duggan, 2018/02/13
- Re: [conversion fails], Uwe Brauer, 2018/02/14
- [MELPA] (was: [conversion fails]), Uwe Brauer, 2018/02/19
- Re: [MELPA], Michael Welsh Duggan, 2018/02/19