aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2023-12-23 01:50:18 +0100
committerStefan Kangas2023-12-23 01:50:18 +0100
commite84493eae91f9d94902844ef6e8fb296bde72ca7 (patch)
tree7a5d396173d8043eb220f0fc55e6c4090f7b1ac2
parentbb5399e3cd75450db6db9b3c5829f7bd87ca1308 (diff)
downloademacs-e84493eae91f9d94902844ef6e8fb296bde72ca7.tar.gz
emacs-e84493eae91f9d94902844ef6e8fb296bde72ca7.zip
Drop footer line warning for packages requiring Emacs 30.1
The reason for warning about a missing footer line (";;; foo.el ends here") is that package.el up until version 27.1 would refuse to install a package without it. Emacs 27.1 or later will install such packages, but will issue a warning, the purpose of which is to encourage package authors not to break backwards-compatibility. However, if the minimum required Emacs version for a package is 30.1, we do not need to worry about compatibility with earlier versions of Emacs -- the package author has already explicitly said that the package will not work on earlier versions. For such packages, there is no need to warn about a missing footer line. In the future, this warning could be removed, but it is premature to do that now. (See Bug#26490.) Thus, for packages that does not specify a minimum version of Emacs, we continue to issue the warning. We will also continue to warn for packages requiring Emacs 27 to 29, since those versions will themselves warn if the footer is missing. * lisp/emacs-lisp/package.el (package-buffer-info): Don't warn if the footer line is missing for packages requiring Emacs 30.1 or later.
-rw-r--r--lisp/emacs-lisp/package.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 0e21f57fc3f..1434db3d1f4 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1173,8 +1173,14 @@ boundaries."
1173 ;; requirement for a "footer line" without unduly impacting users 1173 ;; requirement for a "footer line" without unduly impacting users
1174 ;; on earlier Emacs versions. See Bug#26490 for more details. 1174 ;; on earlier Emacs versions. See Bug#26490 for more details.
1175 (unless (search-forward (concat ";;; " file-name ".el ends here") nil 'move) 1175 (unless (search-forward (concat ";;; " file-name ".el ends here") nil 'move)
1176 (lwarn '(package package-format) :warning 1176 ;; Starting in Emacs 30.1, avoid warning if the minimum Emacs
1177 "Package lacks a terminating comment")) 1177 ;; version is specified as 30.1 or later.
1178 (let ((min-emacs (cadar (seq-filter (lambda (x) (eq (car x) 'emacs))
1179 (lm-package-requires)))))
1180 (when (or (null min-emacs)
1181 (version< min-emacs "30.1"))
1182 (lwarn '(package package-format) :warning
1183 "Package lacks a terminating comment"))))
1178 ;; Try to include a trailing newline. 1184 ;; Try to include a trailing newline.
1179 (forward-line) 1185 (forward-line)
1180 (narrow-to-region start (point)) 1186 (narrow-to-region start (point))