Created
May 1, 2009 03:12
-
-
Save znz/104842 to your computer and use it in GitHub Desktop.
rcodetoolsの設定例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq load-path | |
(cons "~/.emacs.d/site-lisp/elisp" load-path)) | |
(require 'auto-complete) | |
(setq-default ac-sources '(ac-source-abbrev ac-source-words-in-buffer)) | |
(global-auto-complete-mode t) | |
(setq ac-auto-start 3) | |
(add-hook | |
'emacs-lisp-mode-hook | |
(lambda () | |
(setq ac-sources '(ac-source-words-in-buffer ac-source-symbols)))) | |
(defconst my-ruby-command (expand-file-name "ruby" "~/opt")) | |
(defvar my-rcodetools-path | |
(shell-command-to-string | |
(concat my-ruby-command | |
" -rubygems" | |
" -e 'print((Gem.searcher.find(%q(rcodetools/xmpfilter)).full_gem_path rescue %q(not found)))'")) | |
"rcodetools gem へのパス") | |
(setq load-path | |
(cons my-rcodetools-path load-path)) | |
(defun my-init-rcodetools () | |
; gem install rcodetools | |
(when (require 'rcodetools nil t) | |
(setq | |
xmpfilter-command-name | |
(concat my-ruby-command " -S xmpfilter --dev --fork --detect-rbtest") | |
rct-doc-command-name | |
(concat my-ruby-command " -S rct-doc --dev --fork --detect-rbtest") | |
rct-complete-command-name | |
(concat my-ruby-command " -S rct-complete --dev --fork --detect-rbtest") | |
ruby-toggle-file-command-name | |
(concat my-ruby-command " -S ruby-toggle-file") | |
rct-fork-command-name | |
(concat my-ruby-command " -S rct-fork")) | |
;(install-elisp "http://www.cx4a.org/pub/auto-complete-ruby.el") | |
(when (require 'auto-complete-ruby nil t) | |
(setq ac-omni-completion-sources | |
'(("\\.\\=" . (ac-source-rcodetools)))) | |
) | |
)) | |
(add-hook 'ruby-mode-hook #'my-init-rcodetools) | |
(autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t) | |
(setq auto-mode-alist | |
(append '(("\\.rb\\'" . ruby-mode)) auto-mode-alist)) | |
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode)) | |
interpreter-mode-alist)) | |
;;; Local Variables: | |
;;; mode: emacs-lisp | |
;;; coding: iso-2022-7bit | |
;;; indent-tabs-mode: nil | |
;;; End: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment