APPROVE COMMIT
NOTE: This patch has been committed.
mule-packages/leim/ChangeLog addition:
2006-06-03 Aidan Kehoe <kehoea(a)parhasard.net>
* quail.el (quail-define-rules):
* quail.el (quail-defrule):
Document in more detail what happens when a function symbol is
specified as the Quail translation for a key.
* quail.el (quail-show-translations):
Check that quail-overlay is an overlay before trying to move
it. Fixes an occasional "Wrong type argument: overlayp, nil"
message in XEmacs 21.5.
XEmacs Packages source patch:
Diff command: cvs -q diff -u
Files affected: mule-packages/leim/quail.el
Index: mule-packages/leim/quail.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/leim/quail.el,v
retrieving revision 1.6
diff -u -u -r1.6 quail.el
--- mule-packages/leim/quail.el 2003/06/30 12:36:25 1.6
+++ mule-packages/leim/quail.el 2006/06/03 06:51:37
@@ -808,9 +808,16 @@
If it is a vector, each element (string or character) is a candidate
for the translation.
In these cases, a key specific Quail map is generated and assigned to KEY.
+(A Quail map is a cons that satisfies `quail-map-p', which see.)
-If TRANSLATION is a Quail map or a function symbol which returns a Quail map,
- it is used to handle KEY."
+If TRANSLATION is a Quail map it is used to handle KEY.
+
+If TRANSLATION is a function symbol, that function should take two
+arguments, the input string and its length, and it should return a Quail map
+to be used to handle KEY. For each KEY that translates to the function,
+that function will be called just once, and the result cached by Quail--this
+means that some of the context-dependent processing you may be tempted to
+do, like manipulating unread-command-events, is not possible. "
`(quail-install-map
',(let ((l rules)
(map (list nil)))
@@ -844,9 +851,17 @@
variable `quail-current-data'). If the cdr part is not a function,
the value itself is assigned to `quail-current-data'.
In these cases, a key specific Quail map is generated and assigned to KEY.
+(A Quail map is a cons that satisfies `quail-map-p', which see.)
+
+If TRANSLATION is a Quail map it is used to handle KEY.
+
+If TRANSLATION is a function symbol, that function should take two
+arguments, the input string and its length. It should return a Quail map to
+be used to handle KEY. For each KEY that translates to the function, that
+function will be called just once, and the result cached by Quail--this
+means that some of the context-dependent processing you may be tempted to
+do, like manipulating `unread-command-events', is not possible.
-If TRANSLATION is a Quail map or a function symbol which returns a Quail map,
- it is used to handle KEY.
Optional argument NAME, if specified, says which Quail package
to define this translation rule in. The default is to define it in the
current Quail package."
@@ -1635,7 +1650,7 @@
(1+ (- idx start)))))
(let ((pos (point)))
(insert (aref (cdr quail-current-translations) idx))
- (if (= idx cur)
+ (if (and (overlayp quail-overlay) (= idx cur))
(move-overlay quail-overlay pos (point))))
(setq idx (1+ idx)))))
)))
--
Aidan Kehoe,
http://www.parhasard.net/