Recently I replaced pkg-info (a now abandoned package) with the following snippet in some of my packages:
(defconst cider-version
(eval-when-compile
(lm-version (or load-file-name buffer-file-name)))
"The current version of CIDER.")
The above snippet is from CIDER, but I've used this code in several places.
Basically I want to extract the package version from the Version: header instead of having to duplicate it. I know of package-get-package-version, but I assume it won't work for people who didn't install my packages via package.el.
Thanks in advance for your help!