{"thread":{"id":"6718","subject":"[PATCH 1/2] git-blame: Add Emacs Lisp file headers and GNU GPL boilerplate","startedAt":"2007-02-07T12:56:42Z","lastAt":"2007-02-07T12:59:27Z","messageCount":2,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"33801","messageId":"200702071356.43020.jnareb@gmail.com","threadId":"6718","inReplyTo":null,"subject":"[PATCH 1/2] git-blame: Add Emacs Lisp file headers and GNU GPL boilerplate","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-07T12:56:42Z","receivedAt":"2007-02-07T12:56:42Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Add Emacs Lisp file headers, according to \"Coding Conventions\" chapter\nin Emacs Lisp Reference Manual and Elisp Area Convetions for\nEmacsWiki:\n  http://www.emacswiki.org/cgi-bin/wiki/ElispAreaConventions\nThose include: copyright notice, GNU GPL boilerplate, description and\ninstalation instructions as provided in email and in commit message\nintroducing git-blame.el, compatibility notes from another email by\nDavid Kågedal about what to change to use it in GNU Emacs 20, and\n\"git-blame ends here\" to detect if file was truncated.  First line\nincludes setting file encoding via first line local variable values\n(file variables).\n\nAdded comment to \"(require 'cl)\" to note why it is needed; \"Coding\nConventions\" advises to avoid require the `cl' package of Common Lisp\nextensions at run time.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nDavid Kågedal agreed on GPLv2 or later for git-blame.el\nin Message-ID: <87veifzkyg.fsf@morpheus.local>\n\nIf you have better idea for git-blame.el description, feel\nfree to correct it.\n\n contrib/emacs/git-blame.el |   73 ++++++++++++++++++++++++++++++++++++++++++--\n 1 files changed, 70 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex 62cf24c..cca0a77 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -1,8 +1,73 @@\n-;;; git-blame.el\n-;; David Kågedal <davidk@lysator.liu.se>\n+;;; git-blame.el --- Minor mode for incremental blame for Git  -*- coding: utf-8 -*-\n+;;\n+;; Copyright (C) 2007  David Kågedal\n+;;\n+;; Authors:    David Kågedal <davidk@lysator.liu.se>\n+;; Created:    31 Jan 2007\n ;; Message-ID: <87iren2vqx.fsf@morpheus.local>\n+;; License:    GPL\n+;; Keywords:   git, version control, release management\n+;;\n+;; Compatibility: Emacs21\n+\n+\n+;; This file is *NOT* part of GNU Emacs.\n+;; This file is distributed under the same terms as GNU Emacs.\n+\n+;; This program is free software; you can redistribute it and/or\n+;; modify it under the terms of the GNU General Public License as\n+;; published by the Free Software Foundation; either version 2 of\n+;; the License, or (at your option) any later version.\n+\n+;; This program is distributed in the hope that it will be\n+;; useful, but WITHOUT ANY WARRANTY; without even the implied\n+;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n+;; PURPOSE.  See the GNU General Public License for more details.\n+\n+;; You should have received a copy of the GNU General Public\n+;; License along with this program; if not, write to the Free\n+;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,\n+;; MA 02111-1307 USA\n+\n+;; http://www.fsf.org/copyleft/gpl.html\n+\n+\n+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n+;;\n+;;; Commentary:\n+;;\n+;; Here is an Emacs implementation of incremental git-blame.  When you\n+;; turn it on while viewing a file, the editor buffer will be updated by\n+;; setting the background of individual lines to a color that reflects\n+;; which commit it comes from.  And when you move around the buffer, a\n+;; one-line summary will be shown in the echo area.\n+\n+;;; Installation:\n+;;\n+;;  1) Load into emacs: M-x load-file RET git-blame.el RET\n+;;  2) Open a git-controlled file\n+;;  3) Blame: M-x git-blame-mode\n+\n+;;; Compatibility:\n+;;\n+;; It requires GNU Emacs 21.  If you'are using Emacs 20, try\n+;; changing this:\n+;;\n+;;            (overlay-put ovl 'face (list :background\n+;;                                         (cdr (assq 'color (cddddr info)))))\n+;;\n+;; to\n+;;\n+;;            (overlay-put ovl 'face (cons 'background-color\n+;;                                         (cdr (assq 'color (cddddr info)))))\n+\n+\n+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n+;;\n+;;; Code:\n+\n+(require 'cl)\t\t\t      ; to use `cddddr', `push', `pop'\n \n-(require 'cl)\n (defun color-scale (l)\n   (let* ((colors ())\n          r g b)\n@@ -178,3 +243,5 @@\n   (shell-command\n    (format \"git log -1 --pretty=oneline %s\" (or hash\n                                                 (git-blame-current-commit)))))\n+\n+;;; git-blame.el ends here\n-- \n1.4.4.4\n"},{"id":"33802","messageId":"200702071359.28100.jnareb@gmail.com","threadId":"6718","inReplyTo":"200702071356.43020.jnareb@gmail.com","subject":"[PATCH 2/2] git-blame: Change installation instructions","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-07T12:59:27Z","receivedAt":"2007-02-07T12:59:27Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Change installation instructions to using either \"(require 'git-blame)\"\nor appropriate autoload instruction in GNU Emacs init file, .emacs\nThis required adding \"(provide 'git-blame)\" at the end of git-blame.el\nand adding [preliminary] docstring to `git-blame-mode' function for\nconsistency (to mark function as interactive in `autoload' we have to\nprovide docstring as DOCSTRING is third arg, and INTERACTIVE fourth,\nand both are optional).  `git-blame-mode' is marked to autoload.\n\nWhile at it ensure that we add `git-blame-mode' to `minor-mode-alist'\nonly once (in a way that does not depend on `cl' package).\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n contrib/emacs/git-blame.el |   26 ++++++++++++++++++++++----\n 1 files changed, 22 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex cca0a77..7beeece 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -44,9 +44,20 @@\n \n ;;; Installation:\n ;;\n-;;  1) Load into emacs: M-x load-file RET git-blame.el RET\n-;;  2) Open a git-controlled file\n-;;  3) Blame: M-x git-blame-mode\n+;; To use this package, put it somewhere in `load-path' (or add\n+;; directory with git-blame.el to `load-path'), and add the following\n+;; line to your .emacs:\n+;;\n+;;    (require 'git-blame)\n+;;\n+;; If you do not want to load this package before it is necessary, you\n+;; can make use of the `autoload' feature, e.g. by adding to your .emacs\n+;; the following lines\n+;;\n+;;    (autoload 'git-blame-mode \"git-blame\"\n+;;              \"Minor mode for incremental blame for Git.\" t)\n+;;\n+;; Then first use of `M-x git-blame-mode' would load the package.\n \n ;;; Compatibility:\n ;;\n@@ -102,9 +113,14 @@\n \n (defvar git-blame-mode nil)\n (make-variable-buffer-local 'git-blame-mode)\n-(push (list 'git-blame-mode \" blame\") minor-mode-alist)\n+(unless (assq 'git-blame-mode minor-mode-alist)\n+  (setq minor-mode-alist\n+\t(cons (list 'git-blame-mode \" blame\")\n+\t      minor-mode-alist)))\n \n+;;;###autoload\n (defun git-blame-mode (&optional arg)\n+  \"Minor mode for incremental blame for Git.\"\n   (interactive \"P\")\n   (if arg\n       (setq git-blame-mode (eq arg 1))\n@@ -244,4 +260,6 @@\n    (format \"git log -1 --pretty=oneline %s\" (or hash\n                                                 (git-blame-current-commit)))))\n \n+(provide 'git-blame)\n+\n ;;; git-blame.el ends here\n-- \n1.4.4.4\n"}]}