emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
230 stars 17 forks source link

Eldev-format-message should accept nil values #57

Closed publicimageltd closed 3 years ago

publicimageltd commented 3 years ago

I had a test failing because Eldev raised a wrong type argument error. I found out that it is due to wrapping the code in question in a call to with-temp-message. This macro calls (message nil) if there had been no previous message to restore after executing body. (message nil) then produces a nil value (not a string value) which in turn is not accepted by eldev-format-message.

To reproduce, simply execute: eldev exec '(eldev-format-message nil), which raises a wrong type argument error. It should also accept a nil value.

doublep commented 3 years ago

I think it is fine for eldev-format-message to fail on nil, because e.g. format and format-message also fail. But the advises for message must not fail, of course. Will be fixed in 0.10. I also added a test for this.

publicimageltd commented 3 years ago

Ah okay, so it's the advise which is causing the error. Thanks a lot!

doublep commented 3 years ago

Fixed in 0.10. Thank you for reporting.