summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b52ba1a)
raw | patch | inline | side by side (parent: b52ba1a)
author | Jakub Narebski <jnareb@gmail.com> | |
Fri, 9 Feb 2007 08:19:59 +0000 (09:19 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 9 Feb 2007 08:52:52 +0000 (00:52 -0800) |
Change installation instructions to using either "(require 'git-blame)"
or appropriate autoload instruction in GNU Emacs init file, .emacs
This required adding "(provide 'git-blame)" at the end of git-blame.el
and adding [preliminary] docstring to `git-blame-mode' function for
consistency (to mark function as interactive in `autoload' we have to
provide docstring as DOCSTRING is third arg, and INTERACTIVE fourth,
and both are optional). `git-blame-mode' is marked to autoload.
While at it ensure that we add `git-blame-mode' to `minor-mode-alist'
only once (in a way that does not depend on `cl' package).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
or appropriate autoload instruction in GNU Emacs init file, .emacs
This required adding "(provide 'git-blame)" at the end of git-blame.el
and adding [preliminary] docstring to `git-blame-mode' function for
consistency (to mark function as interactive in `autoload' we have to
provide docstring as DOCSTRING is third arg, and INTERACTIVE fourth,
and both are optional). `git-blame-mode' is marked to autoload.
While at it ensure that we add `git-blame-mode' to `minor-mode-alist'
only once (in a way that does not depend on `cl' package).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/emacs/git-blame.el | patch | blob | history |
index ba9d8a6cdeb97b51082cbcf0b91ad09097876824..56a548b4a8aeb7e46b2958069ead2111809bc62c 100644 (file)
;;; Installation:
;;
-;; 1) Load into emacs: M-x load-file RET git-blame.el RET
-;; 2) Open a git-controlled file
-;; 3) Blame: M-x git-blame-mode
+;; To use this package, put it somewhere in `load-path' (or add
+;; directory with git-blame.el to `load-path'), and add the following
+;; line to your .emacs:
+;;
+;; (require 'git-blame)
+;;
+;; If you do not want to load this package before it is necessary, you
+;; can make use of the `autoload' feature, e.g. by adding to your .emacs
+;; the following lines
+;;
+;; (autoload 'git-blame-mode "git-blame"
+;; "Minor mode for incremental blame for Git." t)
+;;
+;; Then first use of `M-x git-blame-mode' would load the package.
;;; Compatibility:
;;
(defvar git-blame-mode nil)
(make-variable-buffer-local 'git-blame-mode)
-(push (list 'git-blame-mode " blame") minor-mode-alist)
+(unless (assq 'git-blame-mode minor-mode-alist)
+ (setq minor-mode-alist
+ (cons (list 'git-blame-mode " blame")
+ minor-mode-alist)))
+;;;###autoload
(defun git-blame-mode (&optional arg)
(interactive "P")
(if arg