]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't warn for packages without a footer line
authorStefan Kangas <stefankangas@gmail.com>
Tue, 11 Feb 2025 03:46:52 +0000 (04:46 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Feb 2025 10:43:01 +0000 (11:43 +0100)
* 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)

lisp/emacs-lisp/package.el

index 7981e328e2ecef813c45f830f85f0a8bb7d367c1..788735347b8f2f40d88e754cdd880c1df9e993cb 100644 (file)
@@ -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)