Complete refactor & implement cask
This commit is contained in:
parent
418f7bc5a6
commit
8f93fb9b73
39 changed files with 1534 additions and 1155 deletions
|
@ -1 +0,0 @@
|
|||
Subproject commit a0c415ac6726e316c1c7da720d96e417c49bd5f4
|
|
@ -54,7 +54,7 @@ Support some registers listed below in addition to
|
|||
(defun evil-ex-paste-from-register (&optional register)
|
||||
"Paste from REGISTER in command line."
|
||||
(interactive)
|
||||
(flet ((evil-get-register (register &optional noerror)
|
||||
(cl-flet ((evil-get-register (register &optional noerror)
|
||||
(with-current-buffer evil-ex-current-buffer
|
||||
(evil-get-spec-register register noerror))))
|
||||
(if (called-interactively-p 'any)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 22a1d4c1a60ee5d0688197ab85c93031322539a3
|
95
elisp/rake-mode.el
Normal file
95
elisp/rake-mode.el
Normal file
|
@ -0,0 +1,95 @@
|
|||
;; -*-Emacs-Lisp-*-
|
||||
;;
|
||||
;; rake-mode.el --- in-file Rake task running
|
||||
;;
|
||||
;; Copyright (C) 2008 Joseph Abrahamson <abrahamson dot j at gmail dot com>.
|
||||
;; Released under The Perl Artistic License 2.0
|
||||
;;
|
||||
|
||||
;; Code:
|
||||
|
||||
(require 'ido)
|
||||
(provide 'rake-mode)
|
||||
|
||||
(defvar rake-minor-mode-map (make-sparse-keymap) "Keymap for Rake minor mode")
|
||||
|
||||
(define-minor-mode rake-mode
|
||||
"Toggle Rake minor mode
|
||||
|
||||
With no argument, this command toggles Rake mode. Non-null prefix
|
||||
arguments turn the mode on and null deactive it.
|
||||
|
||||
Rake mode enables Rake task calling with autocompletion in the
|
||||
specified directory."
|
||||
:init-value nil
|
||||
:lighter " Rake"
|
||||
:keymap rake-minor-mode-map
|
||||
nil)
|
||||
|
||||
|
||||
(defvar rake-mode/rakefile nil
|
||||
"* Path to Rakefile. Rake will be executed here.")
|
||||
|
||||
(defun rake-mode/task (task &optional prefix)
|
||||
"Run a Rake task from the tasks described by Rakefile.
|
||||
|
||||
If no Rakefile is described use rake-mode/visit-rakefile.
|
||||
|
||||
If prefix is given, the output from Rake is sent to the
|
||||
minibuffer temporarily instead of being given its own temp buffer"
|
||||
(interactive
|
||||
(list (ido-completing-read (concat "Tasks at (" rake-mode/rakefile "): ") (rake-mode/get-tasks))
|
||||
current-prefix-arg))
|
||||
(when task
|
||||
(save-current-buffer
|
||||
(let ((str (concat "*** RAKE TASK: "
|
||||
task
|
||||
" ***\n"
|
||||
(ansi-color-apply
|
||||
(in-rakepath
|
||||
(shell-command-to-string
|
||||
(concat "rake "
|
||||
task)))))))
|
||||
(if prefix
|
||||
(message str)
|
||||
(with-output-to-temp-buffer "*Rake Output*"
|
||||
(princ str)))))))
|
||||
|
||||
(defun rake-mode/visit-rakefile (file &optional local)
|
||||
(interactive (list (ido-read-file-name "Visit Rakefile (default Rakefile): "
|
||||
default-directory
|
||||
(expand-file-name "Rakefile"
|
||||
default-directory)
|
||||
t)
|
||||
current-prefix-arg))
|
||||
(or (stringp file) (signal 'wrong-type-argument (list 'stringp file)))
|
||||
(let ((rakefile-name file))
|
||||
(save-excursion
|
||||
(or (find-file-noselect file)
|
||||
(signal 'file-error (list "Visiting Rakefile"
|
||||
"file does not exist"
|
||||
file)))))
|
||||
(if local
|
||||
(set (make-local-variable 'rake-mode/rakefile) file)
|
||||
(setq-default rake-mode/rakefile file)))
|
||||
|
||||
(defmacro in-rakepath (&rest body)
|
||||
`(let ((default-directory (rake-mode/get-rakefile-path))) ,@body))
|
||||
|
||||
(defun rake-mode/get-rakefile-path ()
|
||||
(if rake-mode/rakefile
|
||||
(replace-regexp-in-string "\/\[^/\]\+$" "/" rake-mode/rakefile)
|
||||
(error "Rakefile not yet visited.")))
|
||||
|
||||
(defun rake-mode/get-tasks ()
|
||||
(in-rakepath
|
||||
(let ((lines (split-string (shell-command-to-string "rake -P") "\n")))
|
||||
(if (string= (car lines) "rake aborted!")
|
||||
(error "Rake failed. Check Rakefile"))
|
||||
(loop for str in lines
|
||||
for task = (save-match-data
|
||||
(when (and (not (string= "" str))
|
||||
(not (string-match "^ +$" str)))
|
||||
(nth 1 (s-match "^rake \\([^ ]*\\)" str))
|
||||
))
|
||||
when task collect task))))
|
|
@ -55,9 +55,6 @@
|
|||
|
||||
(eval-when-compile (require 'cl))
|
||||
|
||||
(require 'autopair)
|
||||
|
||||
|
||||
(defvar ruby--paren-closings-regex
|
||||
"[])}\"']"
|
||||
"regex matching closing paren or string delimiter.")
|
||||
|
@ -83,7 +80,7 @@ note: `ruby-deep-indent-paren' has to be enabled for this to work."
|
|||
(save-excursion
|
||||
(back-to-indentation)
|
||||
(let ((state (syntax-ppss)))
|
||||
(when (and (or (memq (autopair-find-pair (char-after)) ruby-deep-indent-paren)
|
||||
(when (and (or (memq (sp-get-pair (char-after)) ruby-deep-indent-paren)
|
||||
(and (eq (char-after) ?\})
|
||||
(eq 'brace (ruby--point-in-braced-proc))))
|
||||
(not (zerop (car state))))
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 019d11383d10d39aafc7fe4faae101b01c147146
|
Loading…
Add table
Add a link
Reference in a new issue