Wrong type argument: (or eieio

Please help me with this. I am not sure if it is a duplicate question, but I couldn't find a discussion relevant to my scenario.

I am using Emacs 23 and cedet 1.0.1. When I configured auto-complete in my .emacs file I am getting this error whenever I am trying to open or save .c file from Emacs. It is hanging for a long time then throwing this error in *Messages* buffer. There is also a long sequence Saving file and Wrote lines in the buffer.

Please help me to solve this.

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]

EDIT : A new update on the issue

Accidentally I found the issue is not due to auto-complete. It is due to one Elisp function I wrote to apply Astyle of my C code before save. Here is the function and my c-mode-hook.

(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))))

If I uncomment the line (setq indent-region-function 'astyle-this-buffer) it is giving the above error on save. So what is the problem with the function astyle-this-buffer ? What I can remember is I have taken it from some post in stackoverflow.com.

链接地址: http://www.djcxy.com/p/62186.html

上一篇: Emacs Dired:`dired的奇怪行为

下一篇: 错误的类型参数:(或eieio