girzel / ebdb

An EIEIO port of BBDB, Emacs' contact-management package
67 stars 11 forks source link

problem on upgrade to 0.5.4 #71

Closed gmcninch closed 6 years ago

gmcninch commented 6 years ago

I just upgraded ebdb to 0.5.4 via emacs package manager. I then restarted emacs, and started gnus. Now if I try to compose a message (e.g. "m" from the group buffer), I get an error:

custom-initialize-reset: Invalid slot name: "#<ebdb-field-role ebdb-field-role-16c7aa4>", object-name

I'm not entirely sure why message/ebdb is looking at field-roles at this stage, but I note that I get the same sort of error if I enter a (partial) mail recipient in the "To:" field and press <tab>.

This problem doesn't occur with 0.5.3 (but since no one else has reported this, it makes me wonder if there isn't something flaky about my contacts data?).

-george

girzel commented 6 years ago

Oh dear. I had been subclassing an internal eieio class I wasn't supposed to, and in 0.5.4 changed the class structure, which meant renaming the "object-name" slot to "label". There's migration code to catch the old slot name and re-name it, but for some reason that code isn't doing its job in your case. I really don't know why.

Would you try this:

  1. Run (ebdb-shutdown)
  2. Find the file ebdb.el and go to line 1044, it should be an initialize-instance method.
  3. C-M-x on the method.
  4. Restart EBDB or search or otherwise get it to reload

If that doesn't fix the problem then I am well and truly stumped. If it does fix the problem, it means that there's something I don't understand about upgrading packages via the package manager (but implies that the problem is solvable).

Thanks!

gmcninch commented 6 years ago

Hi, thanks for the reply. Actually, the problem seems to have been my fault. I had written some "defmethods" for display of ebdb fields. I just commented that code out, restarted, and everything worked. I had "ruled that out" earlier, because I didn't think those methods would have been called. But I was evidently wrong...!

Looking more carefully, I had code for

(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter) (field ebdb-field-address) (_style (eql collapse)) (_record ebdb-record)) ...

and

(cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter-ebdb) (field ebdb-field-role) _style (record ebdb-record-person))

and I think that the point of my code was to include "multi-line" address information in the ebdb display.

I do note that at least the second of my defmethod's refers explicitly to

(slot-value field 'object-name)

Maybe it'll "just work" if I change that to 'label instead? I'll give it a shot...

Anyhow, sorry for the noise!

[edit: seems to work fine after replacing 'object-name with 'label ]

girzel commented 6 years ago

Excellent! Glad that wasn't my fault :) No guarantees about code structure stability until 1.0!

But I am glad that people are playing with this level of display code. It's an area that is still in flux. Do let me know if you have any requests/comments/confusions/ideas.