From: Stefan Kangas Date: Tue, 11 Feb 2025 03:46:52 +0000 (+0100) Subject: Don't warn for packages without a footer line X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0ef6e493727dd7351cd27ea04842250ebd5d4fed;p=emacs.git Don't warn for packages without a footer line * lisp/emacs-lisp/package.el (package-buffer-info): Don't warn when the terminating comment (i.e., the footer line) is missing. (Bug#26490) (cherry picked from commit 5b34dbf4003a96c1b48e4981eedf2ed7abe43849) --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7981e328e2e..788735347b8 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1172,7 +1172,6 @@ Signal an error if the entire string was not used." (declare-function lm-keywords-list "lisp-mnt" (&optional file)) (declare-function lm-maintainers "lisp-mnt" (&optional file)) (declare-function lm-authors "lisp-mnt" (&optional file)) -(declare-function lm-package-needs-footer-line "lisp-mnt" (&optional file)) (defun package-buffer-info () "Return a `package-desc' describing the package in the current buffer. @@ -1184,20 +1183,8 @@ boundaries." (unless (re-search-forward "^;;; \\([^ ]*\\)\\.el ---[ \t]*\\(.*?\\)[ \t]*\\(-\\*-.*-\\*-[ \t]*\\)?$" nil t) (error "Package lacks a file header")) (let ((file-name (match-string-no-properties 1)) - (desc (match-string-no-properties 2)) - (start (line-beginning-position))) + (desc (match-string-no-properties 2))) (require 'lisp-mnt) - ;; This warning was added in Emacs 27.1, and should be removed at - ;; the earliest in version 31.1. The idea is to phase out the - ;; requirement for a "footer line" without unduly impacting users - ;; on earlier Emacs versions. See Bug#26490 for more details. - (unless (search-forward (concat ";;; " file-name ".el ends here") nil 'move) - (when (lm-package-needs-footer-line) - (lwarn '(package package-format) :warning - "Package lacks a terminating comment"))) - ;; Try to include a trailing newline. - (forward-line) - (narrow-to-region start (point)) ;; Use some headers we've invented to drive the process. (let* (;; Prefer Package-Version; if defined, the package author ;; probably wants us to use it. Otherwise try Version. @@ -1207,9 +1194,9 @@ boundaries." (keywords (lm-keywords-list)) (website (lm-website))) (unless pkg-version - (if version-info - (error "Unrecognized package version: %s" version-info) - (error "Package lacks a \"Version\" or \"Package-Version\" header"))) + (if version-info + (error "Unrecognized package version: %s" version-info) + (error "Package lacks a \"Version\" or \"Package-Version\" header"))) (package-desc-from-define file-name pkg-version desc (lm-package-requires)