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

守岡知彦 / MORIOKA Tomohiko tomo @ m17n.org
2005年 5月 3日 (火) 04:07:43 JST


守岡です。御無沙汰してます。

;; GW だというのに、3月末日締切のはずの原稿を書いてます。(;_;)

>>>>> In [apel-ja : No.01265] 
>>>>>	Tatsuya Kinoshita <tats @ vega.ocn.ne.jp> wrote:

> 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等についてはどうでしょうか。

実際に GNU Emacs 20 以降で試した訳ではないですが、char-or-char-int-p
も characterp も char-valid-p があればそれを使うようにするのが良いと思
います。

;; ちなみに、char-valid-p の登場は GNU Emacs 20.3 以降(*1) のようです
;; ね。

;; (*1) 半田さんが帰省中に RMS 先生の手で GNU Emacs が突如 character
;;      indexing 化された忌まわしき事件(*2) の後かと思ったら、その前だっ
;;	たんですね。
;; (*2) それから約2年弱 GNU Emacs 20 は不安定であり続けたなんてのもも
;;	う昔話ですね。

-- 
┯━…‥・懐かしい未来の記憶をふと思い出しかけた・‥…━━┯━━━┯━
││ ─ │  ─  /    ─   ┼─     ┬                ─   ─┼ ┬┴─
┼┼─┼|〓━─┼ 守岡 知彦 (MORIOKA Tomohiko) <tomo @ m17n.org> ─ ─┬
┻┻━┻━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━





More information about the APEL-ja mailing list