{"thread":{"id":"6749","subject":"[PATCH 2/7] git-blame: Change installation instructions","startedAt":"2007-02-09T08:19:59Z","lastAt":"2007-02-09T08:19:59Z","messageCount":1,"participants":["David Kågedal"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"34044","messageId":"87zm7npwsw.fsf@morpheus.local","threadId":"6749","inReplyTo":null,"subject":"[PATCH 2/7] git-blame: Change installation instructions","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-02-09T08:19:59Z","receivedAt":"2007-02-09T08:19:59Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Jakub Narebski <jnareb@gmail.com>\n\nChange 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 |   23 +++++++++++++++++++----\n 1 files changed, 19 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex ba9d8a6..56a548b 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,8 +113,12 @@\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   (interactive \"P\")\n   (if arg\n-- \n1.5.0.rc3.204.g93c76\n\n\n-- \nDavid Kågedal\n"}]}