Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/topfunky/emacs-starter-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Trentacoste committed Feb 6, 2011
2 parents 72606ee + 7ca3c94 commit ac350b2
Show file tree
Hide file tree
Showing 25 changed files with 1,909 additions and 144 deletions.
8 changes: 6 additions & 2 deletions book.local.el
@@ -1,5 +1,5 @@
;; Normal is 36pt. Screencastable is 26pt.
(set-face-font 'default "-apple-inconsolata-medium-r-normal--34-0-72-72-m-0-iso10646-1")
(set-face-font 'default "-apple-inconsolata-medium-r-normal--32-0-72-72-m-0-iso10646-1")

;;(set-face-font 'default "-apple-helvetica-medium-r-normal--32-0-72-72-m-0-iso10646-1")
;;(color-theme-topfunky)
Expand All @@ -9,7 +9,11 @@
;; (x-family-fonts "myriad pro")

;; characters wide, lines tall
(set-frame-size (car (frame-list)) 95 27)
(set-frame-size (car (frame-list)) 100 28)
;; x y
(set-frame-position (car (frame-list)) 17 33)

;; Font-Size Wide Tall
;; 34 95 27
;; 32

5 changes: 2 additions & 3 deletions octo.local.el
@@ -1,8 +1,7 @@
(set-face-font 'default "-apple-inconsolata-medium-r-normal--46-0-72-72-m-0-iso10646-1")

(set-face-font 'default "-apple-inconsolata-medium-r-normal--34-0-72-72-m-0-iso10646-1")

;; characters wide, lines tall
(set-frame-size (car (frame-list)) 80 23)
(set-frame-size (car (frame-list)) 80 30)
;; x y
(set-frame-position (car (frame-list)) 17 33)

11 changes: 10 additions & 1 deletion topfunky.el
Expand Up @@ -32,18 +32,22 @@
(require 'peepopen)
(require 'topfunky/textmate-ext)
(textmate-mode)
(setq ns-pop-up-frames nil)

(require 'whitespace)

(require 'topfunky/python)

;;(require 'topfunky/coffee)

;; ruby-mode
(require 'topfunky/sinatra)
(add-to-list 'load-path (concat dotfiles-dir "/vendor/ruby-complexity"))
(add-to-list 'auto-mode-alist '("\\.sake\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("Capfile\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("Isolate\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.sake\\'" . ruby-mode))

(require 'linum)
(require 'ruby-complexity)
Expand Down Expand Up @@ -118,3 +122,8 @@
;; Activate theme
(load (concat dotfiles-dir "topfunky/theme.el"))
(color-theme-topfunky)


(require 'autotest)


16 changes: 16 additions & 0 deletions topfunky/coffee.el
@@ -0,0 +1,16 @@

(add-to-list 'load-path "~/.emacs.d/vendor/coffee-mode")
(require 'coffee-mode)

(add-to-list 'auto-mode-alist '("\\.coffee$" . coffee-mode))
(add-to-list 'auto-mode-alist '("Cakefile" . coffee-mode))

(defun coffee-custom ()
"coffee-mode-hook"
(set (make-local-variable 'tab-width) 2))

(add-hook 'coffee-mode-hook
'(lambda() (coffee-custom)))

(provide 'topfunky/coffee)

14 changes: 11 additions & 3 deletions topfunky/js.el
Expand Up @@ -28,15 +28,23 @@

(add-hook 'javascript-mode-hook
(lambda ()
(setq imenu-generic-expression topfunky-js-imenu-generic-expression)))
(setq imenu-generic-expression topfunky-js-imenu-generic-expression)
(setq indent-region-function topfunky-js-beautify)))

;; Run jslint on a file to check syntax and coding conventions.
(add-hook 'javascript-mode-hook
(lambda ()
(set (make-local-variable 'compile-command)
(let ((file (file-name-nondirectory buffer-file-name)))
(concat "java -classpath ~/src/rhino1_7R2/build/classes org.mozilla.javascript.tools.shell.Main ~/bin/src/jslint.js " file)))))

(concat "node ~/src/reid-node-jslint/bin/jslint.js " file)))))

(defun tf-beautify-js ()
"Run source through JavaScript beautifier."
(interactive)
;; TODO: Doesn't save cursor location
(save-excursion
(shell-command-on-region
(point-min) (point-max)
"~/bin/beautify-js" t t)))

(provide 'topfunky/js)
8 changes: 8 additions & 0 deletions topfunky/org.el
@@ -1,5 +1,12 @@
;; org-mode
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

;; Functions
(defun timestamp-for-org ()
"Insert string for the current time formatted like '2011-01-01 Thu 13:54'."
(interactive)
(insert (format-time-string "<%Y-%m-%d %a %H:%M>")))

;; Override
(add-hook 'org-mode-hook
(lambda()
Expand All @@ -8,6 +15,7 @@
(local-set-key [(control shift right)] 'next-buffer)
(local-set-key [(meta shift right)] 'ido-switch-buffer)
(local-set-key [(meta shift left)] 'magit-status)
(local-set-key [(control shift t)] 'timestamp-for-org)
))

(setq org-agenda-files (file-expand-wildcards "~/bin/org/*.org"))
Expand Down
10 changes: 10 additions & 0 deletions topfunky/plain-text.el
Expand Up @@ -12,4 +12,14 @@
(revert-buffer t t t))
(global-set-key [f5] 'refresh-file)

(defun duplicate-line ()
(interactive)
(move-beginning-of-line 1)
(kill-line)
(yank)
(open-line 1)
(next-line 1)
(yank))
(global-set-key (kbd "C-d") 'duplicate-line)

(provide 'topfunky/plain-text)
119 changes: 119 additions & 0 deletions vendor/autotest.el
@@ -0,0 +1,119 @@
;;; autotest.el - ZenTest's autotest integration with emacs.

;; Copyright (C) 2006-2007 by Ryan Davis

;; Author: Ryan Davis <ryand-ruby@zenspider.com>
;; Version 1.0
;; Keywords: testing, ruby, convenience
;; Created: 2006-11-17
;; Compatibility: Emacs 22, 21?
;; URL(en): http://seattlerb.rubyforge.org/
;; by Ryan Davis - ryan-ruby@zenspider.com

;;; The MIT License:

;; http://en.wikipedia.org/wiki/MIT_License
;;
;; Permission is hereby granted, free of charge, to any person obtaining
;; a copy of this software and associated documentation files (the
;; "Software"), to deal in the Software without restriction, including
;; without limitation the rights to use, copy, modify, merge, publish,
;; distribute, sublicense, and/or sell copies of the Software, and to
;; permit persons to whom the Software is furnished to do so, subject to
;; the following conditions:

;; The above copyright notice and this permission notice shall be
;; included in all copies or substantial portions of the Software.

;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

;;; Commentary:

;; Sets up an autotest buffer and provides convenience methods.

;;; History:
;; 1.0.0 - 2008-09-25 - Added an extra regexp for rspec/mspec. 1.0.0 release.
;; 1.0b4 - 2007-09-25 - Added autotest-use-ui and autotest-command vars.
;; 1.0b3 - 2007-05-10 - emacs compatibility fixes and improved regexps.
;; 1.0b2 - 2007-04-03 - added autotest plugin / communication support
;; 1.0b1 - 2007-03-06 - initial release

(require 'shell)

(defcustom autotest-use-ui nil
"Should we use test-unit's UI?"
:group 'autotest
:type '(boolean))

(defcustom autotest-command "autotest"
"Command name to use to execute autotest."
:group 'autotest
:type '(string))

(defun autotest ()
"Fire up an instance of autotest in its own buffer with shell bindings and compile-mode highlighting and linking."
(interactive)
(let ((buffer (shell "*autotest*")))

(define-key shell-mode-map "\C-c\C-a" 'autotest-switch)

(set (make-local-variable 'comint-output-filter-functions)
'(comint-truncate-buffer comint-postoutput-scroll-to-bottom))
(set (make-local-variable 'comint-buffer-maximum-size) 5000)
(set (make-local-variable 'comint-scroll-show-maximum-output) t)
(set (make-local-variable 'comint-scroll-to-bottom-on-output) t)

(set (make-local-variable 'compilation-error-regexp-alist)
'(
("^ +\\(#{RAILS_ROOT}/\\)?\\([^(:]+\\):\\([0-9]+\\)" 2 3)
("\\[\\(.*\\):\\([0-9]+\\)\\]:$" 1 2)
("^ *\\([[+]\\)?\\([^:
]+\\):\\([0-9]+\\):in" 2 3)
("^.* at \\([^:]*\\):\\([0-9]+\\)$" 1 2)
))
(compilation-shell-minor-mode)
(comint-send-string buffer (concat autotest-command "\n"))))

(defun autotest-switch ()
"Switch back and forth between autotest and the previous buffer"
(interactive)
(if (equal "*autotest*" (buffer-name))
(switch-to-buffer (other-buffer))
(switch-to-buffer "*autotest*")))

(eval-when-compile
(require 'unit-test nil t))

(if (and autotest-use-ui (require 'unit-test nil t))
(progn
(message "starting emacs server for autotest")
(setq unit-test-colours (acons "gray" "#999999" unit-test-colours))
(setq unit-test-colours (acons "dark-gray" "#666666" unit-test-colours))
(setq unit-test-running-xpm (unit-test-dot "gray"))
(server-start)
(defun autotest-update (status)
"Updates all buffer's modeline with the current test status."
(interactive "S")
(let ((autotest-map (make-sparse-keymap)))
(define-key autotest-map [mode-line mouse-1] 'autotest-switch)
(mapcar (lambda (buffer)
(with-current-buffer buffer
(if (eq status 'quit)
(show-test-none)
(progn
(show-test-status status)
(put-text-property
0 3
'keymap autotest-map
(car mode-line-buffer-identification))))))
(remove-if 'minibufferp (buffer-list))))
status))
(message "unit-test not found, not starting autotest/emacs integration"))

(provide 'autotest)

0 comments on commit ac350b2

Please sign in to comment.