> Regarding tipa paired parenthesis bug in 21.5; "Stephen J.
Turnbull" <stephen(a)xemacs.org> adds:
Uwe Brauer writes:
AFAICT tipa is not a library in the XEmacs packages. Please post
the
code you are using so we know what we're working with here.
Sorry! Here comes the code in question is sort of complicated.
(defun tipa-self-insert-command (arg)
"Smart pairing. ARG is repeat count of character."
(interactive "*P")
(let* ((fid "tipa-self-insert-command: ")
(nbr (prefix-numeric-value arg))
(word-pair tipa-:automatic-word-pairing)
(ch last-command-char)
(elt (assoc ch tipa-:alist))
(pair-allow (if (fboundp tipa-:all-pairing-disabled-function)
(funcall tipa-:all-pairing-disabled-function)
t))
(pair nil) ;pair control
(status 1) ;see user configuration CHAR-FUNC
direction ;character looking at cmd
ch-func ;character function
ch-beg
ch-end
syntax-now
ch-now
)
(tipa-debug fid 'ARG arg 'CHAR (char-to-string ch) ch
'PAIR-ALLOW-FLAG pair-allow
'MODE major-mode
'ELT elt)
(cond
((null elt) ;Not defined for pairing
(self-insert-command nbr))
((null pair-allow)
(turn-off-tipa-mode)
(self-insert-command nbr))
(t
;; ... ... ... ... ... ... ... ... ... ... ... ... .. do pairing . .
(setq ch-beg (tipa-elt-beg elt))
(setq ch-end (tipa-elt-end elt))
(setq ch-func (tipa-elt-func elt))
(setq syntax-now (char-syntax (setq ch-now (following-char))))
(if (fboundp ch-func)
(setq status (funcall ch-func ch-beg ch-end)))
(tipa-debug fid "CH-NOW,END" (char-to-string ch-now)
(char-to-string ch-end)
"STAT, ch-func"
status ch-func
"SYNTAX-NOW" (char-to-string syntax-now)
)
(cond
((integerp status)
(setq direction
(cond
((integerp arg)
(if (> arg -1) nil 'back))
(t ;C-u forward
nil)))
(tipa-debug fid "direction" (or direction 'fwd)
"WORD-PAIR" word-pair)
(cond
;; ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
((char= ch-now ch-end) ;already pair visible
;; does user want to allow this pairing ?
;; is the end character in "allow" list"
(setq pair t)
(tipa-debug fid "now = End")
)
;; ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
((char= syntax-now ?\ ) ;whitespace at point
(setq pair t) ;ok, do pairing
(tipa-debug fid "Whitespace 1 1 t")
)
(word-pair
;; ... ... ... ... ... ... ... ... ... ... ... ... ... words ..
;; the default case
;; handle smart pairing.
(setq pair 'word)
)
(t
(tipa-debug fid "default word")
(setq arg 1 pair t)
)) ;main COND
;; ... ... ... ... ... ... ... ... ... ... ... insert chars ? ...
(tipa-debug fid "Doing... ARG; PAIR-flag" arg pair )
(cond
((eq pair 'word)
(tipa-word-pair arg ch-beg ch-end))
(pair
(tipa-word-pair nil ch-beg ch-end))
(t
(insert (ti::s-repeat nbr ch-beg))))
)
;; ... ... ... ... ... ... ... ... ... ... ... ... other status ..
((eq nil status)
(insert ch-beg))
((eq t status)
(insert ch-beg ch-end)
(backward-char 1))
((symbolp status)
nil
))))))
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta