emacs-devel
[Top][All Lists]
Advanced

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

Composition of Quail IMs (was: smartquotes.el -- Insertion of unicode qu


From: Stefan Monnier
Subject: Composition of Quail IMs (was: smartquotes.el -- Insertion of unicode quotes in text documents)
Date: Mon, 27 Aug 2007 17:16:23 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>> I can see why it is useful, but we already have a similar facility:
>> Quail.  What about using Quail for this?

> Can Quail support multiple input methods at once?  Because it would be
> inconvenient to be able to use such a feature only when no other input
> method is used.

Indeed, it currently cannot.  And it's a good reason not to use quail for
this package.  The problem showed up a few years ago already (probably when
discussing something around C-x 8 which should really be a combination of
quail's latin-1postfix and latin-1-prefix, shifted to the C-x 8 prefix) and
I wrote a naive proof of concept:

   (defun quail-merge-maps (map1 &rest maps)
     (if (null maps) map1
       (let* ((map2 (pop maps))
              (h1 (pop map1))
              (h2 (pop map2)))
         (apply 'quail-merge-maps
                (cons
                 (if (and h1 h2)
                     (vconcat (if (vectorp h1) h1 (vector h1))
                              (if (vectorp h2) h2 (vector h2)))
                   (or h1 h2))
                 (let ((tail nil) conflict)
                   (dolist (entry map1)
                     (setq conflict (assq (car entry) map2))
                     (push (if (not conflict) entry
                             (setq map2 (delq conflict map2))
                             (cons (car entry)
                                   (quail-merge-maps (cdr entry) (cdr 
conflict))))
                           tail))
                   (append map2 tail)))
                maps))))

but I don't know and understand enough of Quail's facilities to be able to
make this work reliably even for complex input methods.

I think compositionality of Quail input methods would be a great
improvement, but I don't think I'm up to doing it,


        Stefan




reply via email to

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