title: Wrong type argument: (or eieio-object-p class-p) semantic-bookmark-ring
body: <p>I am using <em>Emacs 23</em> and <em>cedet 1.0.1</em>.</p>
  <p>When I configured auto-complete in my .emacs file I am getting the error below 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 <code>Saving file &lt;file path&gt; and Wrote &lt;file path&gt;</code> lines in the buffer.</p>
  <blockquote>
  <p>if: Wrong type argument: (or eieio-object-p class-p), [object semantic-bookmark-ring &quot;Ring&quot; (0 3 . [[object semantic-bookmark &quot;ac-config-default&quot; (&quot;ac-config-default&quot; code nil nil [12669 12688]) nil 20 &quot;/home/santanu/.emacs&quot; 1 mark] [object semantic-bookmark &quot;main&quot; (&quot;main&quot; function (:arguments ((&quot;argc&quot; variable (:type &quot;int&quot;) (reparse-symbol arg-sub-list) #&lt;overlay from 1 to 1 in hello.c&gt;) (&quot;argv&quot; variable (:pointer 1 :dereference 1 :type &quot;char&quot;) (reparse-symbol arg-sub-list) #&lt;overlay from 1 to 1 in hello.c&gt;)) :type &quot;int&quot;) (unlink-copy-hook (semantic--tag-unlink-copy-secondary-overlays) link-hook (semantic--tag-link-secondary-overlays) secondary-overlays (#&lt;overlay from 1 to 1 in hello.c&gt; #&lt;overlay from 1 to 1 in hello.c&gt; #&lt;overlay from 1 to 1 in hello.c&gt;) unlink-hook (semantic--tag-unlink-secondary-overlays)) #&lt;overlay from 1 to 1 in hello.c&gt;) nil 0 &quot;/host/santanu/programming/c_projects/datastructures/src/main/hello.c&quot; 1 edit] [object semantic-bookmark &quot;stdio.h&quot; (&quot;stdio.h&quot; include (:system-flag t) (unlink-hook (semantic--tag-unlink-secondary-overlays) secondary-overlays (#&lt;overlay from 1 to 1 in hello.c&gt;) dependency-file &quot;/usr/include/stdio.h&quot; link-hook (semantic--tag-link-secondary-overlays) unlink-copy-hook (semantic--tag-unlink-copy-secondary-overlays) ...) #&lt;overlay from 1 to 1 in hello.c&gt;) nil 0 &quot;/host/santanu/programming/c_projects/datastructures/src/main/hello.c&quot; 1 mark] nil nil nil nil nil nil nil ...]) 0]
  To Remove Middle Tag: (main)
  Mark set
  To Remove Middle Tag: (main) [2 times]</p>
  </blockquote>
  <p><strong>EDIT</strong>: A new update on the issue</p>
  <p>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:</p>
  <pre><code>(defun astyle-this-buffer (pmin pmax)
    (interactive &quot;r&quot;)
    (shell-command-on-region pmin pmax
                             &quot;astyle&quot; ;; add options here...
                             (current-buffer) t 
                             (get-buffer-create &quot;*Astyle Errors*&quot;) t))
  
  (defun ansi-c-mode-hook ()
    &quot;turns off syntactic indentation and sets indent-region-function&quot;
    (setq c-syntactic-indentation nil)
    ;;(setq indent-region-function 'astyle-this-buffer)
    (setq compile-command &quot;bash cbuild.c&quot;)
    (setq enable-local-variables :all)
    (global-set-key (kbd &quot;C-c .te&quot;) '(lambda ()
                                        (interactive)
                                        (run-command 'test-command)))
    (global-set-key (kbd &quot;C-c .cs&quot;) '(lambda ()
                                        (interactive)
                                        (run-command 'check-code-style))))
  </code></pre>
  <p>If I uncomment the line <code>(setq indent-region-function 'astyle-this-buffer)</code> it is giving the above error on save. So what is the problem with the function <code>astyle-this-buffer</code>?</p>