错误的类型参数:(或eieio
请帮我解决一下这个。 我不确定这是否是重复问题,但我找不到与我的情况相关的讨论。
我使用Emacs 23和cedet 1.0.1。 当我在我的.emacs文件中配置自动完成功能时,每当我试图从Emacs打开或保存.c文件时,都会收到此错误。 它挂了很长时间,然后把这个错误放在* Messages *缓冲区中。 还有一个很长的序列将缓冲区中的文件和写入行保存起来。
请帮我解决这个问题。
if: Wrong type argument: (or eieio-object-p class-p), [object semantic-bookmark-ring "Ring" (0 3 . [[object semantic-bookmark "ac-config-default" ("ac-config-default" code nil nil [12669 12688]) nil 20 "/home/santanu/.emacs" 1 mark] [object semantic-bookmark "main" ("main" function (:arguments (("argc" variable (:type "int") (reparse-symbol arg-sub-list) #<overlay from 1 to 1 in hello.c>) ("argv" variable (:pointer 1 :dereference 1 :type "char") (reparse-symbol arg-sub-list) #<overlay from 1 to 1 in hello.c>)) :type "int") (unlink-copy-hook (semantic--tag-unlink-copy-secondary-overlays) link-hook (semantic--tag-link-secondary-overlays) secondary-overlays (#<overlay from 1 to 1 in hello.c> #<overlay from 1 to 1 in hello.c> #<overlay from 1 to 1 in hello.c>) unlink-hook (semantic--tag-unlink-secondary-overlays)) #<overlay from 1 to 1 in hello.c>) nil 0 "/host/santanu/programming/c_projects/datastructures/src/main/hello.c" 1 edit] [object semantic-bookmark "stdio.h" ("stdio.h" include (:system-flag t) (unlink-hook (semantic--tag-unlink-secondary-overlays) secondary-overlays (#<overlay from 1 to 1 in hello.c>) dependency-file "/usr/include/stdio.h" link-hook (semantic--tag-link-secondary-overlays) unlink-copy-hook (semantic--tag-unlink-copy-secondary-overlays) ...) #<overlay from 1 to 1 in hello.c>) nil 0 "/host/santanu/programming/c_projects/datastructures/src/main/hello.c" 1 mark] nil nil nil nil nil nil nil ...]) 0] To Remove Middle Tag: (main) Mark set To Remove Middle Tag: (main) [2 times]
编辑 :关于这个问题的新的更新
我偶然发现这个问题不是由于自动完成的。 这是因为我写了一个Elisp函数,用于在保存之前应用我的C代码的Astyle。 这里是函数和我的C-模式钩子。
(defun astyle-this-buffer (pmin pmax)
(interactive "r")
(shell-command-on-region pmin pmax
"astyle" ;; add options here...
(current-buffer) t
(get-buffer-create "*Astyle Errors*") t))
(defun ansi-c-mode-hook ()
"turns off syntactic indentation and sets indent-region-function"
(setq c-syntactic-indentation nil)
;;(setq indent-region-function 'astyle-this-buffer)
(setq compile-command "bash cbuild.c")
(setq enable-local-variables :all)
(global-set-key (kbd "C-c .te") '(lambda ()
(interactive)
(run-command 'test-command)))
(global-set-key (kbd "C-c .cs") '(lambda ()
(interactive)
(run-command 'check-code-style))))
如果我取消注释行(setq indent-region-function 'astyle-this-buffer)
它会在保存时发生上述错误。 那么函数astyle-this-buffer
什么问题? 我能记得的是我从stackoverflow.com的一些帖子中看到了它。