Permalink
Browse files

ruby-compilation cleanups.

  • Loading branch information...
1 parent 0716d25 commit 680a6d61c6129459917550effc98a5c9f020a910 @technomancy committed Dec 11, 2008
Showing with 20 additions and 64 deletions.
  1. +0 −58 elpa-to-submit/pcmpl-rake.el
  2. +18 −4 elpa-to-submit/ruby-compilation.el
  3. +1 −1 starter-kit-misc.el
  4. +1 −1 starter-kit-ruby.el
@@ -1,58 +0,0 @@
-;;; pcmpl-rake.el --- functions for completing Rake tasks
-
-;; Copyright (C) 2007 Phil Hagelberg
-
-;; Author: Phil Hagelberg <technomancy@gmail.com>
-;; URL: http://www.emacswiki.org/cgi-bin/wiki/PcompleteRake
-;; Version: 0.1
-;; Created: 2007-12-02
-;; Keywords: shell completion rake
-;; EmacsWiki: PcompleteRake
-
-;; This file is NOT part of GNU Emacs.
-
-;; Last-Updated: Sun Dec 02 15:58:06 2007 PST
-;; By: Phil Hagelberg
-;; Update #: 1
-
-;;; License:
-
-;; This program 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.
-;;
-;; This program 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 GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Provides pcompletion for the `rake' command, which is basically
-;; `make' implemented in Ruby.
-
-;;; Code:
-
-(require 'pcomplete)
-
-;;;###autoload
-(defun pcomplete/rake ()
- "Completion rules for the `ssh' command."
- (pcomplete-here (pcmpl-rake-tasks)))
-
-(defun pcmpl-rake-tasks ()
- "Return a list of all the rake tasks defined in the current
-projects. I know this is a hack to put all the logic in the
-exec-to-string command, but it works and seems fast"
- (delq nil (mapcar '(lambda(line)
- (if (string-match "rake \\([^ ]+\\)" line) (match-string 1 line)))
- (split-string (shell-command-to-string "rake -T") "[\n]"))))
-
-(provide 'pcmpl-rake)
-;;; pcmpl-rake.el ends here
@@ -49,9 +49,7 @@
;;; Code:
(require 'ansi-color)
-(require 'pcmpl-rake)
(require 'compile)
-(require 'inf-ruby)
(require 'which-func)
(defvar ruby-compilation-error-regexp
@@ -78,23 +76,26 @@
(ruby-args-to-list (expand-file-name cmd)))))
(pop-to-buffer (ruby-compilation-do name cmdlist))))
+;;;###autoload
(defun ruby-compilation-rake (&optional edit task)
"Run a rake process dumping output to a ruby compilation buffer."
(interactive "P")
(let* ((task (or task (if (stringp edit) edit)
- (completing-read "Rake: " (pcmpl-rake-tasks))))
+ (completing-read "Rake: " (ruby-compilation-rake-tasks))))
(rake-args (if (and edit (not (stringp edit)))
(read-from-minibuffer "Edit Rake Command: " (concat task " "))
task)))
(pop-to-buffer (ruby-compilation-do
"rake" (cons "rake"
(ruby-args-to-list rake-args))))))
+;;;###autoload
(defun ruby-compilation-this-buffer ()
"Run the current buffer through Ruby compilation."
(interactive)
(ruby-compilation-run (buffer-file-name)))
+;;;###autoload
(defun ruby-compilation-this-test ()
"Run the test at point through Ruby compilation."
(interactive)
@@ -197,6 +198,19 @@ compilation buffer."
(dolist (executable (list "jruby" "rbx" "ruby1.9" "ruby1.8" "ruby"))
(add-to-list 'safe-local-variable-values
(cons 'ruby-compilation-executable executable)))
-
+
+(defun ruby-compilation-rake-tasks ()
+ "Return a list of all the rake tasks defined in the current
+projects. I know this is a hack to put all the logic in the
+exec-to-string command, but it works and seems fast"
+ (delq nil (mapcar '(lambda(line)
+ (if (string-match "rake \\([^ ]+\\)" line) (match-string 1 line)))
+ (split-string (shell-command-to-string "rake -T") "[\n]"))))
+
+;;;###autoload
+(defun pcomplete/rake ()
+ "Completion rules for the `ssh' command."
+ (pcomplete-here (pcmpl-rake-tasks)))
+
(provide 'ruby-compilation)
;;; ruby-compilation.el ends here
View
@@ -14,7 +14,6 @@
inhibit-startup-message t
transient-mark-mode t
color-theme-is-global t
- imenu-auto-rescan t
delete-by-moving-to-trash t
shift-select-mode nil
truncate-partial-width-windows nil
@@ -62,6 +61,7 @@
(set-default 'indent-tabs-mode nil)
(set-default 'indicate-empty-lines t)
+(set-default 'imenu-auto-rescan t)
(defalias 'yes-or-no-p 'y-or-n-p)
(random t) ;; Seed the random-number generator
View
@@ -4,8 +4,8 @@
(eval-after-load 'ruby-mode
'(progn
- (require 'inf-ruby)
(require 'ruby-compilation)
+ (add-hook 'ruby-mode-hook 'inf-ruby-keys)
(define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent)
(define-key ruby-mode-map (kbd "C-c l") "lambda")))

0 comments on commit 680a6d6

Please sign in to comment.