GNU bug report logs - #79172
[PATCH] Add SPDX support to copyright.el

Previous Next

Package: emacs;

Reported by: Antero Mejr <mail <at> antr.me>

Date: Mon, 4 Aug 2025 21:38:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 79172 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79172; Package emacs. (Mon, 04 Aug 2025 21:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Antero Mejr <mail <at> antr.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 04 Aug 2025 21:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <mail <at> antr.me>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add SPDX support to copyright.el
Date: Mon, 04 Aug 2025 21:36:54 +0000
[Message part 1 (text/plain, inline)]
Tags: patch

This patch updates copyright.el to auto-insert SPDX- declarations. There
is one new user-facing command 'copyright-spdx' and a few new
customizable variables.

It also makes the 'copyright' command use 'comment-add' so that the
comment marker ;; is correct in Lisp modes, for both the SPDX and
default formats.

While working on this I also noticed the copyright skeletons in
autoinsert.el are inconsistent - they have an extra space relative to
those of copyright.el. IMO autoinsert.el should be adjusted to use the
copyright.el code instead of reimplementing it.



In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2025-05-04 built on pop-os
Repository revision: 159e3a981ed5482393182b036e38818d42405c90
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Pop!_OS 22.04 LTS

[0001-Add-SPDX-support-to-copyright.el.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79172; Package emacs. (Sat, 15 Nov 2025 04:15:01 GMT) Full text and rfc822 format available.

Message #8 received at 79172 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Antero Mejr <mail <at> antr.me>
Cc: 79172 <at> debbugs.gnu.org
Subject: Re: bug#79172: [PATCH] Add SPDX support to copyright.el
Date: Fri, 14 Nov 2025 23:14:47 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Plesae forgive the delay.  I just saw your email today.
This shows how far behind I am on a random fraction of my inbox.

  > This patch updates copyright.el to auto-insert SPDX- declarations. There
  > is one new user-facing command 'copyright-spdx' and a few new
  > customizable variables.

Could you please fill in the gap so I can tell precisely what this
command does?  Also, what are the scenarious of usage?

The issue is, where and when would people insert SPDX "declarations"?


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79172; Package emacs. (Sat, 15 Nov 2025 15:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 79172 <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <mail <at> antr.me>
To: Richard Stallman <rms <at> gnu.org>
Cc: 79172 <at> debbugs.gnu.org
Subject: Re: bug#79172: [PATCH] Add SPDX support to copyright.el
Date: Sat, 15 Nov 2025 15:04:17 +0000
Richard Stallman <rms <at> gnu.org> writes:

>   > This patch updates copyright.el to auto-insert SPDX- declarations. There
>   > is one new user-facing command 'copyright-spdx' and a few new
>   > customizable variables.
>
> Could you please fill in the gap so I can tell precisely what this
> command does?  Also, what are the scenarious of usage?
>
> The issue is, where and when would people insert SPDX "declarations"?

Programmers insert SPDX declarations to the top of each new code file.
Some projects use it instead of a copyright/warranty disclaimer header.
It's a machine-readable standard format for tools that need to detect
copyright info.

For example a GPLv3+ licensed Elisp file might have something like this
near the top:

;; SPDX-License-Identifier: GPL-3.0-or-later
;; SPDX-FileCopyrightText: Copyright 2025 Firstname Lastname

With the patch, the programmer could use "M-x copyright-spdx" along with
the existing "M-x copyright" command to insert those 2 comments if
copyright-spdx-enable is set to t. Projects can set
copyright-spdx-enable to t and copyright-spdx-default-license to a
string like "GPL-3.0-or-later" in their .dir-local file so that the
commands will always fill in the correct information.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79172; Package emacs. (Mon, 17 Nov 2025 04:03:01 GMT) Full text and rfc822 format available.

Message #14 received at 79172 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Antero Mejr <mail <at> antr.me>
Cc: 79172 <at> debbugs.gnu.org
Subject: Re: bug#79172: [PATCH] Add SPDX support to copyright.el
Date: Sun, 16 Nov 2025 23:02:02 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Programmers insert SPDX declarations to the top of each new code file.
  > Some projects use it instead of a copyright/warranty disclaimer header.

So it inserts something like this?

  > ;; SPDX-License-Identifier: GPL-3.0-or-later
  > ;; SPDX-FileCopyrightText: Copyright 2025 Firstname Lastname

I had a feeling that's what it meant.

To _add_ those two lines is ok -- they do no harm.  However, some
programs use those two lines _instead of_ our recommended license
notice.  That omits three important points:

    This file is part of GNU Emacs.

    GNU Emacs is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.

I'm concerned that the absence of statement of the warranty point is
asking for legal trouble.  Maybe also the one with the URL.

The short SPDX form of notice states this one point

    GNU Emacs is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or (at
    your option) any later version.

but only in a cryptic way.  That is a bad thing in terms of
communicating to the public about the GPL's purpose.

I will discuss all that with a lawyer soon.  In the mean time, please
don't do anything to encourage this cryptic way of stating something
very important.

So please don't install that command.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






This bug report was last modified 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.