> Regarding Re: tipa paired parenthesis bug in 21.5; "Stephen
J. Turnbull" <stephen(a)xemacs.org> adds:
Uwe Brauer writes:
> >> Regarding tipa paired parenthesis bug in 21.5; "Stephen
Debugger entered--Lisp error: (wrong-type-argument characterp nil)
char=(nil ?\))
tipa-word-pair(nil ?\( ?\))
tipa-self-insert-command(nil)
The problem is probably in tipa-word-pair.
Sorry for the mess,
I tried to debug tipa-word-pair myself
(the function is attached below)
The error seems to be in
(unless (char= (ti::b-read-char nil 1) ch-end)
However when I tried to debug that function I did not
understand the bug trace.
Please, if this is to messy don't waste your time I might
look for another pkg.
Uwe
(defun tipa-word-pair (arg ch-beg ch-end)
"Insert pair around word(s) ARG times using CH-BEG and CH-END."
(let* ((fid "tipa-word-pair: ")
(pos-flag tipa-:word-positioning)
(pos-func tipa-:word-positioning-function)
ch1 ch2
count
syntax-now syntax-prev
tmp
beg
)
(setq syntax-prev (char-syntax
(or (setq ch1 (or (preceding-char) ?\ ))
?\ )))
(setq syntax-now (char-syntax
(or (setq ch2 (or (following-char) ?\ ))
?\ )))
(tipa-debug fid
"arg" arg
"syntax now; prev"
(char-to-string syntax-now) (char-to-string syntax-prev)
"Is-word-class now" (tipa-word-class-p syntax-now)
"Is-word-class prev" (tipa-word-class-p syntax-prev)
"CH1" (char-to-string ch1) "CH2" (char-to-string ch2)
)
(cond
((and (or (null arg)
(integerp arg))
(tipa-word-class-p syntax-now)
(null (tipa-word-class-p syntax-prev)))
(setq count (if (null arg) 1 arg))
(if (< count 0) ;switch the values
(setq tmp ch-beg ch-beg ch-end ch-end tmp))
(tipa-debug fid "word" count)
(insert ch-beg)
(setq beg (point))
(tipa-move-logical-word count)
(unless (char= (ti::b-read-char nil 1) ch-end)
(insert ch-end))
)
((integerp arg)
(insert (ti::s-repeat arg ch-beg))
)
(t ;default case
(tipa-debug fid "default")
(insert ch-beg ch-end)
(backward-char 1)
(setq pos-flag nil)
))
;; ............................................ cursor positioning ...
(setq tmp nil) ;"status" of call
(and (fboundp pos-func)
(integerp beg)
(setq tmp (funcall pos-func beg ch-beg)))
(tipa-debug fid "cursor>>" beg (fboundp pos-func) tmp)
(cond
((not (null tmp)) ;function handled this.
nil)
((eq 'beg pos-flag)
(and (integerp beg)
(goto-char beg)))
(t
nil))
))
(defun ti::b-read-char (&optional direction distance)
"Read character towards the DIRECTION from current point:
nil = forward, non-nil backward. DISTANCE 0/nil means reading from
current position.
Return:
nbr ,read char value
nil ,if the position is not within `point-min-marker' and
`point-max-marker'."
(let* (
(beg (point-min-marker))
(end (point-max-marker))
(pos (or distance 0))
(dest (if direction (- (point) (1+ pos)) (+ (point) pos)))
(read (if (or (< dest beg) (> dest end)) nil t))
)
(if (null read) nil ;allowed to read ?
(char-after dest))
))
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta