Document adding package dependency on Emacs version

* doc/lispref/package.texi (Simple Packages, Multi-file Packages):
Document how to make a package depend on a specific version of Emacs.
This commit is contained in:
Stefan Kangas 2024-07-05 13:58:07 +02:00
parent d190cb0e88
commit cefec59df7

View file

@ -192,10 +192,11 @@ used as the long description. (When displaying the description, Emacs
omits the @samp{;;; Commentary:} line, as well as the leading comment omits the @samp{;;; Commentary:} line, as well as the leading comment
characters in the commentary itself.) characters in the commentary itself.)
If the file has a @samp{Package-Requires} header, that is used as If the file has a @samp{Package-Requires} header, that is used as the
the package dependencies. In the above example, the package depends package dependencies. In the above example, the package depends on the
on the @samp{flange} package, version 1.0 or higher. @xref{Library @samp{flange} package, version 1.0 or higher. @xref{Library Headers},
Headers}, for a description of the @samp{Package-Requires} header. If for a description of the @samp{Package-Requires} header. To depend on a
specific version of Emacs, specify @samp{emacs} as the package name. If
the header is omitted, the package has no dependencies. the header is omitted, the package has no dependencies.
The @samp{Keywords} and @samp{URL} headers are optional, but recommended. The @samp{Keywords} and @samp{URL} headers are optional, but recommended.
@ -247,9 +248,10 @@ is the brief description.
@var{requirements} is a list of required packages and their versions. @var{requirements} is a list of required packages and their versions.
Each element in this list should have the form @code{(@var{dep-name} Each element in this list should have the form @code{(@var{dep-name}
@var{dep-version})}, where @var{dep-name} is a symbol whose name is @var{dep-version})}, where @var{dep-name} is a symbol whose name is the
the dependency's package name, and @var{dep-version} is the dependency's package name, and @var{dep-version} is the dependency's
dependency's version (a string). version (a string). The spacial value @samp{emacs} means that the
package depends on the given version of Emacs.
@end defun @end defun
If the content directory contains a file named @file{README}, this If the content directory contains a file named @file{README}, this