summaryrefslogtreecommitdiffstats
path: root/emacs.d/lisp/magit/contrib
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-04-24 23:19:57 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2012-04-24 23:21:40 +0200
commit96f48ebd97c19384f487c8a9c4cf474705ce1e37 (patch)
treef042516a671b1bf8502ef46ed3040c5775168692 /emacs.d/lisp/magit/contrib
parentfc1c79470a57357da25aed54aa1a04471b343aff (diff)
downloaddotfiles-96f48ebd97c19384f487c8a9c4cf474705ce1e37.tar.gz
dotfiles-96f48ebd97c19384f487c8a9c4cf474705ce1e37.tar.xz
dotfiles-96f48ebd97c19384f487c8a9c4cf474705ce1e37.zip
emacs.d/lisp/magit: version bump
Diffstat (limited to 'emacs.d/lisp/magit/contrib')
-rwxr-xr-xemacs.d/lisp/magit/contrib/magit87
-rw-r--r--emacs.d/lisp/magit/contrib/magit-classic-theme.el57
-rw-r--r--emacs.d/lisp/magit/contrib/magit-simple-keys.el52
3 files changed, 196 insertions, 0 deletions
diff --git a/emacs.d/lisp/magit/contrib/magit b/emacs.d/lisp/magit/contrib/magit
new file mode 100755
index 0000000..5325571
--- /dev/null
+++ b/emacs.d/lisp/magit/contrib/magit
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+# Copyright (C) 2011 Peter J Weisberg.
+#
+# Magit 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, or (at your option)
+# any later version.
+#
+# Magit 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 Magit. If not, see <http://www.gnu.org/licenses/>.
+# ====================================================================
+
+if test "$1" = "-h" || test "$1" = "--help"; then
+ cat <<EOF
+Usage: magit [OPTION] [REPOSITORY]
+
+Open a Magit session in Emacs visiting the specified repository. If no
+repository is specified, and the current directory is a Git repository, use the
+current directory. Otherwise, magit-status will prompt for a repository to use.
+
+ -h, --help Print this text and exit
+ -e, --use-existing Use an existing Emacs frame instead of creating a new
+ one. Requires that Emacs be running in server mode with
+ at least one visible frame.
+
+If Emacs is running in server mode or if the ALTERNATE_EDITOR environment
+variable is the empty string, emacsclient will be used. Otherwise a new Emacs
+session will be started.
+EOF
+ exit 0;
+fi
+
+# Disable any ALTERNATE_EDITOR except the special blank value.
+[ -z "$ALTERNATE_EDITOR" ] || ALTERNATE_EDITOR=false
+
+useexisting=false
+if test "$1" = "-e" || test "$1" = "--use-existing"; then
+ useexisting=true
+ shift;
+fi
+
+if [ -n "$1" ]; then
+ dir=$(readlink -m "$1")
+fi
+
+runmagit="(progn "
+if [ -n "$dir" ]; then
+ runmagit="$runmagit (magit-status \"$dir\")"
+else
+ runmagit="$runmagit (let ((default-directory \"$(pwd)\"))
+ (call-interactively 'magit-status))"
+fi
+if ! $useexisting; then
+ #Don't steal the whole frame if we're using an existing one.
+ runmagit="$runmagit (delete-other-windows)"
+fi
+runmagit="$runmagit nil)"
+
+if $useexisting; then
+ emacsclient --eval "$runmagit"
+ exit
+fi
+
+xsupport=false
+if emacs -Q --batch --eval "(kill-emacs (if (featurep 'x) 0 1))"; then
+ xsupport=true
+fi
+
+if test -n "$DISPLAY" && $xsupport; then
+ emacsclient --eval "(progn (select-frame (make-frame-on-display \"$DISPLAY\"))
+ $runmagit)"
+ runemacs=$?
+else
+ emacsclient --tty --eval "$runmagit"
+ runemacs=$?
+fi
+
+if [ $runemacs != 0 ]; then
+ #Server not running or emacsclient not usable
+ emacs --eval "$runmagit"
+fi
diff --git a/emacs.d/lisp/magit/contrib/magit-classic-theme.el b/emacs.d/lisp/magit/contrib/magit-classic-theme.el
new file mode 100644
index 0000000..07c1f20
--- /dev/null
+++ b/emacs.d/lisp/magit/contrib/magit-classic-theme.el
@@ -0,0 +1,57 @@
+(deftheme magit-classic
+ "Old-style faces of Magit")
+
+(custom-theme-set-faces
+ 'magit-classic
+
+ '(magit-header
+ ((t)))
+
+ '(magit-section-title
+ ((t
+ :weight bold
+ :inherit magit-header)))
+
+ '(magit-branch
+ ((t
+ :weight bold
+ :inherit magit-header)))
+
+ '(magit-diff-file-header
+ ((t
+ :inherit magit-header)))
+
+ '(magit-diff-hunk-header
+ ((t
+ :slant italic
+ :inherit magit-header)))
+
+ '(magit-diff-add
+ ((((class color) (background light))
+ :foreground "blue1")
+ (((class color) (background dark))
+ :foreground "white")))
+
+ '(magit-diff-none
+ ((t)))
+
+ '(magit-diff-del
+ ((((class color) (background light))
+ :foreground "red")
+ (((class color) (background dark))
+ :foreground "OrangeRed")))
+
+ '(magit-item-highlight
+ ((((class color) (background light))
+ :background "gray95")
+ (((class color) (background dark))
+ :background "dim gray")))
+
+ '(magit-item-mark
+ ((((class color) (background light))
+ :foreground "red")
+ (((class color) (background dark))
+ :foreground "orange")))
+ )
+
+(provide-theme 'magit-classic) \ No newline at end of file
diff --git a/emacs.d/lisp/magit/contrib/magit-simple-keys.el b/emacs.d/lisp/magit/contrib/magit-simple-keys.el
new file mode 100644
index 0000000..fec3f6c
--- /dev/null
+++ b/emacs.d/lisp/magit/contrib/magit-simple-keys.el
@@ -0,0 +1,52 @@
+;;; magit-simple-keys.el --- simple keybindings for Magit
+
+;; Copyright (C) 2011 Ramkumar Ramachandra
+;;
+;; Magit 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, or (at your option)
+;; any later version.
+;;
+;; Magit 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 Magit. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This plug-in overrides the keybindings in magit-key-mode with
+;; simpler keybindings; it does this by picking the most obviously
+;; used command in each key group
+
+;;; Code:
+
+(require 'magit)
+
+(defvar magit-key-mode-mapping
+ '((logging magit-display-log)
+ (running magit-shell-command)
+ (fetching magit-fetch-current)
+ (pushing magit-push)
+ (pulling magit-pull)
+ (branching magit-checkout)
+ (tagging magit-tag)
+ (stashing magit-stash)
+ (merging magit-merge)
+ (submodule magit-submodule-update)))
+
+(defun magit-simple-keys-key-mode-generate (term mapping-function)
+ "Generate alias for the key-group term"
+ (eval
+ `(defalias ',(intern (concat "magit-key-mode-popup-" (symbol-name term)))
+ mapping-function)))
+
+;; generate the aliases using the mapping in key-mode-mapping
+(mapc (lambda (g)
+ (magit-simple-keys-key-mode-generate (car g) (cadr g)))
+ magit-key-mode-mapping)
+
+(provide 'magit-simple-keys)
+;;; magit-simple-keys.el ends here