diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2025-02-11 06:10:39 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2025-02-11 08:42:24 +0100 |
commit | e6a2256c8b7357f9654a566e31647316f44780c3 (patch) | |
tree | 732952127a2dc7a8eb4cc8cd6a98825313928b19 /lisp/emacs-lisp/lisp-mnt.el | |
parent | 5b34dbf4003a96c1b48e4981eedf2ed7abe43849 (diff) | |
download | emacs-e6a2256c8b7357f9654a566e31647316f44780c3.tar.gz emacs-e6a2256c8b7357f9654a566e31647316f44780c3.tar.bz2 emacs-e6a2256c8b7357f9654a566e31647316f44780c3.zip |
Add new function lm-package-version
* lisp/emacs-lisp/lisp-mnt.el (lm-package-version): New function.
* lisp/emacs-lisp/package.el (package-buffer-info)
(package-get-version): Use above new function.
(lm-package-version): Declare.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mnt.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mnt.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 6b50bee6fbb..daa20cb29cf 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -468,6 +468,13 @@ package version (a string)." (lm--prepare-package-dependencies (package-read-from-string (mapconcat #'identity require-lines " ")))))) +(defun lm-package-version (&optional file) + "Return \"Package-Version\" or \"Version\" header. +Prefer Package-Version; if defined, the package author +probably wants us to use it. Otherwise try Version." + (lm-with-file file + (or (lm-header "package-version") (lm-header "version")))) + (defun lm-package-needs-footer-line (&optional file) "Return non-nil if package in current buffer needs a footer line. |