emacs-elsa/Elsa

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

Opened this issue · 1 comments

Fuco1 commented

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

  • verify those lists are complete
  • learn to find and read Cask
  • learn to find and read -pkg.el file
  • learn to find and read the Package-requires: header
  • in case none of the above apply we should be able to specify (or override) the target in Elsafile.
ebpa commented

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.