poem's char-or-char-int-p causes invalid character errors

Tatsuya Kinoshita tats @ vega.ocn.ne.jp
2005年 5月 3日 (火) 03:35:04 JST


Debianのapelパッケージ宛に下記のようなバグレポートをいただきました。

http://bugs.debian.org/307260:

| Package: apel
| Version: 10.6+0.20040418-1

| Emacs-ist for two years or so, I've often been disturbed by mysterious
| "Invalid character: 020031, 8217, 0x2019" errors while working.
| Especially, I wasn't able to use nnrss backend in Gnus, that fetches
| and converts RSS streams in Gnus articles.  Now I know what makes it
| fail:
| 
| /usr/share/emacs21/site-lisp/apel/poem.el:82:
| (defalias-maybe 'char-or-char-int-p 'integerp)

| char-or-char-int-p is always bound to integerp.  Gnus' nnrss.el uses
| Gnus' mm-util.el, in which char-or-char-int-p is used if it exists
| (char-valid-p otherwise).  But with APEL loaded, char-or-char-int-p
| isn't reliable anymore...

| I'm afraid other errors could occur with such defalias-maybe macros
| loaded from poem.el (characterp, ...).  Wouldn't it be possible to
| bind those predicates more precisely, or to prefix them with poem-?

どうやらGnusではchar-or-char-int-pで確認してからchar-to-stringを使う、
という使い方をしているようで、たとえば下記のコードで「Invalid
character」のエラーが起こります。

(let ((c 8217)) (char-to-string (if (char-or-char-int-p c) c 32)))

Gnus/lisp/mm-util.elのmm-char-or-char-int-pと同様に、apel/poem.elの
char-or-char-int-pでもchar-valid-pがあればそれを使うようにする方がい
いのでしょうか。また、characterp等についてはどうでしょうか。

-- 
木下達也





More information about the APEL-ja mailing list