Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit 1ee50f8

Browse files
committed
add new modes
1 parent fed91be commit 1ee50f8

21 files changed

+10189
-0
lines changed

init.el

+39
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
;;(setq-default indent-tabs-mode t)
2+
;;(setq tab-width 4)
3+
14
(setq-default indent-tabs-mode nil)
25
;;(setq-default tab-width 4)
36

7+
(setq-default menu-bar-mode nil)
8+
49
(setq-default c-basic-offset 4
510
tab-width 4
611
indent-tabs-mode t)
712

13+
;; Go away menu bar
14+
(menu-bar-mode -1)
15+
816
;; Enable Column Number
917
(setq column-number-mode t)
1018

@@ -15,6 +23,16 @@
1523
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
1624
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
1725

26+
(add-hook 'html-mode-hook
27+
(lambda()
28+
(setq sgml-basic-offset 4)
29+
(setq indent-tabs-mode t)))
30+
31+
(add-hook 'mustache-mode-hook
32+
(lambda()
33+
(setq sgml-basic-offset 4)
34+
(setq indent-tabs-mode t)))
35+
1836
;; InteractivelyDoThings (ido)
1937
(require 'ido)
2038
(ido-mode 1)
@@ -30,6 +48,14 @@
3048
(global-set-key (kbd "C-\\") 'er/expand-region)
3149
(global-set-key (kbd "M-\\") 'er/contract-region)
3250

51+
;;
52+
;; Mustache Mode
53+
;; =============
54+
;;
55+
56+
(add-to-list 'load-path "~/.emacs.d/mustache-mode")
57+
(require 'mustache-mode)
58+
3359
;;
3460
;; Ibuffer Mode
3561
;; ============
@@ -101,6 +127,8 @@
101127
;; =============
102128
;;
103129

130+
(add-to-list 'auto-mode-alist '("\\.tpl\\'" . html-mode))
131+
104132
;; Haml Mode
105133
(add-to-list 'load-path "~/.emacs.d/haml-mode")
106134
(add-to-list 'auto-mode-alist '("\\.haml\\'" . haml-mode))
@@ -122,6 +150,17 @@
122150
(add-to-list 'load-path "~/.emacs.d/php-mode/")
123151
(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode))
124152
(autoload 'php-mode "php-mode" "Mode for editing sass files" t)
153+
(add-hook 'php-mode-hook (lambda ()
154+
(defun ywb-php-lineup-arglist-intro (langelem)
155+
(save-excursion
156+
(goto-char (cdr langelem))
157+
(vector (+ (current-column) c-basic-offset))))
158+
(defun ywb-php-lineup-arglist-close (langelem)
159+
(save-excursion
160+
(goto-char (cdr langelem))
161+
(vector (current-column))))
162+
(c-set-offset 'arglist-intro 'ywb-php-lineup-arglist-intro)
163+
(c-set-offset 'arglist-close 'ywb-php-lineup-arglist-close)))
125164

126165
;; SCSS mode
127166
;; https://github.com/antonj/scss-mode

magit/50magit.el

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
;;; Autoloads for magit
2+
3+
(autoload 'magit-status "magit" nil t)

magit/Makefile

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
VERSION=1.1.1
2+
EMACS=emacs
3+
PREFIX=/usr/local
4+
SYSCONFDIR=/etc
5+
ELS=magit.el magit-svn.el magit-topgit.el magit-stgit.el magit-key-mode.el magit-bisect.el
6+
ELS_CONTRIB=contrib/magit-simple-keys.el contrib/magit-classic-theme.el
7+
ELCS=$(ELS:.el=.elc)
8+
ELCS_CONTRIB=$(ELS_CONTRIB:.el=.elc)
9+
DIST_FILES=$(ELS) Makefile magit.texi magit.info README.md magit.spec.in magit-pkg.el.in 50magit.el
10+
DIST_FILES_CONTRIB=$(ELS_CONTRIB) contrib/magit
11+
ELPA_FILES=$(ELS) magit.info magit-pkg.el
12+
13+
.PHONY=install
14+
15+
BATCH=$(EMACS) -batch -q -no-site-file -eval \
16+
"(setq load-path (cons (expand-file-name \".\") load-path))"
17+
18+
%.elc: %.el
19+
$(BATCH) --eval '(byte-compile-file "$<")'
20+
21+
all: core docs contrib
22+
23+
core: $(ELCS) magit.spec magit-pkg.el
24+
25+
docs: magit.info
26+
27+
contrib: $(ELCS_CONTRIB)
28+
29+
magit.spec: magit.spec.in
30+
sed -e s/@VERSION@/$(VERSION)/ < $< > $@
31+
32+
magit-pkg.el: magit-pkg.el.in
33+
sed -e s/@VERSION@/$(VERSION)/ < $< > $@
34+
35+
magit.elc: magit.el
36+
magit-key-mode.elc:
37+
magit-svn.elc:
38+
magit-topgit.elc:
39+
magit-stgit.elc:
40+
magit.info:
41+
42+
dist: magit-$(VERSION).tar.gz
43+
44+
magit-$(VERSION).tar.gz: $(DIST_FILES) $(DIST_FILES_CONTRIB)
45+
mkdir -p magit-$(VERSION)/contrib
46+
cp --preserve=timestamps $(DIST_FILES) magit-$(VERSION)
47+
cp --preserve=timestamps $(DIST_FILES_CONTRIB) magit-$(VERSION)/contrib
48+
tar -cvzf magit-$(VERSION).tar.gz magit-$(VERSION)
49+
rm -rf magit-$(VERSION)
50+
51+
elpa: magit-$(VERSION).tar
52+
53+
magit-$(VERSION).tar: $(ELPA_FILES)
54+
mkdir magit-$(VERSION)
55+
cp --preserve=timestamps $(ELPA_FILES) magit-$(VERSION)
56+
tar -cvf magit-$(VERSION).tar magit-$(VERSION)
57+
rm -rf magit-$(VERSION)
58+
59+
install: install_core install_docs
60+
61+
install_core: core
62+
mkdir -p $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
63+
install -m 644 $(ELS) $(ELCS) $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
64+
mkdir -p $(DESTDIR)$(SYSCONFDIR)/emacs/site-start.d
65+
install -m 644 50magit.el $(DESTDIR)$(SYSCONFDIR)/emacs/site-start.d/50magit.el
66+
67+
install_docs: docs
68+
mkdir -p $(DESTDIR)$(PREFIX)/share/info
69+
install -m 644 magit.info $(DESTDIR)$(PREFIX)/share/info
70+
install-info --info-dir=$(DESTDIR)$(PREFIX)/share/info $(DESTDIR)$(PREFIX)/share/info/magit.info
71+
72+
install_contrib: contrib
73+
mkdir -p $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
74+
install -m 644 $(ELS_CONTRIB) $(ELCS_CONTRIB) $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
75+
mkdir -p $(DESTDIR)$(PREFIX)/bin
76+
install -m 755 contrib/magit $(DESTDIR)$(PREFIX)/bin
77+
78+
install_all: install install_contrib
79+
80+
clean:
81+
rm -fr magit-pkg.el magit.spec $(ELCS) $(ELCS_CONTRIB) *.tar.gz magit-$(VERSION)

magit/README.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
It's Magit! An Emacs mode for Git.
2+
===================================
3+
4+
Magit is an interface to Git for Emacs, supporting GNU Emacs 22 or
5+
later.
6+
7+
Unlike Emacs's native [version control support][vc], Magit can take
8+
advantage of Git's native features without breaking compatibility with
9+
other systems.
10+
11+
To get started see the [Magit User Manual][manual] or perhaps the
12+
[cheatsheet][cheatsheet] if you're in a hurry. There's also an
13+
excellent [Magit screencast][screencast] by Alex Vollmer which
14+
demonstrates some of the major features.
15+
16+
Installing
17+
----------
18+
19+
Download the latest tarball from [the github download page][download],
20+
then Magit can be installed with the popular recipe of:
21+
22+
make && sudo make install
23+
24+
This requires `emacs` and `makeinfo` binaries, so please make sure the relevant
25+
packages (generally `emacs` and `texinfo`) are installed on your system.
26+
This will put magit.el into `/usr/local/share/emacs/site-lisp`, where
27+
Emacs should be able to find it. Then add
28+
29+
(require 'magit)
30+
31+
to your `.emacs` file.
32+
33+
Magit also now supports extensions:
34+
35+
### git-svn
36+
37+
`(require 'magit-svn)` - integrates with git-svn. Hit 'N' to see your
38+
options.
39+
40+
### git-topgit
41+
42+
`(require 'magit-topgit)` - integrates with topgit.
43+
44+
### git-stgit
45+
46+
`(require 'magit-stgit)` - integrates with StGit.
47+
48+
Getting started
49+
---------------
50+
51+
To get started with Magit, open any file in a Git repository in Emacs
52+
and run `M-x magit-status`. Read the short help for magit-mode (`C-h
53+
m` in the Magit buffer), make some changes to your files, and try to
54+
commit them.
55+
56+
Learning more
57+
-------------
58+
59+
The [Magit User Manual][manual] describes things with more words than
60+
the online help. You can read it in Emacs with `C-u C-h i
61+
magit.info`, or [on the web][manual].
62+
63+
If you have any questions, please use [the mailing list][google group]
64+
at Google Groups.
65+
66+
Magit's website is currently hosted [on GitHub][website].
67+
68+
Development
69+
-----------
70+
71+
Magit was started by Marius Vollmer. It is now collectively maintained by the
72+
Magit Owners Team: https://github.com/organizations/magit/teams/53130
73+
74+
For a full list of contributors have a look at `magit.el` in the
75+
source distribution.
76+
77+
Magit's canonical source repository is currently
78+
[hosted on GitHub][development].
79+
80+
[vc]: http://www.gnu.org/software/emacs/manual/html_node/emacs/Version-Control.html#Version-Control
81+
[website]: http://magit.github.com/magit
82+
[development]: http://github.com/magit/magit
83+
[manual]: http://magit.github.com/magit/magit.html
84+
[cheatsheet]: http://daemianmack.com/magit-cheatsheet.html
85+
[screencast]: http://vimeo.com/2871241
86+
[download]: http://github.com/magit/magit/downloads
87+
[google group]: http://groups.google.com/group/magit/

magit/contrib/magit

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/bin/sh
2+
3+
# Copyright (C) 2011 Peter J Weisberg.
4+
#
5+
# Magit is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
#
10+
# Magit is distributed in the hope that it will be useful, but WITHOUT
11+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12+
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13+
# License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with Magit. If not, see <http://www.gnu.org/licenses/>.
17+
# ====================================================================
18+
19+
if test "$1" = "-h" || test "$1" = "--help"; then
20+
cat <<EOF
21+
Usage: magit [OPTION] [REPOSITORY]
22+
23+
Open a Magit session in Emacs visiting the specified repository. If no
24+
repository is specified, and the current directory is a Git repository, use the
25+
current directory. Otherwise, magit-status will prompt for a repository to use.
26+
27+
-h, --help Print this text and exit
28+
-e, --use-existing Use an existing Emacs frame instead of creating a new
29+
one. Requires that Emacs be running in server mode with
30+
at least one visible frame.
31+
32+
If Emacs is running in server mode or if the ALTERNATE_EDITOR environment
33+
variable is the empty string, emacsclient will be used. Otherwise a new Emacs
34+
session will be started.
35+
EOF
36+
exit 0;
37+
fi
38+
39+
# Disable any ALTERNATE_EDITOR except the special blank value.
40+
[ -z "$ALTERNATE_EDITOR" ] || ALTERNATE_EDITOR=false
41+
42+
useexisting=false
43+
if test "$1" = "-e" || test "$1" = "--use-existing"; then
44+
useexisting=true
45+
shift;
46+
fi
47+
48+
if [ -n "$1" ]; then
49+
dir=$(readlink -m "$1")
50+
fi
51+
52+
runmagit="(progn "
53+
if [ -n "$dir" ]; then
54+
runmagit="$runmagit (magit-status \"$dir\")"
55+
else
56+
runmagit="$runmagit (let ((default-directory \"$(pwd)\"))
57+
(call-interactively 'magit-status))"
58+
fi
59+
if ! $useexisting; then
60+
#Don't steal the whole frame if we're using an existing one.
61+
runmagit="$runmagit (delete-other-windows)"
62+
fi
63+
runmagit="$runmagit nil)"
64+
65+
if $useexisting; then
66+
emacsclient --eval "$runmagit"
67+
exit
68+
fi
69+
70+
xsupport=false
71+
if emacs -Q --batch --eval "(kill-emacs (if (featurep 'x) 0 1))"; then
72+
xsupport=true
73+
fi
74+
75+
if test -n "$DISPLAY" && $xsupport; then
76+
emacsclient --eval "(progn (select-frame (make-frame-on-display \"$DISPLAY\"))
77+
$runmagit)"
78+
runemacs=$?
79+
else
80+
emacsclient --tty --eval "$runmagit"
81+
runemacs=$?
82+
fi
83+
84+
if [ $runemacs != 0 ]; then
85+
#Server not running or emacsclient not usable
86+
emacs --eval "$runmagit"
87+
fi

magit/contrib/magit-classic-theme.el

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
(deftheme magit-classic
2+
"Old-style faces of Magit")
3+
4+
(custom-theme-set-faces
5+
'magit-classic
6+
7+
'(magit-header
8+
((t)))
9+
10+
'(magit-section-title
11+
((t
12+
:weight bold
13+
:inherit magit-header)))
14+
15+
'(magit-branch
16+
((t
17+
:weight bold
18+
:inherit magit-header)))
19+
20+
'(magit-diff-file-header
21+
((t
22+
:inherit magit-header)))
23+
24+
'(magit-diff-hunk-header
25+
((t
26+
:slant italic
27+
:inherit magit-header)))
28+
29+
'(magit-diff-add
30+
((((class color) (background light))
31+
:foreground "blue1")
32+
(((class color) (background dark))
33+
:foreground "white")))
34+
35+
'(magit-diff-none
36+
((t)))
37+
38+
'(magit-diff-del
39+
((((class color) (background light))
40+
:foreground "red")
41+
(((class color) (background dark))
42+
:foreground "OrangeRed")))
43+
44+
'(magit-item-highlight
45+
((((class color) (background light))
46+
:background "gray95")
47+
(((class color) (background dark))
48+
:background "dim gray")))
49+
50+
'(magit-item-mark
51+
((((class color) (background light))
52+
:foreground "red")
53+
(((class color) (background dark))
54+
:foreground "orange")))
55+
)
56+
57+
(provide-theme 'magit-classic)

magit/contrib/magit-classic-theme.elc

1.62 KB
Binary file not shown.

0 commit comments

Comments
 (0)