パスワードを忘れた? アカウント作成
104318 journal

okkyの日記: Meadow 起動時にエラー??

日記 by okky

Loading c:/work/meadow/packages/pkginfo/jde/auto-autoloads.el (source)...
 
An error has occurred while loading `c:/cygwin/home/okuyama/.emacs':
 
Wrong number of arguments: #[(form val type)
(/. 本文に入れられない文字コードでえらーが出ているので中略)
 
#E))・・[type val res temp form cl-const-expr-p cl-make-type-test cl-const-expr-val cl-expr-contains (nil 1) cl-simple-expr-p make-symbol --cl-var-- let subst] 6], 2
 
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.
 
Loading semantic-el...done

3.01-r4258-1

はれ~~?? .emacs を読まないように --no-init-file つけて起動すると出ないのに、

% touch ~/.emacs

とやっただけでも出る…。

しかし、3.00に戻るのは悔しいのと、エラーが出ても結局動いてくれる (cd "~" してくれないけど)ので、無視して使うことにする。

-----

./lisp/emacs-lisp/cl-macs.elc の中でエラーを起こしているらしい。こいつを cl-macs.elc.orig に改名して Meadow を起動しなおす。てやーー

Loading c:/work/meadow/packages/pkginfo/jde/auto-autoloads.el (source)...
 
An error has occurred while loading `c:/cygwin/home/okuyama/.emacs':
 
Wrong number of arguments: (lambda (form val type) (block typep (if (cl-const-expr-p type) (let ((res (cl-make-type-test val (cl-const-expr-val type)))) (if (or (memq (cl-expr-contains res val) (quote (nil 1))) (cl-simple-expr-p val)) res (let ((temp (make-symbol --cl-var--))) (list (quote let) (list (list temp val)) (subst temp val res))))) form))), 2
 
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.
 
Loading semantic-el...done

ようやっとコードが出てきた。が、ぴったりこれに合うコードはない… --debug-init をつけて起動するか。そいやーーー

Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (form val type) (block typep (if (cl-const-expr-p type) (let ((res (cl-make-type-test val (cl-const-expr-val type)))) (if (or (memq (cl-expr-contains res val) (quote (nil 1))) (cl-simple-expr-p val)) res (let ((temp (make-symbol "--cl-var--"))) (list (quote let) (list (list temp val)) (subst temp val res))))) form))) 2)
  (lambda (form val type) (block typep (if ... ... form)))((typep item) item)
  apply((lambda (form val type) (block typep (if ... ... form))) (typep item) item)
  (setq form (apply handler form (cdr form)))
  (eq form (setq form (apply handler form ...)))
  (not (eq form (setq form ...)))
  (and handler (not (eq form ...)))
  (let ((func ...) (handler nil)) (while (and ... ... ... ...) (setq func ...)) (and handler (not ...)))
  (while (let (... ...) (while ... ...) (and handler ...)))
  compiler-macroexpand((typep item))
  byte-optimize-form-code-walker((typep item) nil)
  byte-optimize-form((typep item))
  mapcar(byte-optimize-form ("Tried to add an item of type %s to a list of items of type %s" (typep item) (oref this elem-type)))
  byte-optimize-form-code-walker((error "Tried to add an item of type %s to a list of items of type %s" (typep item) (oref this elem-type)) nil)
  byte-optimize-form((error "Tried to add an item of type %s to a list of items of type %s" (typep item) (oref this elem-type)) nil)
  byte-optimize-body(((error "Tried to add an item of type %s to a list of items of type %s" (typep item) (oref this elem-type))) nil)
  byte-optimize-form-code-walker((if (efc-coll-type-compatible-p this item) (oset this items (append ... ...)) (error "Tried to add an item of type %s to a list of items of type %s" (typep item) (oref this elem-type))) nil)
  byte-optimize-form((if (efc-coll-type-compatible-p this item) (oset this items (append ... ...)) (error "Tried to add an item of type %s to a list of items of type %s" (typep item) (oref this elem-type))) nil)
  byte-optimize-form-code-walker((progn (if (efc-coll-type-compatible-p this item) (oset this items ...) (error "Tried to add an item of type %s to a list of items of type %s" ... ...))) nil)
  byte-optimize-form((progn (if (efc-coll-type-compatible-p this item) (oset this items ...) (error "Tried to add an item of type %s to a list of items of type %s" ... ...))) nil)
  byte-compile-top-level((progn (if (efc-coll-type-compatible-p this item) (oset this items ...) (error "Tried to add an item of type %s to a list of items of type %s" ... ...))) nil lambda)
  byte-compile-lambda((lambda (this item) "Adds an item to the list." (if (efc-coll-type-compatible-p this item) (oset this items ...) (error "Tried to add an item of type %s to a list of items of type %s" ... ...))))
  byte-compile-function-form((function (lambda (this item) "Adds an item to the list." (if ... ... ...))))
  byte-compile-form((function (lambda (this item) "Adds an item to the list." (if ... ... ...))))
  mapc(byte-compile-form ((function (lambda ... "Adds an item to the list." ...)) local-args))
  byte-compile-normal-call((apply (function (lambda ... "Adds an item to the list." ...)) local-args))
  byte-compile-funarg((apply (quote (lambda ... "Adds an item to the list." ...)) local-args))
  byte-compile-form((apply (quote (lambda ... "Adds an item to the list." ...)) local-args) nil)
  byte-compile-body(((apply (quote ...) local-args)) nil)
  byte-compile-let((let ((scoped-class ...) (eieio-generic-call-next-method-list nil) (eieio-generic-call-key method-primary) (eieio-generic-call-methodname ...) (eieio-generic-call-arglst local-args)) (apply (quote ...) local-args)))
  byte-compile-form((let ((scoped-class ...) (eieio-generic-call-next-method-list nil) (eieio-generic-call-key method-primary) (eieio-generic-call-methodname ...) (eieio-generic-call-arglst local-args)) (apply (quote ...) local-args)) nil)
  byte-compile-body(((let (... ... ... ... ...) (apply ... local-args))) nil)
  byte-compile-if((if (not (child-of-class-p ... ...)) (apply (quote no-applicable-method) (car local-args) (quote efc-coll-add) local-args) (let (... ... ... ... ...) (apply ... local-args))))
  byte-compile-form((if (not (child-of-class-p ... ...)) (apply (quote no-applicable-method) (car local-args) (quote efc-coll-add) local-args) (let (... ... ... ... ...) (apply ... local-args))) nil)
  byte-compile-body(((if (not ...) (apply ... ... ... local-args) (let ... ...))) nil)
  byte-compile-if((if (not (condition-case nil ... ...)) (signal (quote no-method-definition) (list ... local-args)) (if (not ...) (apply ... ... ... local-args) (let ... ...))))
  byte-compile-form((if (not (condition-case nil ... ...)) (signal (quote no-method-definition) (list ... local-args)) (if (not ...) (apply ... ... ... local-args) (let ... ...))) nil)
  byte-compile-top-level((progn (if (not ...) (signal ... ...) (if ... ... ...))) nil lambda)
  byte-compile-lambda((lambda (&rest local-args) "Adds an item to the list." (if (not ...) (signal ... ...) (if ... ... ...))))
  eieio-defgeneric-form-primary-only-one(efc-coll-add "Adds an item to the list." efc-list (lambda (this item) "Adds an item to the list." (if (efc-coll-type-compatible-p this item) (oset this items ...) (error "Tried to add an item of type %s to a list of items of type %s" ... ...))))
  eieio-defmethod(efc-coll-add (((this efc-list) item) "Adds an item to the list." (if (efc-coll-type-compatible-p this item) (oset this items ...) (error "Tried to add an item of type %s to a list of items of type %s" ... ...))))
  (defmethod efc-coll-add ((this efc-list) item) "Adds an item to the list." (if (efc-coll-type-compatible-p this item) (oset this items ...) (error "Tried to add an item of type %s to a list of items of type %s" ... ...)))
  eval-buffer(#<buffer  *load*<3>> nil "c:/work/meadow/packages/lisp/jde/lisp/efc.el" nil t)  ; Reading at buffer position 23806
  load-with-code-conversion("c:/work/meadow/packages/lisp/jde/lisp/efc.el" "c:/work/meadow/packages/lisp/jde/lisp/efc.el" nil t)
  require(efc)

あー、なんかまず ./meadow/packages/lisp/jde/lisp/efc.el を見る必要があるのか… efc-coll-add を定義しているところは…なーーー2箇所あるーーー

Line 646

(defmethod efc-coll-add ((this efc-list) item)
  "Adds an item to the list."
  (if (efc-coll-type-compatible-p this item)
      (oset this items (append (oref this items) (list item)))
    (error "Tried to add an item of type %s to a list of items of type %s"
       (typep item) (oref this elem-type))))

Line 705

(defmethod efc-coll-add ((this efc-list-set) item)
  "Adds an item to a set only if the set does not
already contain the item."
  (if (efc-coll-memberp this item)
      (error "This set already contains %s" item)
    (call-next-method)))

ここはコメント "Adds an item to the list." から考えても Line 646 の方だね。なんかエラーの中に typep がどうとか言っているのでそれを調べる。

M-x describe-function
typep

typep is a Lisp function in `cl-macs.el'.
(typep object type)
 
Check that object is of type type.
type is a Common Lisp-style type specifier.

一方、上の定義だと

       (typep item) (oref this elem-type))))

typep の後ろに item しかない。

えーっと、この引数は「item の type を返して欲しい」んだよね?? でも typep は「item が指定された type かどうかを返す」んだよね?? そりゃ合ってないよね???

よし。じゃぁきっとグーグル様のご信託に何かアルに違いない。
http://www.google.co.jp/search?q=efc-coll-add+typep&lr=lang_ja&ie=utf-8&oe=utf-8&aq=t
とりあえず jdee のバグらしい。jdee を install 対象からはずしてみよう。

よーし。エラーは出なくなった。
とりあえず jdee はしばらく使わないからいいや。

.....

将来の課題 = おしえて emacs のエロい人:
    item の type 名を取り出すにはどうすればいいの?

当然ながら、パッチが出ているのでそこを見ると。
http://patches.ubuntu.com/by-release/extracted/ubuntu/j/jde/2.3.5.1-3/02_workaround_for_bytecompiling_efc.dpatch

;;                                                                            ;;
  ;; Iterator Class                                                             ;;
@@ -647,8 +657,25 @@
   "Adds an item to the list."
   (if (efc-coll-type-compatible-p this item)
       (oset this items (append (oref this items) (list item)))
-    (error "Tried to add an item of type %s to a list of items of type %s"
-       (typep item) (oref this elem-type))))
+    (error "efc-list error: tried to add an item of type %s to a list of items of type %s"
+       (if (object-p item)
+           (object-class item)
+         (type-of item))
+       (oref this elem-type))))

えらいややこしいなぁ… マクロにならんのかそれ…あちこちで使ってるだろうに。

.

まぁいいや。とりあえず好奇心は満たされた。Meadow のパッケージはそのうちバージョンが上がって直るだろう。

この議論は、okky (2487)によって ログインユーザだけとして作成されたが、今となっては 新たにコメントを付けることはできません。
typodupeerror

コンピュータは旧約聖書の神に似ている、規則は多く、慈悲は無い -- Joseph Campbell

読み込み中...