From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sayth Renshaw Newsgroups: gmane.emacs.help Subject: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets Date: Tue, 1 Jan 2013 04:27:00 -0800 (PST) Message-ID: <558f5257-18a8-46c4-8a41-71ea6066449e@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1357043420 13185 80.91.229.3 (1 Jan 2013 12:30:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Jan 2013 12:30:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 01 13:30:37 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tq0zH-0004gi-DB for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jan 2013 13:30:31 +0100 Original-Received: from localhost ([::1]:56464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tq0z2-0002Jb-C0 for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jan 2013 07:30:16 -0500 X-Received: by 10.68.138.14 with SMTP id qm14mr6641556pbb.5.1357043220891; Tue, 01 Jan 2013 04:27:00 -0800 (PST) Original-Received: by 10.50.53.168 with SMTP id c8mr10529466igp.17.1357043220850; Tue, 01 Jan 2013 04:27:00 -0800 (PST) Original-Path: usenet.stanford.edu!kr7no12419715pbb.0!news-out.google.com!s9ni72755pbb.0!nntp.google.com!f6no3718407pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=121.218.172.241; posting-account=5Cd8QAoAAAC6AxpkrISTgUBJ9ktgwNBm Original-NNTP-Posting-Host: 121.218.172.241 User-Agent: G2/1.0 Injection-Date: Tue, 01 Jan 2013 12:27:00 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:196070 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:88381 Archived-At: Hi I have been trying to configure emacs24 now for sometime to be good using r= uby and later rails. I am on Fedora 18. Well the biggest issue I have is that emacs will not indent ruby correctly,= well it doesn't indent at all. I have tried several variations all done by hand by myself, emacs-starter-k= it with ruby loaded, prelude emacs(indents end keyword correctly but does n= ot indent the block) with ruby loaded and cannot get proper indentation, sn= ippets and/or autocompletion. I can get some bits in the installs but it is= not ideal. By default Sublime text2 does all this and I cannot manage to emacs configu= red. This is my .emacs(left out references to marmalade etc) I put together usin= g ruby-mode, rinari, rsense and yasnippet. I get the features of rsense, however I cannot get it to indent correctly o= r have yasnippet insert snippet from tab press. Example indentation Correct multi_array.each do x.each do |y| puts y end end Emacs multi_array.each do x.each do |y| puts y end end If anyone can advise on what to improve it would be greatly appreciated. (setq-default indent-tabs-mode nil) ; use only spaces and no tabs (setq default-tab-width 4) (require 'pep8) (require 'pylint) ;; org mode (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) (global-set-key "\C-cl" 'org-store-link) (global-set-key "\C-cc" 'org-capture) (global-set-key "\C-ca" 'org-agenda) (global-set-key "\C-cb" 'org-iswitchb) (require 'yasnippet-bundle) (yas/global-mode) (add-hook 'rinari-minor-mode-hook #'(lambda () (setq yas/mode-symbol 'rails-mode))) (add-hook 'ruby-mode-hook #'(lambda () (setq yas/mode-symbol 'ruby-mode))) (setq ruby-indent-level 4) (require 'rinari) (add-to-list 'load-path "/home/sayth/.emacs.d/rhtml") (require 'rhtml-mode) (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files") (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode)) (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process") (autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby in ruby-mode") (add-hook 'ruby-mode-hook '(lambda () (inf-ruby-keys))) (setq load-path (cons (expand-file-name "~/.emacs.d/rails-reloaded") load-p= ath)) (require 'rails-autoload) (setq rsense-home "/home/sayth/opt/rsense-0.3") (add-to-list 'load-path (concat rsense-home "/etc")) (require 'rsense) (add-hook 'ruby-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-rsense-method) (add-to-list 'ac-sources 'ac-source-rsense-constant))) Sayth