Emacs 29 を Emacs 30 にバージョンアップしたら tamago が動かなくなった話
2025/3/14 夜、久々に pkg upgrade
を実行したら、Emacs が 29 系列から 30.1 に更新された。
それはいいのだが(?)、起動しようとしたらエラーを吐いた。
Warning (initialization): An error occurred while loading ‘/home/hogehoge/.emacs’:
Wrong type argument: obarrayp, [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]
上記に続いて「--debug-init
付きで起動して確認するがよいよ」と書かれていたのでその通りにしてみると、どうやらたまごが腐った様子。
バックトレースを見てみる
Debugger entered--Lisp error: (wrong-type-argument obarrayp [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...])
intern(" " [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ...])
(set (intern (char-to-string (car (car pair))) its-full-half-table) (cdr (car pair)))
(while pair (set (intern (char-to-string (car (car pair))) its-full-half-table) (cdr (car pair))) (set (intern (concat (symbol-name lang) (char-to-string (cdr (car pair)))) its-half-full-table) (car (car pair))) (setq pair (cdr pair)))
(while table (progn (setq lang (car (car table))) (setq pair (cdr (car table))) (setq table (cdr table))) (while pair (set (intern (char-to-string (car (car pair))) its-full-half-table) (cdr (car pair))) (set (intern (concat (symbol-name lang) (char-to-string (cdr (car pair)))) its-half-full-table) (car (car pair))) (setq pair (cdr pair))) hash)
(let ((table '((Japanese (12288 . 32) (65292 . 44) (65294 . 46) (12289 . 44) (12290 . 46) (65306 . 58) (65307 . 59) (65311 . 63) (65281 . 33) (180 . 39) (65344 . 96) (65342 . 94) (65343 . 95) (65507 . 126) (12540 . 45) (8212 . 45) (8208 . 45) (65295 . 47) (65340 . 92) (12316 . 126) (65372 . 124) (8216 . 96) (8217 . 39) (8220 . 34) (8221 . 34) (65288 . 40) (65289 . 41) (65339 . 91) (65341 . 93) (65371 . 123) (65373 . 125) (12296 . 60) (12297 . 62) (65291 . 43) (8722 . 45) (65309 . 61) (65308 . 60) (65310 . 62) (8242 . 39) (8243 . 34) (65509 . 92) (65284 . 36) (65285 . 37) (65283 . 35) (65286 . 38) (65290 . 42) (65312 . 64) (65296 . 48) (65297 . 49) ...) (Chinese-GB (12288 . 32) (65292 . 44) (65294 . 46) (12289 . 44) (12290 . 46) (65306 . 58) (65307 . 59) (65311 . 63) (65281 . 33) (65344 . 96) (65342 . 94) (65343 . 95) (65507 . 126) (8213 . 45) (65295 . 47) (65340 . 92) (65374 . 126) (65372 . 124) (8216 . 96) (8217 . 39) (8220 . 34) (8221 . 34) (65288 . 40) (65289 . 41) (65339 . 91) (65341 . 93) (65371 . 123) (65373 . 125) (65291 . 43) (65293 . 45) (65309 . 61) (65308 . 60) (65310 . 62) (65287 . 39) (65282 . 34) (65509 . 36) (65285 . 37) (65283 . 35) (65286 . 38) (65290 . 42) (65312 . 64) (65296 . 48) (65297 . 49) (65298 . 50) (65299 . 51) (65300 . 52) (65301 . 53) (65302 . 54) (65303 . 55) ...) (Chinese-CNS (12288 . 32) (65292 . 44) (65294 . 46) (12289 . 44) (12290 . 46) (65306 . 58) (65307 . 59) (65311 . 63) (65281 . 33) (8245 . 39) (8242 . 96) (65087 . 94) (65343 . 95) (8254 . 126) (65123 . 45) (65295 . 47) (65340 . 92) (8725 . 47) (65128 . 92) (8764 . 126) (65372 . 124) (8216 . 96) (8217 . 39) (12317 . 34) (12318 . 34) (8220 . 34) (8221 . 34) (65288 . 40) (65289 . 41) (12308 . 91) (12309 . 93) (65117 . 91) (65118 . 93) (65371 . 123) (65373 . 125) (65115 . 123) (65116 . 125) (12296 . 60) (12297 . 62) (65291 . 43) (65293 . 45) (65309 . 61) (65308 . 60) (65310 . 62) (65284 . 36) (65285 . 37) (65283 . 35) (65286 . 38) (65290 . 42) ...) (Korean (12288 . 32) (65292 . 44) (65294 . 46) (65306 . 58) (65307 . 59) (65311 . 63) (65281 . 33) (8217 . 39) (8216 . 96) (65342 . 94) (65343 . 95) (65507 . 126) (8213 . 45) (173 . 45) (65295 . 47) (65340 . 92) (8764 . 126) (65372 . 124) (8216 . 96) (8217 . 39) (8220 . 34) (8221 . 34) (65288 . 40) (65289 . 41) (65339 . 91) (65341 . 93) (65371 . 123) (65373 . 125) (12296 . 60) (12297 . 62) (65291 . 43) (65293 . 45) (65309 . 61) (65308 . 60) (65310 . 62) (65287 . 39) (65282 . 34) (65510 . 92) (65284 . 36) (65285 . 37) (65283 . 35) (65286 . 38) (65290 . 42) (65312 . 64) (65296 . 48) (65297 . 49) (65298 . 50) (65299 . 51) (65300 . 52) ...))) (hash (make-vector 100 nil)) lang pair) (while table (progn (setq lang (car (car table))) (setq pair (cdr (car table))) (setq table (cdr table))) (while pair (set (intern (char-to-string (car (car pair))) its-full-half-table) (cdr (car pair))) (set (intern (concat (symbol-name lang) (char-to-string (cdr ...))) its-half-full-table) (car (car pair))) (setq pair (cdr pair))) hash))
load-with-code-conversion("/usr/local/share/emacs/site-lisp/egg/its.el" "/usr/local/share/emacs/site-lisp/egg/its.el" nil t)
require(its)
load-with-code-conversion("/usr/local/share/emacs/site-lisp/egg/egg.el" "/usr/local/share/emacs/site-lisp/egg/egg.el" nil t)
require(egg)
load-with-code-conversion("/home/hogehoge/.emacs" "/home/hogehoge/.emacs" t t)
load("~/.emacs" noerror nomessage)
#f(compiled-function () #<bytecode 0x12e2a1544a0eae11>)()
#f(compiled-function () #<bytecode -0x4307d7bb01d2857>)()
handler-bind-1(#f(compiled-function () #<bytecode -0x4307d7bb01d2857>) (error) startup--debug)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x40089dd76f14943>) #f(compiled-function () #<bytecode 0x731968ef8c4909b>) t)
command-line()
normal-top-level()
調べてみると、ドンピシャの情報が見つかった。そのスレッドにある FreeBSD への PR に添付されているパッチ↓に従って /usr/local/share/emacs/site-lisp/egg/its.el
を書き換えたところ、無事に復旧した。やれやれ
。
パッチを見る
--- its.el
+++ its.el
@@ -695,7 +695,7 @@ This variable override `its-delete-by-keystroke'."
(defun its-map-compaction (map)
(if its-compaction-enable
- (let ((its-compaction-hash-table (make-vector 1000 nil))
+ (let ((its-compaction-hash-table (obarray-make 1000))
(its-compaction-integer-table (make-vector 138 nil))
(its-compaction-counter-1 1)
(its-compaction-counter-2 0)
@@ -1357,8 +1357,8 @@ Return last state."
(interactive)
(its-convert (lambda (str lang) (japanese-katakana str))))
-(defconst its-full-half-table (make-vector 100 nil))
-(defconst its-half-full-table (make-vector 100 nil))
+(defconst its-full-half-table (obarray-make 100))
+(defconst its-half-full-table (obarray-make 100))
(let ((table '((Japanese
(?$B!!(B . ?\ ) (?$B!$(B . ?,) (?$B!%(B . ?.) (?$B!"(B . ?,) (?$B!#(B . ?.)
@@ -1468,7 +1468,6 @@ Return last state."
(?$(C#p(B . ?p) (?$(C#q(B . ?q) (?$(C#r(B . ?r) (?$(C#s(B . ?s) (?$(C#t(B . ?t)
(?$(C#u(B . ?u) (?$(C#v(B . ?v) (?$(C#w(B . ?w) (?$(C#x(B . ?x) (?$(C#y(B . ?y)
(?$(C#z(B . ?z))))
- (hash (make-vector 100 nil))
lang pair)
(while table
(setq lang (caar table)
@@ -1480,8 +1479,7 @@ Return last state."
(set (intern (concat (symbol-name lang) (char-to-string (cdar pair)))
its-half-full-table)
(caar pair))
- (setq pair (cdr pair)))
- hash))
+ (setq pair (cdr pair)))))
;;; its-half-width : half-width-region for input-buffer
(defun its-half-width ()