From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Composition of Quail IMs (was: smartquotes.el -- Insertion of unicode quotes in text documents) Date: Mon, 27 Aug 2007 17:16:23 -0400 Message-ID: References: <1b151690708252221j7177cea1xe8916c52a1110190@mail.gmail.com> <853ay5bm43.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1188256799 11568 80.91.229.12 (27 Aug 2007 23:19:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Aug 2007 23:19:59 +0000 (UTC) Cc: Martin Blais , handa@m17n.org, rms@gnu.org, emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 28 01:19:39 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IPlyN-0004Cr-LO for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2007 23:19:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IPlyN-00018n-2u for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2007 17:18:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IPlxu-0000XL-Bl for emacs-devel@gnu.org; Mon, 27 Aug 2007 17:17:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IPlxs-0000Uo-JR for emacs-devel@gnu.org; Mon, 27 Aug 2007 17:17:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IPlxs-0000UN-6d for emacs-devel@gnu.org; Mon, 27 Aug 2007 17:17:40 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IPlxk-0003QR-Im; Mon, 27 Aug 2007 17:17:32 -0400 Original-Received: from ceviche.home (vpn-132-204-232-69.acd.umontreal.ca [132.204.232.69]) by chene.dit.umontreal.ca (8.13.7/8.13.7) with ESMTP id l7RLHTIB008617; Mon, 27 Aug 2007 17:17:30 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 2072EB45D9; Mon, 27 Aug 2007 17:16:22 -0400 (EDT) In-Reply-To: <853ay5bm43.fsf@lola.goethe.zz> (David Kastrup's message of "Mon\, 27 Aug 2007 07\:08\:28 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-NAI-Spam-Score: -0.7 X-NAI-Spam-Rules: 2 Rules triggered BAYES_10=-0.7, HAS_X_HELO=0 X-Detected-Kernel: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:77314 Archived-At: >> 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