guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: etc: Add copyright.


From: guix-commits
Subject: branch master updated: etc: Add copyright.
Date: Sat, 22 Feb 2020 09:57:01 -0500

This is an automated email from the git hooks/post-receive script.

wigust pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 9a39711  etc: Add copyright.
9a39711 is described below

commit 9a3971143854bf877c0739fc8fdf7b945a2e3935
Author: Oleg Pykhalov <address@hidden>
AuthorDate: Sat Feb 22 17:54:25 2020 +0300

    etc: Add copyright.
    
    * etc/copyright.el: New file.
    * doc/contributing.texi (The Perfect Setup): Document this.
---
 doc/contributing.texi | 27 +++++++++++++++++++++++++++
 etc/copyright.el      | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/doc/contributing.texi b/doc/contributing.texi
index a0d0925..9d45bec 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -274,6 +274,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.
 
+@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 "Alice Doe")
+(setq user-mail-address "alice@@mail.org")
+;; @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.
 
 @node Packaging Guidelines
 @section Packaging Guidelines
diff --git a/etc/copyright.el b/etc/copyright.el
new file mode 100644
index 0000000..f5ed723
--- /dev/null
+++ b/etc/copyright.el
@@ -0,0 +1,34 @@
+;;; copyright.el --- Insert a Guix copyright.
+
+;; Copyright © 2020 Oleg Pykhalov <address@hidden>
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This package provides skeleton to insert a copyright with `guix-copyright'.
+
+;;; Code:
+
+(define-skeleton guix-copyright
+  "Insert a copyright by $USER notice at cursor."
+  "FULL_NAME <MAIL_ADDRESS>: "
+  comment-start
+  ";; Copyright © " `(format-time-string "%Y") " "
+  (or (format "%s <%s>" user-full-name user-mail-address) str)
+  comment-end)
+
+;;; copyright.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]