Emacs 31.1 で mew-addrstr-parse-syntax-list1 が動作しなくなりそう

49 views
Skip to first unread message

Yoshiaki Kasahara

unread,
Sep 2, 2025, 4:23:32 AMSep 2
to mew...@googlegroups.com
笠原です。

現在 31.1 に向けて開発中の Emacs 31.0.50 で string mutation について制
限が厳しくなり、multibyte string への非 ASCII 文字の aset ができなくなっ
たため、mew-addrstr-parse-syntax-list1 で対象文字列に非ASCII文字が含ま
れていると "Attempt to store non-ASCII char into multibyte string" エ
ラーになるようになりました。以下は etc/NEWS の該当項目です。

* Incompatible Lisp Changes in Emacs 31.1
+++
** String mutation has been restricted further.
'aset' on unibyte strings now requires the new character to be a single
byte (0-255). On multibyte strings the new character and the character
being replaced must both be ASCII (0-127).

These rules ensure that mutation will never transform a unibyte string
to multibyte, and that the size of a string in bytes (as reported by
'string-bytes') never changes. They also allow strings to be
represented more efficiently in the future.

Other functions that use 'aset' to modify string data, such as
'subst-char-in-string' with a non-nil INPLACE argument, will signal an
error if called with arguments that would violate these rules.

do-copy で一文字ずつ tmp に aset している所だと思います。
自分は elisp 力が足りず修正できないので、報告のみですみません。
--
笠原 義晃

Kazu Yamamoto

unread,
Sep 2, 2025, 6:08:27 AMSep 2
to yka...@gmail.com, mew...@googlegroups.com
山本です。

> 現在 31.1 に向けて開発中の Emacs 31.0.50 で string mutation について制
> 限が厳しくなり、multibyte string への非 ASCII 文字の aset ができなくなっ
> たため、mew-addrstr-parse-syntax-list1 で対象文字列に非ASCII文字が含ま
> れていると "Attempt to store non-ASCII char into multibyte string" エ
> ラーになるようになりました。以下は etc/NEWS の該当項目です。

重い腰を上げて、Emacs 30.2 をインストールしました。
Emacs 30.2 で出る警告を無くしてから、31 を試してみます。

--かず


Kazu Yamamoto

unread,
Sep 3, 2025, 10:40:56 PMSep 3
to mew...@googlegroups.com
> 重い腰を上げて、Emacs 30.2 をインストールしました。
> Emacs 30.2 で出る警告を無くしてから、31 を試してみます。

Emacs 31 の aset 関数の仕様が意味不明ですが、文字列を直接 aset で変更
するのではなく、新たに「文字のリスト」を作成して、string で文字列に変
換する方法を思い付いたので、実装してみました。emacs-31 ブランチで試せ
ます。

ただ、aset は、他にもたくさん使われているので、他でもエラーが発生する
と思われます。

--かず


Yoshiaki Kasahara

unread,
Sep 4, 2025, 6:01:36 AMSep 4
to mew...@googlegroups.com
On Thu, 04 Sep 2025 11:40:47 +0900 (JST),
'Kazu Yamamoto' via Mew ユーザ <mew...@googlegroups.com> said:

>> 重い腰を上げて、Emacs 30.2 をインストールしました。
>> Emacs 30.2 で出る警告を無くしてから、31 を試してみます。
>
> Emacs 31 の aset 関数の仕様が意味不明ですが、文字列を直接 aset で変更
> するのではなく、新たに「文字のリスト」を作成して、string で文字列に変
> 換する方法を思い付いたので、実装してみました。emacs-31 ブランチで試せ
> ます。

ありがとうございます。とりあえず inc すらできないという状況は脱したの
で、これでしばらく暮らしてみます(このメールは emacs-31 ブランチで書い
ています)。

> ただ、aset は、他にもたくさん使われているので、他でもエラーが発生する
> と思われます。

とりあえず今の所大丈夫そうなのですが、何か気づいたらまたお知らせします。

--
笠原

Kazu Yamamoto

unread,
Sep 4, 2025, 9:37:12 PMSep 4
to mew...@googlegroups.com
> ありがとうございます。とりあえず inc すらできないという状況は脱したの
> で、これでしばらく暮らしてみます(このメールは emacs-31 ブランチで書い
> ています)。

master にマージしました。

> とりあえず今の所大丈夫そうなのですが、何か気づいたらまたお知らせします。

よろしくお願いします。

--かず


Yoshiaki Kasahara

unread,
Sep 7, 2025, 10:32:25 PMSep 7
to mew...@googlegroups.com
笠原です。

On Fri, 05 Sep 2025 10:37:06 +0900 (JST),
'Kazu Yamamoto' via Mew ユーザ <mew...@googlegroups.com> said:

>> とりあえず今の所大丈夫そうなのですが、何か気づいたらまたお知らせします。
>
> よろしくお願いします。

検索時に検索文字列に対して mew-remove-single-quote が呼ばれていて、日
本語文字で検索するとエラーになりました。

Debugger entered--Lisp error: (error "Attempt to store non-byte value into unibyte string")
mew-remove-single-quote("検索")
mew-pick-lex("検索")
mew-pick-canonicalize-pattern-est("検索")
mew-summary-selection-by-search(nil)
funcall-interactively(mew-summary-selection-by-search nil)
command-execute(mew-summary-selection-by-search)

Emacs 28 から string-replace という関数が使えるようなので、使える場合は

(string-replace "'" "" str)

でいいのではという気もしますが、どうでしょう。

また非ASCII文字を扱う事があるかわかりませんが、 mew-replace-character
も subst-char-in-string が使えるかもしれません。

--
笠原

Kazu Yamamoto

unread,
Sep 10, 2025, 1:19:10 AMSep 10
to mew...@googlegroups.com
> Emacs 28 から string-replace という関数が使えるようなので、使える場合は
>
> (string-replace "'" "" str)
>
> でいいのではという気もしますが、どうでしょう。
>
> また非ASCII文字を扱う事があるかわかりませんが、 mew-replace-character
> も subst-char-in-string が使えるかもしれません。

修正を master に commit したので、お試しください。

ちなみに、 overhaul-gnutls というブランチだと、起動時の警告が出なくな
ります。

--
山本和彦


Yoshiaki Kasahara

unread,
Sep 10, 2025, 6:52:50 AMSep 10
to mew...@googlegroups.com
On Wed, 10 Sep 2025 14:18:58 +0900 (JST),
'Kazu Yamamoto' via Mew ユーザ <mew...@googlegroups.com> said:

> 修正を master に commit したので、お試しください。

ありがとうございます。また何かあればお知らせします。

> ちなみに、 overhaul-gnutls というブランチだと、起動時の警告が出なくな
> ります。

tunnel のまま使っているからか見たことないのです。

笠原
Reply all
Reply to author
Forward
0 new messages