all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: emacs-devel@gnu.org
Subject: Re: a few MULE criticisms
Date: Sun, 18 May 2003 01:23:54 -0400	[thread overview]
Message-ID: <200305180523.h4I5Nsj7008200@rum.cs.yale.edu> (raw)


Regarding the use of ? in input methods.
I've never looked at the code of quail before, so clearly
this is not working 100% (not even 90%, I'd say), but
maybe someone more knowledgeable can fix it ?

It maybe won't be a workable approach for dense quail
maps (like most are, I expect :-( ) but it works OK on
the TeX input method where I can say \righ?????? and get
a right arrow.

Generalizing to * is going to be even less workable, so I think
that a different approach is necessary.


	Stefan


--- quail.el.~1.128.~	Tue Apr 15 18:46:10 2003
+++ quail.el	Sun May 18 01:19:08 2003
@@ -1,6 +1,6 @@
 ;;; quail.el --- provides simple input method for multilingual text
 
-;; Copyright (C) 1995, 2000 Electrotechnical Laboratory, JAPAN.
+;; Copyright (C) 1995, 2000, 2003 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
 ;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 
@@ -1218,6 +1216,28 @@
    (t
     (error "Invalid object in Quail map: %s" def))))
 
+(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))))
+
 (defun quail-lookup-key (key &optional len)
   "Lookup KEY of length LEN in the current Quail map and return the definition.
 The returned value is a Quail map specific to KEY."
@@ -1236,7 +1256,9 @@
       (setq slot (assq ch (cdr map)))
       (if (and (cdr slot) (symbolp (cdr slot)))
 	  (setcdr slot (funcall (cdr slot) key idx)))
-      (setq map (cdr slot)))
+      (if (and (null slot) (eq ch ??))
+	  (setq map (apply 'quail-merge-maps (mapcar 'cdr (cdr map))))
+	(setq map (cdr slot))))
     (setq def (car map))
     (setq quail-current-translations nil)
     (if (and map (setq translation (quail-get-translation def key len)))

             reply	other threads:[~2003-05-18  5:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-18  5:23 Stefan Monnier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-14 20:03 a few MULE criticisms, cemacs, & current emacs segfaults by changes in GNU ld Hin-Tak Leung
2003-05-14 20:55 ` Jason Rumney
2003-05-14 22:05   ` a few MULE criticisms Hin-Tak Leung
2003-05-14 21:55 ` a few MULE criticisms, cemacs, & current emacs segfaults by changes in GNU ld Stefan Monnier
2003-05-15  2:03   ` a few MULE criticisms Hin-Tak Leung
2003-05-15  6:55     ` Jason Rumney
2003-05-15  1:18 ` a few MULE criticisms, cemacs, & current emacs segfaults by changes in GNU ld Kenichi Handa
2003-05-15  3:29   ` a few MULE criticisms Hin-Tak Leung
2003-05-15 10:06     ` Hin-Tak Leung
2003-05-15 15:51       ` Stephen J. Turnbull
2003-05-15 19:49         ` Hin-Tak Leung
2003-05-15 21:29           ` Kevin Rodgers
2003-05-16  7:09           ` Stephen J. Turnbull
2003-05-16 11:43             ` Hin-Tak Leung
2003-05-17  7:32               ` Stephen J. Turnbull
2003-05-17 19:40                 ` Hin-Tak Leung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200305180523.h4I5Nsj7008200@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.