>>>> "sjt" == Stephen J Turnbull
<stephen(a)xemacs.org> writes:
sjt> That says "for all entries in new, replace them as per the
sjt> lambda". It's not clear from the documentation whether a
sjt> chartab can have a partial domain or not.
Char-tables can have a partial domain; viz. `remove-char-table'.
It looks to me like map-char-table is intended to map over table
entries, and not over characters. (Remember in Mule there are about
30,000 characters; this can take a long time.) A char-table is not a
vector; there are different classes of entries, including, "all
characters" (overrides default), "charset", "row of charset"
(for
multibyte charsets) and "character".
Apparently the table default is not considered an entry.
sjt> My guess is that make-syntax-table is failing to initialize
sjt> the CHARTAB_RANGE_ALL (in Lisp, `t') range to whatever a
sjt> syntax value defaults to.
Yup. It initializes the default. I'll change the documentation for
map-char-table to reflect this for now. I think this is probably
appropriate behavior, but we can discuss it.
Try this patch (tested on merging standard-syntax-table into an empty
syntax table, but not in context):
Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.514
diff -u -U0 -r1.514 ChangeLog
--- lisp/ChangeLog 6 Jul 2003 18:12:33 -0000 1.514
+++ lisp/ChangeLog 17 Jul 2003 16:27:00 -0000
@@ -0,0 +1,5 @@
+2003-07-18 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * derived.el (derived-mode-merge-syntax-tables): Reverse map
+ logic. Fixes "do-nothing" bug.
+
Index: lisp/derived.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/derived.el,v
retrieving revision 1.6
diff -u -r1.6 derived.el
--- lisp/derived.el 8 Jul 2002 08:21:52 -0000 1.6
+++ lisp/derived.el 17 Jul 2003 16:27:07 -0000
@@ -342,12 +342,20 @@
;; check for inheritance.
(map-char-table
#'(lambda (key value)
- (if (eq ?@ (char-syntax-from-code value))
- (map-char-table #'(lambda (key1 value1)
- (put-char-table key1 value1 new))
- old
- key)))
- new)
+ (let ((newval (get-char-table key new 'multi)))
+ (cond ((eq newval 'multi) ; OK, dive into the class hierarchy
+ (map-char-table
+ #'(lambda (key1 value1)
+ (when (eq ?@ (char-syntax-from-code
+ (get-range-char-table key new ?@)))
+ (put-char-table key1 value new))
+ nil)
+ new
+ key))
+ ((eq ?@ (char-syntax-from-code newval)) ;; class at once
+ (put-char-table key value new))))
+ nil)
+ old)
;; pre-20.0
(let ((idx 0)
(end (min (length new) (length old))))
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.