From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Pykhalov Subject: [PATCH] etc: Add copyright. Date: Wed, 20 Dec 2017 17:40:20 +0300 Message-ID: <876091wjhn.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/x-patch; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRfY0-00020m-OM for guix-devel@gnu.org; Wed, 20 Dec 2017 09:40:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRfXw-0000st-A2 for guix-devel@gnu.org; Wed, 20 Dec 2017 09:40:40 -0500 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:41471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRfXw-0000qP-0f for guix-devel@gnu.org; Wed, 20 Dec 2017 09:40:36 -0500 Received: by mail-lf0-x236.google.com with SMTP id f18so24283927lfg.8 for ; Wed, 20 Dec 2017 06:40:35 -0800 (PST) Received: from magnolia ([178.71.224.245]) by smtp.gmail.com with ESMTPSA id q62sm3601515ljq.24.2017.12.20.06.40.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Dec 2017 06:40:33 -0800 (PST) Content-Disposition: inline; filename=0001-etc-Add-copyright.patch Content-Description: [PATCH] etc: Add copyright. List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org >From f8df6a8059878e9b61c7b211e854194c56c74efc Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Wed, 20 Dec 2017 16:57:37 +0300 Subject: [PATCH] etc: Add copyright. * etc/copyright.el: New file. * doc/contributing.texi (The Perfect Setup): Document copyright. --- doc/contributing.texi | 27 +++++++++++++++++++++++++++ etc/copyright.el | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 etc/copyright.el diff --git a/doc/contributing.texi b/doc/contributing.texi index 01f8aad9f..5b72b1c40 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -221,6 +221,33 @@ trigger string @code{origin...}, which can be expanded= further. The @code{origin} snippet in turn may insert other trigger strings ending on @code{...}, which also can be expanded further. =20 +@cindex insert or update copyright +@cindex @code{M-x guix-copyright} +@cindex @code{M-x copyright-update} +Additionaly we provide insertion and automatic update of a copyright in +@file{etc/copyright.el}. You may want to set your full name, mail, and +load a file. + +@lisp +(setq user-full-name "NAME") +(setq user-mail-address "EMAIL") +;; @r{Assuming the Guix checkout is in ~/src/guix.} +(load-file "~/src/guix/etc/copyright.el") +@end lisp + +To insert a copyright at the current line invoke @code{M-x guix-copyright}. + +To update a copyright you need to specify a @code{copyright-names-regexp}. + +@lisp +(setq copyright-names-regexp + (format "%s <%s>" user-full-name user-mail-address)) +@end lisp + +You can check if your copyright is up to date by evaluating @code{M-x +copyright-update}. If you want to do it automatically after each buffer +save then add @code{(add-hook 'after-save-hook 'copyright-update)} in +Emacs. =20 @node Coding Style @section Coding Style diff --git a/etc/copyright.el b/etc/copyright.el new file mode 100644 index 000000000..9f6b773b1 --- /dev/null +++ b/etc/copyright.el @@ -0,0 +1,34 @@ +;;; copyright.el --- Insert a Guix copyright. + +;; Copyright =C2=A9 2017 Oleg Pykhalov + +;; This file is part of GNU Guix. + +;; GNU Guix 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. + +;; GNU Guix 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 this program. If not, see . + +;;; Commentary: + +;; This package provides skeleton to insert a copyright with `guix-copyrig= ht'. + +;;; Code: + +(define-skeleton guix-copyright + "Insert a copyright by $USER notice at cursor." + "FULL_NAME : " + comment-start + ";; Copyright =C2=A9 " `(format-time-string "%Y") " " + (or (format "%s <%s>" user-full-name user-mail-address) str) + comment-end) + +;;; copyright.el ends here --=20 2.15.1