emacs-elsa / Elsa

Emacs Lisp Static Analyzer and gradual type system.
GNU General Public License v3.0
646 stars 27 forks source link

Add feature to get target Emacs platform from Cask/pkg headers #53

Open Fuco1 opened 6 years ago

Fuco1 commented 6 years ago

If we are analyzing a project which uses Cask or has a -pkg file or the requires headers we should pick the emacs dependency version and warn if user uses functions not supported by that platform.

package-lint has a list of these by version: https://github.com/purcell/package-lint/blob/master/package-lint.el#L83

ebpa commented 5 years ago

IMO, It would be intrinsically useful to programmatically examine package dependencies (beyond just the declared emacs version).

Some fragments that might be useful to this end:

  • [ ] learn to find and read Cask
(locate-dominating-file default-directory cask-filename)
  • [ ] learn to find and read -pkg.el file
(with-current-buffer (find-file (package--description-file default-directory))
  (package--read-pkg-desc 'single))
  • [ ] learn to find and read the Package-requires: header
(package-desc-reqs (package-buffer-info))
;; OR
(lm-header "Package-Requires")

Edit: I've found the lisp-mnt.el functions extremely helpful.