3

次のように、emacs 23.1.1 を使用してcc モード 5.31.3をバイトコンパイルしようとしています。

$ emacs -batch --no-site-file -q -f batch-byte-compile *.el

しかし、2 つのファイルはコンパイルに失敗しています (多数の警告に加えて):

c-init-language-vars-for では:
cc-mode.el:168:10:警告: 実行時に呼び出される cl パッケージの関数 `mapcan'
cc-mode.el:168:10:警告: 実行時に呼び出される cl パッケージの関数 `mapcan'
cc-mode.el:162:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:162:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:163:53:警告: 実行時に呼び出される cl パッケージの関数 `mapcan'
cc-mode.el:163:53:警告: 実行時に呼び出される cl パッケージの関数 `mapcan'
cc-mode.el:164:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:164:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:165:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:165:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:166:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:166:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:167:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:167:53:警告: cl パッケージの関数 `mapcan' が実行時に呼び出されました
cc-mode.el:562:4:エラー: 間違った型引数: sequencep、t

c-make-styles-buffer-local:
cc-styles.el:634:6:警告: `mapcar' が効果を求めて呼び出されました。「mapc」または「dolist」を使用
    代わりは
cc-styles.el:636:9:エラー: 間違った型引数: sequencep、t

これら 2 つのエラーは何を意味し、どうすれば修正できますか?

cc-mode.el の 562 行目は次のとおりです。

  (c-update-modeline)

で定義された、引数を取らないc-update-modeline関数はどこにありますか。cc-cmds.elこの関数の cc-styles.el 部分の 636 行目:

(defun c-make-styles-buffer-local (&optional this-buf-only-p)
  "Make all CC Mode style variables buffer local.
If `this-buf-only-p' is non-nil, the style variables will be made
buffer local only in the current buffer.  Otherwise they'll be made
permanently buffer local in any buffer that changes their values.

The buffer localness of the style variables are normally controlled
with the variable `c-style-variables-are-local-p', so there's seldom
any reason to call this function directly."

  ;; style variables
  (let ((func (if this-buf-only-p
          'make-local-variable
        'make-variable-buffer-local))
    (varsyms (cons 'c-indentation-style (copy-alist c-style-variables))))
    (delq 'c-special-indent-hook varsyms)
    (mapcar func varsyms)
    ;; Hooks must be handled specially
    (if this-buf-only-p    ;;;;;;;;; LINE 636 ;;;;;;;;;;;;;;;;;;
        (make-local-hook 'c-special-indent-hook)
      (make-variable-buffer-local 'c-special-indent-hook)
      (setq c-style-variables-are-local-p t))
    ))

これらのエラー メッセージは意味がありません。emacs と一緒に別のバージョンの cc-mode をインストールしていることが、これに影響している可能性はありますか? cc-mode をどのように再コンパイルしますか?

4

2 に答える 2

5

エラーの意味は、関数が代わりにsequence受信を期待しているということです。tメッセージはt、述語を満たさないことを示していますsequencep

たとえば、評価(length t)してみると、次のように表示され*Backtrace*ます ( に設定debug-on-errorした場合t):

Debugger entered--Lisp error: (wrong-type-argument sequencep t)
  length(t)
  eval((length t) nil)

表示されるメッセージは、次によって生成されerror-message-stringます。

(condition-case e (length t)
  (error (error-message-string e)))
==> "Wrong type argument: sequencep, t"
于 2013-07-12T23:33:29.860 に答える
0

これらのエラーメッセージについてはまだ混乱していますが、答えは、cc-mode 5.31.3 はかなり古く、emacs 23 でコンパイルできないということです (好奇心のために cc-mode をコンパイルしようとしていました)。emacs 23 には、cc-mode の更新バージョン、バージョン 5.31.7 が同梱されています。対話型コマンドc-versionを実行して、使用している cc-mode のバージョンを取得します。

cc-mode を再コンパイルしたい (そしてcc-mode.elcemacs に同梱されているコンパイル済みを使用しない) 場合は、anonymous CVSから最新バージョンをダウンロードする必要があります。

于 2010-10-19T04:43:13.110 に答える