From: Ramakrishnan Muthukrishnan Date: Sun, 28 Apr 2013 09:14:09 +0000 (+0530) Subject: use git submodules to manage extensions. WIP X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=ae53b28cb3ab5c01606f84695c38d3e1e6a20eca;p=.emacs.d.git use git submodules to manage extensions. WIP --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9a65b06 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,19 @@ +[submodule "vendor/clojure-mode"] + path = vendor/clojure-mode + url = git://github.com/technomancy/clojure-mode.git + +[submodule "vendor/slime"] + path = vendor/slime + url = https://github.com/antifuchs/slime.git +[submodule "vendor/ac-slime"] + path = vendor/ac-slime + url = https://github.com/purcell/ac-slime.git +[submodule "vendor/auto-complete"] + path = vendor/auto-complete + url = https://github.com/auto-complete/auto-complete +[submodule "vendor/popup"] + path = vendor/popup + url = https://github.com/auto-complete/popup-el.git +[submodule "vendor/company-mode"] + path = vendor/company-mode + url = https://github.com/company-mode/company-mode.git diff --git a/init.el b/init.el index 90160e6..3c620b7 100644 --- a/init.el +++ b/init.el @@ -1,112 +1,37 @@ (setq load-path (cons "~/.emacs.d/emacs" load-path)) -(load "my-c-mode.el") -(load "my-generic-stuff.el") -(load "my-search.el") - ;; color themes (add-to-list 'custom-theme-load-path "~/.emacs.d/themes") (load-theme 'zenburn t) -;; setup font +(require 'package) +(package-initialize) + +(load "my-c-mode.el") +(load "my-generic-stuff.el") +(load "my-search.el") +(load "my-erc.el") +(load "my-org-mode.el") +(load "my-slime.el") +(load "my-twitter.el") +(load "my-python.el") +;; setup font (if (>= emacs-major-version 23) (setq default-frame-alist '((font . "Inconsolata-12"))) (set-default-font "-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1")) -;; (set-default-font "-unknown-Inconsolata-normal-normal-normal-*-16-*-*-*-m-8-iso10646-1") - (setq-default indent-tabs-mode nil) - (add-hook 'emacs-lisp-mode-hook (lambda () (which-function-mode t))) -;;; erc -(require 'erc) - -;; Load authentication info from an external source. Put sensitive -;; passwords and the like in here. -(load "~/.emacs.d/emacs/.erc-auth") - -(require 'erc-services) -(require 'erc-match) -(erc-services-mode 1) - -(setq erc-prompt-for-nickserv-password nil) - -(setq erc-nickserv-passwords - `((freenode (("vu3rdd" . ,freenode-nick-pass))) - (debian (("vu3rdd" . ,debian-nick-pass))))) - -(setq erc-autojoin-channels-alist - '((".*\\.freenode.net" "#racket" "#haskell") - (".*\\.oftc.net" "#debian-arm" "#debian" "#debian-devel"))) - -(global-set-key "\C-cef" (lambda () (interactive) - (erc :server "irc.freenode.net" :port "8000" - :nick "vu3rdd"))) -(global-set-key "\C-ced" (lambda () (interactive) - (erc :server "irc.debian.org" :port "6668" - :nick "vu3rdd"))) - -(setq erc-user-full-name "Ramakrishnan Muthukrishnan") -(setq erc-email-userid "vu3rdd@gmail.com") - -(require 'erc-track) -(erc-track-mode 1) -(setq erc-track-switch-direction 'importance) - -;; Only track my nick(s) -(defadvice erc-track-find-face (around erc-track-find-face-promote-query activate) - (if (erc-query-buffer-p) - (setq ad-return-value (intern "erc-current-nick-face")) - ad-do-it)) - -(setq erc-keywords '("vu3rdd" "rkrishnan")) - -(setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT" "MODE" - "324" "329" "332" "333" "353" "477")) - -(global-set-key (kbd "C-c SPC") 'erc-track-switch-buffer) - -;; erc notification via notify -(defun clean-message (s) - (setq s (replace-regexp-in-string "'" "'" - (replace-regexp-in-string "\"" """ - (replace-regexp-in-string "&" "&" - (replace-regexp-in-string "<" "<" - (replace-regexp-in-string ">" ">" s))))))) - -(defun call-libnotify (matched-type nick msg) - (let* ((cmsg (split-string (clean-message msg))) - (nick (first (split-string nick "!"))) - (msg (mapconcat 'identity (rest cmsg) " "))) - (shell-command-to-string - (format "notify-send -t 5000 -u critical '%s says:' '%s'" nick msg)))) - -(add-hook 'erc-text-matched-hook 'call-libnotify) - -;; Enable logging -(setq erc-log-insert-log-on-open nil) -(setq erc-log-channels t) -(setq erc-log-channels-directory "~/.erc/logs/") -(setq erc-save-buffer-on-part t) -(setq erc-save-queries-on-quit nil - erc-log-write-after-send t - erc-log-write-after-insert t) -(defadvice save-buffers-kill-emacs (before save-logs (arg) activate) - (save-some-buffers t (lambda () (when (and (eq major-mode 'erc-mode) - (not (null buffer-file-name))))))) -(add-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) - ;; iswitch (iswitchb-mode 1) ;; smooth scroll (setq scroll-conservatively 1) (put 'upcase-region 'disabled nil) - (put 'downcase-region 'disabled nil) ;; cscope @@ -141,85 +66,19 @@ (set-frame-size-according-to-resolution) +;; tramp (require 'tramp) + (setq tramp-default-method "ssh") ;; cut and paste with the rest of ecosystem in X (setq x-select-enable-clipboard t) -;; tramp - (setq tramp-default-method "ssh") - -;; copy a line -(defun duplicate-current-line () - (interactive) - (beginning-of-line nil) - (let ((b (point))) - (end-of-line nil) - (copy-region-as-kill b (point))) - (back-to-indentation)) - -;; (global-set-key "\C-b" 'duplicate-current-line) - -;; -;; Start GNUServe process when starting up. This lets us send new files -;; to previously spawned emacs process. -;; -;(load "gnuserv-compat") -;(load-library "gnuserv") -;(gnuserv-start) -;; When loading files reuse existing frames. -;(setq gnuserv-frame (car (frame-list))) - ;; remove toolbar (if (> emacs-major-version 20) (tool-bar-mode -1)) -;; org mode -(require 'org-install) -(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) -(define-key global-map "\C-cl" 'org-store-link) -(define-key global-map "\C-ca" 'org-agenda) -(define-key global-map "\C-cb" 'org-iswitchb) -(setq org-log-done 'time) -(setq org-startup-indented t) - -(setq org-agenda-files (list "~/org/work.org" - "~/org/remember.org" - "~/org/debian.org" - "~/org/clojure.org" - "~/org/learning.org" - "~/org/reading.org" - "~/org/investments.org")) - -;; adapted from -(setq org-todo-keywords '((sequence "TODO(t)" - "STARTED(s!)" - "|" - "DONE(d!/!)") - (sequence "WAITING(w@/!)" - "SOMEDAY(S!)" - "|" - "CANCELLED(c@/!)"))) - -(setq org-todo-keyword-faces (quote (("TODO" :foreground "red" :weight bold) - ("STARTED" :foreground "blue" :weight bold) - ("DONE" :foreground "forest green" :weight bold) - ("WAITING" :foreground "orange" :weight bold) - ("SOMEDAY" :foreground "magenta" :weight bold) - ("CANCELLED" :foreground "forest green" :weight bold)))) - -;; common lisp -;; Set up the Common Lisp environment -;(add-to-list 'load-path "/usr/share/common-lisp/source/slime/") -;(setq inferior-lisp-program "/usr/bin/sbcl") -;(require 'slime) -;(slime-setup) - -;; cl-doc -;(autoload 'turn-on-cldoc-mode "cldoc" nil t) - ;; clojure mode -(add-to-list 'load-path "~/src/clojure-mode") +(add-to-list 'load-path "~/.emacs.d/vendor/clojure-mode") (require 'clojure-mode) ;; highlight parentheses mode @@ -233,101 +92,6 @@ ;; "orange1" "yellow1" "greenyellow" "green1" ;; "springgreen1" "cyan1" "slateblue1" "magenta1" "purple")) -;; slime -(add-to-list 'load-path "~/src/slime") - -(eval-after-load "slime" - '(progn - (setq slime-use-autodoc-mode nil) - (slime-setup '(inferior-slime - ;; slime-asdf - ;; slime-autodoc - slime-banner - ;; slime-c-p-c - ;; slime-editing-commands - slime-fancy-inspector - slime-fancy - slime-fuzzy - ;; slime-highlight-edits - ;; slime-parse - ;; slime-presentation-streams - ;; slime-presentations - ;; slime-references - slime-repl - slime-scratch - ;;slime-tramp - ;;slime-typeout-frame - slime-xref-browser - slime-scheme)) - - (setq slime-protocol-version 'ignore) - (setq slime-complete-symbol*-fancy t) - (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol))) - -(require 'slime) -;(setq inferior-lisp-program "~/src/sbcl/src/runtime/sbcl") -(add-to-list 'slime-lisp-implementations '(sbcl ("/usr/bin/sbcl"))) -(setq slime-default-lisp 'sbcl) - -(add-to-list 'load-path "~/src/swank-clojure-extra") - -(setq swank-clojure-classpath (append (list "/usr/share/java/clojure.jar" - "~/src/swank-clojure/src" - "~/.clojure") - (directory-files "/usr/share/java/" - t - ".jar$"))) - -(setq swank-clojure-extra-vm-args (list "-server" - "-noverify" - "-Xincgc" - "-Djava.net.preferIPv4Stack=true" - "-Xms256m" - "-Xmx1024m" - "-XX:CompileThreshold=1500" - "-XX:+UseConcMarkSweepGC" - "-XX:+UseParNewGC" - "-XX:+ExplicitGCInvokesConcurrent" - "-XX:+CMSClassUnloadingEnabled" - "-XX:MaxPermSize=250m" - "-XX:+UseAdaptiveSizePolicy" - "-XX:+AggressiveOpts" - "-XX:+UseFastAccessorMethods" - "-XX:+UseFastEmptyMethods" - "-XX:+UseFastJNIAccessors" - "-Xverify:none" - "-XX:+UseCompressedOops" - "-XX:MaxInlineSize=1024" - "-XX:FreqInlineSize=1024")) - -;; swank gauche -(setq swank-gauche-path "~/src/swank-gauche") -(setq swank-gauche-gauche-source-path nil) - -(push swank-gauche-path load-path) -(require 'swank-gauche) - -(add-to-list 'slime-lisp-implementations - '(gauche ("gosh") :init gauche-init :coding-system utf-8-unix)) - -(eval-after-load "slime" - '(progn - (require 'swank-clojure-extra) - (add-to-list 'slime-lisp-implementations `(clojure ,(swank-clojure-cmd) - :init swank-clojure-init) - t) - (add-hook 'slime-indentation-update-hooks 'swank-clojure-update-indentation) - (add-hook 'slime-repl-mode-hook 'swank-clojure-slime-repl-modify-syntax t) - (add-hook 'clojure-mode-hook 'swank-clojure-slime-mode-hook t))) - -;; enable cldoc for slime -;; (dolist (hook '(lisp-mode-hook -;; slime-repl-mode-hook)) -;; (add-hook hook 'turn-on-cldoc-mode)) - -;; needed for overriding default method for invoking slime -(ad-activate 'slime-read-interactive-args) - ;; paredit (autoload 'paredit-mode "paredit" "Minor mode for pseudo-structurally editing Lisp code." t) @@ -340,15 +104,11 @@ (add-hook hook #'(lambda () (highlight-parentheses-mode t) (paredit-mode +1)))) - ;; clojure-test-mode (autoload 'clojure-test-mode "clojure-test-mode" "Clojure test mode" t) (autoload 'clojure-test-maybe-enable "clojure-test-mode" "" t) (add-hook 'clojure-mode-hook 'clojure-test-maybe-enable) -;; pressing newline, should also indent automatically -;; (global-set-key "\r" 'newline-and-indent) - ;; flyspell (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t) @@ -359,25 +119,9 @@ (global-set-key [f10] 'switch-full-screen) -;; (defun fullscreen (&optional f) -;; (interactive) -;; (set-frame-parameter f 'fullscreen -;; (if (frame-parameter f 'fullscreen) nil 'fullboth))) - -;; (global-set-key [f10] 'fullscreen) - -;; (add-hook 'after-make-frame-functions 'fullscreen) - ;; gist integration (require 'gist) -;; mozrepl -(autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t) - -(add-hook 'espresso-mode-hook 'espresso-custom-setup) -(defun espresso-custom-setup () - (moz-minor-mode 1)) - ;; browse url (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "/usr/bin/iceweasel" @@ -404,19 +148,9 @@ (when (require 'browse-kill-ring nil 'noerror) (browse-kill-ring-default-keybindings)) -;; magit-status bound to Cx-g -(global-set-key (kbd "C-x g") 'magit-status) - -;; sql mode -(require 'sql) - ;; rainbox mode for CSS color highlighting (require 'rainbow-mode) -;; rudel (remote pairing/collaborative editing) -;(add-to-list 'load-path "~/src/rudel") -;(load-file "~/src/rudel/rudel-loaddefs.el") - (add-to-list 'auto-mode-alist '("\\.rkt$" . scheme-mode)) ;; scheme auto complete @@ -426,12 +160,25 @@ '(progn (define-key scheme-mode-map "\t" 'scheme-complete-or-indent))) ;; autocomplete -(add-to-list 'load-path "~/src/auto-complete/") +(add-to-list 'load-path "~/.emacs.d/vendor/popup/") +(add-to-list 'load-path "~/.emacs.d/vendor/auto-complete/") (require 'auto-complete) + +(set-default 'ac-sources + '(ac-source-abbrev + ac-source-dictionary + ac-source-yasnippet + ac-source-words-in-buffer + ac-source-words-in-same-mode-buffers + ac-source-semantic)) + +(dolist (m '(c-mode c++-mode java-mode)) + (add-to-list 'ac-modes m)) + (global-auto-complete-mode t) ;; slime autocomplete -(add-to-list 'load-path "~/src/ac-slime/") +(add-to-list 'load-path "~/.emacs.d/vendor/ac-slime/") (require 'ac-slime) (set-default 'ac-sources 'ac-source-slime-simple) @@ -453,7 +200,7 @@ (local-set-key "\C-c\C-v" 'racket-enter!) ;; company-mode -(add-to-list 'load-path "~/src/company-mode") +(add-to-list 'load-path "~/.emacs.d/vendor/company-mode") (autoload 'company-mode "company" nil t) ;; handle trailing whitespaces @@ -495,33 +242,6 @@ (and url (browse-url url)) (or url ret)))) -;; (require 'color-theme-zenburn) -;;(color-theme-zenburn) - -(add-to-list 'load-path "~/.emacs.d/emacs/twittering-mode") -(require 'twittering-mode) -(add-hook 'twittering-edit-mode-hook (lambda () (ispell-minor-mode) (flyspell-mode))) - -(require 'ac-python) - -;;; Use python-mode with files with these extensions -(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) -(add-to-list 'auto-mode-alist '("\\.pyx\\'" . python-mode)) - -;;; Turn on auto-complete in python shells -(add-hook 'inferior-python-mode-hook (lambda () (auto-complete-mode 1))) - -;;; Use python major mode if 'python' is in hashbang. -(add-to-list 'interpreter-mode-alist '("python" . python-mode)) - -;;; Use python as the python interpreter (can be changed to "ipython" in time -;;; when it works) -(setq python-python-command "python") - -;;; Check files for pep8 mistakes -(autoload 'python-pep8 "python-pep8") -(autoload 'pep8 "python-pep8") - ;;; displays "\" at the end of lines that wrap (setq longlines-show-hard-newlines t) @@ -547,14 +267,6 @@ (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) (set-variable 'haskell-program-name "ghci") -;; chicken swank -(add-to-list 'load-path "/var/lib/chicken/6/") -(autoload 'chicken-slime "chicken-slime" "SWANK backend for Chicken" t) -(setq slime-csi-path "/usr/bin/csi") -(add-hook 'scheme-mode-hook - (lambda () - (slime-mode t))) - ;; javascript mode (autoload 'js2-mode "js2-mode" nil t) (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) @@ -605,7 +317,6 @@ (require 'gnus-art) ;; sending email -;; sending mail (setq message-send-mail-function 'message-send-mail-with-sendmail mail-specify-envelope-from t ; Settings to work with msmtp message-sendmail-f-is-evil nil diff --git a/vendor/ac-slime b/vendor/ac-slime new file mode 160000 index 0000000..63f6c32 --- /dev/null +++ b/vendor/ac-slime @@ -0,0 +1 @@ +Subproject commit 63f6c32aa42819d29b1cc430830f4046fdcc6374 diff --git a/vendor/auto-complete b/vendor/auto-complete new file mode 160000 index 0000000..a4f83db --- /dev/null +++ b/vendor/auto-complete @@ -0,0 +1 @@ +Subproject commit a4f83db2ab9898fb95d27a9ee722fda5d85763ac diff --git a/vendor/clojure-mode b/vendor/clojure-mode new file mode 160000 index 0000000..f14f151 --- /dev/null +++ b/vendor/clojure-mode @@ -0,0 +1 @@ +Subproject commit f14f1512a2436d0851caf1d94c5972f8ba544a37 diff --git a/vendor/company-mode b/vendor/company-mode new file mode 160000 index 0000000..947aebb --- /dev/null +++ b/vendor/company-mode @@ -0,0 +1 @@ +Subproject commit 947aebba714790a8d5be48987f32af1a1def2bbe diff --git a/vendor/popup b/vendor/popup new file mode 160000 index 0000000..1277ab1 --- /dev/null +++ b/vendor/popup @@ -0,0 +1 @@ +Subproject commit 1277ab12c0bd07e19525f858bfc0a8a849249ae3 diff --git a/vendor/slime b/vendor/slime new file mode 160000 index 0000000..56dda43 --- /dev/null +++ b/vendor/slime @@ -0,0 +1 @@ +Subproject commit 56dda43452a9b041b04f4c665aaced9e87f9332c