やるきなし

2023/09/18 11:20 / mmm-mode 0.5.9-1, Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

Debian GNU/Linux sid (unstable) で以下のように mmm-mode の問題で upgrade に失敗する.

Install mmm-mode for emacs
install/mmm-mode: Handling install of emacsen flavor emacs
install/mmm-mode: byte-compiling for emacs

In toplevel form:
mmm-auto.el:178:4: Error: Wrong number of arguments: (3 . 4), 2

In toplevel form:
mmm-class.el:36:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-cmds.el:36:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-cweb.el:35:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-defaults.el:37:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-erb.el:62:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-mason.el:36:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-mode.el:93:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-myghty.el:41:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-noweb.el:44:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-region.el:42:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-rpm.el:45:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-sample.el:38:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)

In toplevel form:
mmm-univ.el:35:2: Error: Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)
ERROR: install script from mmm-mode package failed
dpkg: error processing package mmm-mode (--configure):
 installed mmm-mode package post-installation script subprocess returned error exit status 1

原因は /usr/share/emacs/site-lisp/mmm-mode/mmm-auto.el の以下の箇所で define-obsolete-function-alias もマクロ展開に失敗している(XEmacs だった場合の引数の少ない方).

(if (not (string-match "XEmacs" (emacs-version)))
    (define-obsolete-function-alias 'mmm-add-find-file-hooks 'mmm-add-find-file-hook
      "0.3.8"
      "Both `mmm-add-find-file-hooks' and `mmm-add-find-file-hook' are deprecated.")
  (define-obsolete-function-alias 'mmm-add-find-file-hooks 'mmm-add-find-file-hook))

本家 git で https://github.com/dgutov/mmm-mode/issues/137 のとおり報告されていて,https://github.com/dgutov/mmm-mode/commit/244f8c4794f20a6be5ebe1e405400a9c35ea6d2f のとおり修正されているが,そもそもこの XEmacs サポートは Debian package 化する際に patch されており,該当 patch は https://sources.debian.org/src/mmm-mode/0.5.9-1/debian/patches/01-xemacs/ のとおり.

結局の所,XEmacs は手元で使っていないので,git にある https://raw.githubusercontent.com/dgutov/mmm-mode/master/mmm-auto.el で置き換えてしまえば問題ない(上記ブロックと mmm-add-find-file-hook 自体が削除される).

追記(2023/9/19)

mmm-mode: post-install script failsのとおりバグ報告がされており mmm-mode 0.5.9-2 で本件修正された様子.Conflicts: xemacs21 となって,XEmacs サポートは削除された.XEmacs なんか誰も使っていないので順当...

Related articles