purcell / package-lint

A linting library for elisp package metadata
GNU General Public License v3.0
196 stars 34 forks source link

fboundp not suppressing error for function that was removed then re-added #240

Closed jackkamm closed 9 months ago

jackkamm commented 1 year ago

I have a problem where fboundp is not suppressing an error from package-lint, even when I think it should.

In particular, in org-caldav.el, package-lint currently returns the following error:

1355:7: error: `org-datetree-find-month-create' was removed in Emacs version 26.1.

Even though the call is wrapped in (if (fboundp 'org-datetree-find-month-create) ...), which I think should suppress that error.

It seems to be because org-datetree-find-month-create was removed, then added back, to org-mode. In particular, if we don't wrap in fboundp, package-lint reports an additional error:

2 issues found:

1340:21: error: You should depend on (emacs "27.2") if you need `org-datetree-find-month-create'.
1340:21: error: `org-datetree-find-month-create' was removed in Emacs version 26.1.

And wrapping in fboundp removes the first error, but not the second.

Is this a bug in package-lint? If not, what would be the right way for org-caldav to fix the issue?

purcell commented 9 months ago

I can't reproduce this now, so I think this is resolved.

jackkamm commented 9 months ago

I'm still able to reproduce this using emacs -Q and emacs29.2. Specifically:

  1. emacs -Q -L ~/.emacs.d/elpa/package-lint-20240214.1423/ ~/src/org-caldav/org-caldav.el
  2. M-: (require 'package-lint)
  3. M-x package-lint-current-buffer

Which gives the following:

2 issues found:

10:38: error: Package org is not installable.
1361:7: error: `org-datetree-find-month-create' was removed in Emacs version 26.1.
purcell commented 9 months ago

Thanks, I confirmed it and fixed both the tests and package-lint to resolve the issue.

purcell commented 9 months ago

(I don't know why I failed to reproduce the issue when I first tried, sorry about that.)

jackkamm commented 9 months ago

Can confirm the latest release on MELPA fixes the issue on my end. Thank you!