Permalink
Browse files

Rearrange lisp and ruby helpers.

  • Loading branch information...
1 parent 99cd8e8 commit 12ac2f0e4c691d12c05a9438d074db05a931bf5f @technomancy technomancy committed Nov 20, 2008
Showing with 22 additions and 34 deletions.
  1. +3 −3 elpa-to-submit/inf-ruby.el
  2. +13 −9 starter-kit-lisp.el
  3. +6 −22 starter-kit-ruby.el
@@ -180,11 +180,11 @@ run)."
(mapc #'car inf-ruby-implementations))
inf-ruby-default-implementation)))
- (let ((buffer-name (format "*%s*" (or impl "ruby")))
- (cmd (cdr (assoc (or impl "ruby") inf-ruby-implementations))))
+ (let ((buffer-name (format "*%s*" impl))
+ (cmd (cdr (assoc impl inf-ruby-implementations))))
(if (not (comint-check-proc buffer-name))
(let ((cmdlist (split-string cmd)))
- (set-buffer (apply 'make-comint "ruby" (car cmdlist)
+ (set-buffer (apply 'make-comint impl (car cmdlist)
nil (cdr cmdlist)))
(inf-ruby-mode)))
(setq inf-ruby-buffer buffer-name)
View
@@ -4,21 +4,24 @@
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
-(add-hook 'emacs-lisp-mode-hook
- ;; If you're saving an elisp file, likely the .elc is no longer valid.
- (lambda ()
- (make-local-variable 'after-save-hook)
- (add-hook 'after-save-hook
- (lambda ()
- (if (file-exists-p (concat buffer-file-name "c"))
- (delete-file (concat buffer-file-name "c")))))))
+(add-hook 'emacs-lisp-mode-hook 'emacs-lisp-remove-elc-on-save)
+
+(defun emacs-lisp-remove-elc-on-save ()
+ "If you're saving an elisp file, likely the .elc is no longer valid."
+ (make-local-variable 'after-save-hook)
+ (add-hook 'after-save-hook
+ (lambda ()
+ (if (file-exists-p (concat buffer-file-name "c"))
+ (delete-file (concat buffer-file-name "c"))))))
(font-lock-add-keywords 'emacs-lisp-mode
'(("(\\|)" . 'paren-face)))
(font-lock-add-keywords 'scheme-mode
'(("(\\|)" . 'paren-face)))
+(define-key lisp-mode-shared-map (kbd "C-c l") "lambda")
+
(defface paren-face
'((((class color) (background dark))
(:foreground "grey20"))
@@ -27,4 +30,5 @@
"Face used to dim parentheses."
:group 'starter-kit-faces)
-(provide 'starter-kit-lisp)
+(provide 'starter-kit-lisp)
+;; starter-kit-lisp.el ends here
View
@@ -2,29 +2,13 @@
;;
;; Part of the Emacs Starter Kit
+(eval-after-load 'ruby-mode
+ '(progn
+ (require 'inf-ruby)
+ (require 'ruby-compilation)
-;; TODO: move this stuff to autoloads?
-(require 'ruby-mode)
-(require 'ruby-compilation)
-
-(defun rr (&optional arg)
- "Run a Ruby interactive shell session in a buffer."
- (interactive "P")
- (let ((impl (if (not arg)
- "mri"
- (completing-read "Ruby Implementation: "
- '("ruby" "jruby" "rubinius" "yarv")))))
- (run-ruby (cdr (assoc impl '(("mri" . "irb")
- ("jruby" . "jruby -S irb")
- ("rubinius" . "rbx")
- ("yarv" . "irb1.9")))))
- (with-current-buffer "*ruby*"
- (rename-buffer (format "*%s*" impl) t))))
-
-(define-key ruby-mode-map (kbd "C-M-h") 'backward-kill-word)
-(define-key ruby-mode-map (kbd "RET") 'ruby-reindent-then-newline-and-indent)
-(define-key ruby-mode-map (kbd "C-c l") (lambda ()
- (interactive) (insert "lambda")))
+ (define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent)
+ (define-key ruby-mode-map (kbd "C-c l") "lambda")))
(global-set-key (kbd "C-h r") 'ri)

0 comments on commit 12ac2f0

Please sign in to comment.