all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
@ 2013-01-01 12:27 Sayth Renshaw
  2013-01-01 14:24 ` Dmitry Gutov
       [not found] ` <mailman.16475.1357050313.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-01 12:27 UTC (permalink / raw)
  To: help-gnu-emacs

Hi

I have been trying to configure emacs24 now for sometime to be good using ruby 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-kit with ruby loaded, prelude emacs(indents end keyword correctly but does not indent the block) with ruby loaded and cannot get proper indentation, snippets 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 configured.

This is my .emacs(left out references to marmalade etc) I put together using ruby-mode, rinari, rsense and yasnippet.
I get the features of rsense, however I cannot get it to indent correctly or 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-path))
  (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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-01 12:27 Ruby and RubyOn Rails setup - Cannot enable indentation and snippets Sayth Renshaw
@ 2013-01-01 14:24 ` Dmitry Gutov
       [not found] ` <mailman.16475.1357050313.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Dmitry Gutov @ 2013-01-01 14:24 UTC (permalink / raw)
  To: Sayth Renshaw; +Cc: help-gnu-emacs

Hi Sayth,

Sayth Renshaw <flebber.crue@gmail.com> writes:
> I have been trying to configure emacs24 now for sometime to be good using ruby 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.

Please open an .rb file in Emacs, evaluate (M-:) the following
expressions and send the values returned (for long values, you can look
in the *Messages* buffer, or use esk-eval-and-replace from emacs-starter-kit):

major-mode
indent-line-function
(find-library-name "ruby-mode")
emacs-version

> I have tried several variations all done by hand by myself, emacs-starter-kit with ruby loaded, prelude emacs(indents end keyword correctly but does not indent the block) with ruby loaded and cannot get proper indentation, snippets and/or autocompletion. I can get some bits in the installs but it is not ideal.

That sounds positively broken.

> By default Sublime text2 does all this and I cannot manage to emacs configured.
>
> This is my .emacs(left out references to marmalade etc) I put together using ruby-mode, rinari, rsense and yasnippet.
> I get the features of rsense, however I cannot get it to indent correctly or 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

ruby-mode indents that fine out of the box (emacs -Q), no setup
required. No other packages you mentioned mess with indentation, so
there must be something wrong with the setup.

> 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)

The stuff above is largely irrelevant.

> (require 'yasnippet-bundle)

Yasnippet bundles are largely deprecated. I'm not sure if that's the
source of your problem, but if all else fails, try to install yasnippet
from git (https://github.com/capitaomorte/yasnippet/), or from Melpa,
mentioned in the README there.

Also note that in recent versions, all variable and function names have
had slashes replaces with dashes.

> (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)))

There's no reason to set yas/mode-symbol to 'ruby-mode, the major mode
name is already included in the list of symbols to look up.
And since rinari-minor-mode-hook runs after ruby-mode-hook, the value
just gets overwritten.

Do you have a separate rails-mode snippet directory? If not, you can
remove both `add-hook' forms above.

If you do, on the other hand, you need to add its parent directory to
yas-snippet-dirs.

> (setq ruby-indent-level 4)

The example at the beginning of your email has a 2-space indentation.
Why are you setting this to 4?

> (require 'rinari)
> (add-to-list 'load-path "/home/sayth/.emacs.d/rhtml")
> (require 'rhtml-mode)

rhtml-mode is also irrelevant.

> (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))

The above settings are already included in the default Emacs installation.

> (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")

If you installed inf-ruby from Elpa, you can remove these, too.

> (add-hook 'ruby-mode-hook
>     '(lambda ()
>         (inf-ruby-keys)))
>
> (setq load-path (cons (expand-file-name "~/.emacs.d/rails-reloaded") load-path))
>   (require 'rails-autoload)

I'd like know what gave you the impression that installing
rails-reloaded is a good idea. Here's a recent user complaint:

http://stackoverflow.com/questions/13890831/emacs-rails-reloaded-does-not-work

Anyway, since you're having problems with your setup, you should build
it gradually, first make sure the indentation works, then yasnippet,
then code completion, which is the most problematic of the three.

emacs-rails-reloaded, or the original emacs-rails, don't help with any
of those (except for having an additional set of snippets, I guess), so
there's no reason to complicate your config, for now.

> (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)))

This looks good, but in my experience, RSense doesn't work with Rails
projects (or, rather, usually doesn't show any useful completions).
I guess this is listed as "Large project" in the "Limitations" section of
RSense user manual.

*shameless plug warning*

You can try Robe (https://github.com/dgutov/robe) for a less clever, but
more comprehensive completion. It falls back to "all methods in all
classes" approach much more often, though, and should still be
considered WIP.

--Dmitry



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
       [not found] ` <mailman.16475.1357050313.855.help-gnu-emacs@gnu.org>
@ 2013-01-02 13:24   ` Sayth Renshaw
  2013-01-02 14:52     ` Dmitry Gutov
       [not found]     ` <mailman.16528.1357138350.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-02 13:24 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: help-gnu-emacs, Sayth Renshaw

Thanks for the reply

> Please open an .rb file in Emacs, evaluate (M-:) the following 
> expressions and send the values returned (for long values, you can look 
> in the *Messages* buffer, or use esk-eval-and-replace from emacs-starter-kit): 

> major-mode 
> indent-line-function 
> (find-library-name "ruby-mode") 
> emacs-version

The first 3 returned no match and provided no output.
GNU Emacs 24.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.6.1) of 2012-11-17 on buildvm-13.phx2.fedoraproject.org

> I have tried several variations all done by hand by myself, emacs-starter-kit with ruby loaded, prelude emacs(indents end keyword correctly but does not indent the block) with ruby loaded and cannot get proper indentation, snippets and/or autocompletion. I can get some bits in the installs but it is not ideal. 

>> That sounds positively broken.

Should clarify I tried them individually not all at once. When one failed I zipped the .emacs and emacs.d up and started fresh. I have nothing other than my file currently.

> (require 'yasnippet-bundle) 

> try to install yasnippet from git (https://github.com/capitaomorte/yasnippet/), or from Melpa, 
> mentioned in the README there. 

I used marmalade and elpa is that ok?

> (setq ruby-indent-level 4) 

>> The example at the beginning of your email has a 2-space indentation. 
>> Why are you setting this to 4?

just experimenting to try and get some indenting to work.

> rhtml-mode is also irrelevant.

I thought it was the better option of nxhtml and mumamo on linux.

> I'd like know what gave you the impression that installing 
> rails-reloaded is a good idea. Here's a recent user complaint:

Read this article from Nov 2011
http://tuxdna.wordpress.com/2011/11/12/turbocharge-your-emacs-for-ruby-on-rails-with-rinari-and-rails-reloaded/


http://stackoverflow.com/questions/13890831/emacs-rails-reloaded-does-not-work 

*shameless plug warning* 

> You can try Robe (https://github.com/dgutov/robe) for a less clever, but 
> more comprehensive completion. It falls back to "all methods in all 
> classes" approach much more often, though, and should still be 
> considered WIP. 

> --Dmitry

Thanks will look into it

Sayth



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-02 13:24   ` Sayth Renshaw
@ 2013-01-02 14:52     ` Dmitry Gutov
       [not found]     ` <mailman.16528.1357138350.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Dmitry Gutov @ 2013-01-02 14:52 UTC (permalink / raw)
  To: Sayth Renshaw; +Cc: help-gnu-emacs

Sayth Renshaw <flebber.crue@gmail.com> writes:

>> Please open an .rb file in Emacs, evaluate (M-:) the following 
>> expressions and send the values returned (for long values, you can look 
>> in the *Messages* buffer, or use esk-eval-and-replace from emacs-starter-kit): 
>
>> major-mode 
>> indent-line-function 
>> (find-library-name "ruby-mode") 
>> emacs-version
>
> The first 3 returned no match and provided no output.

I think you were pressing `M-x', instead of `M-:' (which should be the
same as `M-S-;' on most keyboards). Alternatively, you can try putting the
cursor at the end of each line above and pressing `C-x C-e'.

So, please try again.

> GNU Emacs 24.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.6.1) of 2012-11-17 on buildvm-13.phx2.fedoraproject.org

Looks good, Emacs 24.2 should handle your example just fine.

>> I have tried several variations all done by hand by myself, emacs-starter-kit
>> with ruby loaded, prelude emacs(indents end keyword correctly but does not
>> indent the block) with ruby loaded and cannot get proper indentation, snippets
>> and/or autocompletion. I can get some bits in the installs but it is not
>> ideal.
>
>>> That sounds positively broken.
>
> Should clarify I tried them individually not all at once. When one failed I
> zipped the .emacs and emacs.d up and started fresh. I have nothing other than my
> file currently.

No, I meant your description of how indentation doesn't work. 

If I were troubleshooting it myself, I'd first start with zero
configuration, verify that indentation works okay (it very well should),
and then add new pieces one by one, watching for the one that breaks it.

By the way, does starting fresh mean that you also removed all installed
ELPA packages? There's an outdated ruby-mode package on Marmalade, which
has been reported to cause some troubles with indentation. But not to
the degree you're describing, though.

>> (require 'yasnippet-bundle) 
>
>> try to install yasnippet from git (https://github.com/capitaomorte/yasnippet/), or from Melpa, 
>> mentioned in the README there. 
>
> I used marmalade and elpa is that ok?

Hmm, if you're using GNU ELPA (the default package repository in Emacs
24), you should be fine. I just noticed it has the updated version (0.8).

But you'll need to install `yasnippet', not `yasnippet-bundle', and
update the configuration (replace "/" with "-", for example).

>> (setq ruby-indent-level 4) 
>
>>> The example at the beginning of your email has a 2-space indentation. 
>>> Why are you setting this to 4?
>
> just experimenting to try and get some indenting to work.

No need to change the default value, which is 2.

>> rhtml-mode is also irrelevant.
>
> I thought it was the better option of nxhtml and mumamo on linux.

I mean it doesn't do anything for pure Ruby files.

I'm not sure it's better, but it's definitely simpler than the other
packages you mentioned.

I have written a `mmm-mode' based package which works better for me than
any of the above, but it's more complicated to set up, a bit slower, and
it requires you to install `mmm-mode' from Melpa.

And see additional instructions in the commentary:

https://github.com/purcell/mmm-mode/blob/master/mmm-erb.el

Again, this is just for template files.

>> I'd like know what gave you the impression that installing 
>> rails-reloaded is a good idea. Here's a recent user complaint:
>
> Read this article from Nov 2011
> http://tuxdna.wordpress.com/2011/11/12/turbocharge-your-emacs-for-ruby-on-rails-with-rinari-and-rails-reloaded/

Thanks, I'll leave a warning comment there.

But the article is more than a year old now, so we can assume that the
author was using Emacs 23 (24.1 was released in June 2012).

Anyway, I hate those kind of articles: describing how to setup, but now
why, or how it will work. The rinari screencast linked there is also
quite old, though less outdated.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
       [not found]     ` <mailman.16528.1357138350.855.help-gnu-emacs@gnu.org>
@ 2013-01-03  6:25       ` Sayth Renshaw
  2013-01-03 14:23         ` Dmitry Gutov
  0 siblings, 1 reply; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-03  6:25 UTC (permalink / raw)
  To: gnu.emacs.help; +Cc: help-gnu-emacs, Sayth Renshaw

On Thursday, 3 January 2013 01:52:03 UTC+11, Dmitry Gutov  wrote:
> 
> >> Please open an .rb file in Emacs, evaluate (M-:) the following 
> 
> >> expressions and send the values returned (for long values, you can look 
> 
> >> in the *Messages* buffer, or use esk-eval-and-replace from emacs-starter-kit): 
> 
> >
> 
> >> major-mode 
> 
> >> indent-line-function 
> 
> >> (find-library-name "ruby-mode") 
> 
> >> emacs-version
> 
> >
> 
> > The first 3 returned no match and provided no output.
> 
> 
> 
> I think you were pressing `M-x', instead of `M-:' (which should be the
> 
> same as `M-S-;' on most keyboards). Alternatively, you can try putting the
> 
> cursor at the end of each line above and pressing `C-x C-e'.
> 
> 
> 
> So, please try again.
> 
> 
> 
> > GNU Emacs 24.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.6.1) of 2012-11-17 on buildvm-13.phx2.fedoraproject.org
> 
> 
> 
> Looks good, Emacs 24.2 should handle your example just fine.
> 
> 
> 
> >> I have tried several variations all done by hand by myself, emacs-starter-kit
> 
> >> with ruby loaded, prelude emacs(indents end keyword correctly but does not
> 
> >> indent the block) with ruby loaded and cannot get proper indentation, snippets
> 
> >> and/or autocompletion. I can get some bits in the installs but it is not
> 
> >> ideal.
> 
> >
> 
> >>> That sounds positively broken.
> 
> >
> 
> > Should clarify I tried them individually not all at once. When one failed I
> 
> > zipped the .emacs and emacs.d up and started fresh. I have nothing other than my
> 
> > file currently.
> 
> 
> 
> No, I meant your description of how indentation doesn't work. 
> 
> 
> 
> If I were troubleshooting it myself, I'd first start with zero
> 
> configuration, verify that indentation works okay (it very well should),
> 
> and then add new pieces one by one, watching for the one that breaks it.
> 
> 
> 
> By the way, does starting fresh mean that you also removed all installed
> 
> ELPA packages? There's an outdated ruby-mode package on Marmalade, which
> 
> has been reported to cause some troubles with indentation. But not to
> 
> the degree you're describing, though.
> 
> 
> 
> >> (require 'yasnippet-bundle) 
> 
> >
> 
> >> try to install yasnippet from git (https://github.com/capitaomorte/yasnippet/), or from Melpa, 
> 
> >> mentioned in the README there. 
> 
> >
> 
> > I used marmalade and elpa is that ok?
> 
> 
> 
> Hmm, if you're using GNU ELPA (the default package repository in Emacs
> 
> 24), you should be fine. I just noticed it has the updated version (0.8).
> 
> 
> 
> But you'll need to install `yasnippet', not `yasnippet-bundle', and
> 
> update the configuration (replace "/" with "-", for example).
> 
> 
> 
> >> (setq ruby-indent-level 4) 
> 
> >
> 
> >>> The example at the beginning of your email has a 2-space indentation. 
> 
> >>> Why are you setting this to 4?
> 
> >
> 
> > just experimenting to try and get some indenting to work.
> 
> 
> 
> No need to change the default value, which is 2.
> 
> 
> 
> >> rhtml-mode is also irrelevant.
> 
> >
> 
> > I thought it was the better option of nxhtml and mumamo on linux.
> 
> 
> 
> I mean it doesn't do anything for pure Ruby files.
> 
> 
> 
> I'm not sure it's better, but it's definitely simpler than the other
> 
> packages you mentioned.
> 
> 
> 
> I have written a `mmm-mode' based package which works better for me than
> 
> any of the above, but it's more complicated to set up, a bit slower, and
> 
> it requires you to install `mmm-mode' from Melpa.
> 
> 
> 
> And see additional instructions in the commentary:
> 
> 
> 
> https://github.com/purcell/mmm-mode/blob/master/mmm-erb.el
> 
> 
> 
> Again, this is just for template files.
> 
> 
> 
> >> I'd like know what gave you the impression that installing 
> 
> >> rails-reloaded is a good idea. Here's a recent user complaint:
> 
> >
> 
> > Read this article from Nov 2011
> 
> > http://tuxdna.wordpress.com/2011/11/12/turbocharge-your-emacs-for-ruby-on-rails-with-rinari-and-rails-reloaded/
> 
> 
> 
> Thanks, I'll leave a warning comment there.
> 
> 
> 
> But the article is more than a year old now, so we can assume that the
> 
> author was using Emacs 23 (24.1 was released in June 2012).
> 
> 
> 
> Anyway, I hate those kind of articles: describing how to setup, but now
> 
> why, or how it will work. The rinari screencast linked there is also
> 
> quite old, though less outdated.


Major-mode 
Debugger entered--Lisp error: (void-variable MAJOR-MODE)
  eval(MAJOR-MODE nil)
  eval-expression(MAJOR-MODE nil)
  call-interactively(eval-expression nil nil)

indent-line-function
ruby-indent-line

(find-library-name "ruby-mode") 
inf-ruby-proc: No current process. See variable inf-ruby-buffer

At this point I have emacs and emacs-starter-kit installed along with starter-kit-ruby and starter-kit-lisp

Sayth



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-03  6:25       ` Sayth Renshaw
@ 2013-01-03 14:23         ` Dmitry Gutov
  2013-01-03 15:15           ` Dmitry Gutov
  0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2013-01-03 14:23 UTC (permalink / raw)
  To: Sayth Renshaw; +Cc: help-gnu-emacs

Sayth Renshaw <flebber.crue@gmail.com> writes:
> Major-mode 
> Debugger entered--Lisp error: (void-variable MAJOR-MODE)
>   eval(MAJOR-MODE nil)
>   eval-expression(MAJOR-MODE nil)
>   call-interactively(eval-expression nil nil)

Why is it in caps? Are you trying to evaluate "MAJOR-MODE"?

> indent-line-function
> ruby-indent-line

...?

> (find-library-name "ruby-mode")

...?

> inf-ruby-proc: No current process. See variable inf-ruby-buffer

Is this you trying to make Robe completion work? Because it does not
look related to the expressions I asked you to evaluate.

> At this point I have emacs and emacs-starter-kit installed along with starter-kit-ruby and starter-kit-lisp

Try uninstalling starter-kit-ruby. Last time I checked, it had problems,
and the author isn't in any hurry to update it.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-03 14:23         ` Dmitry Gutov
@ 2013-01-03 15:15           ` Dmitry Gutov
  2013-01-04 11:11             ` Sayth Renshaw
  0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2013-01-03 15:15 UTC (permalink / raw)
  To: Sayth Renshaw; +Cc: help-gnu-emacs

Dmitry Gutov <dgutov@yandex.ru> writes:

> Sayth Renshaw <flebber.crue@gmail.com> writes:
>> inf-ruby-proc: No current process. See variable inf-ruby-buffer
>
> Is this you trying to make Robe completion work? Because it does not
> look related to the expressions I asked you to evaluate.

Sorry, I've just now realized that this is probably the result of you
typing `C-x C-e' is a ruby-mode buffer with inf-ruby initialized.

inf-ruby rebinds this key combination, but you can do `M-x
eval-last-sexp', or, since you have starter-kit installed,
`M-x esk-eval-and-replace'.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-03 15:15           ` Dmitry Gutov
@ 2013-01-04 11:11             ` Sayth Renshaw
  2013-01-04 16:11               ` Dmitry Gutov
  0 siblings, 1 reply; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-04 11:11 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

>> inf-ruby-proc: No current process. See variable inf-ruby-buffer

> >
> > Is this you trying to make Robe completion work? Because it does not
> > look related to the expressions I asked you to evaluate.
>
> Sorry, I've just now realized that this is probably the result of you
> typing `C-x C-e' is a ruby-mode buffer with inf-ruby initialized.
>
> inf-ruby rebinds this key combination, but you can do `M-x
> eval-last-sexp', or, since you have starter-kit installed,
> `M-x esk-eval-and-replace'.
>

major mode = ruby-mode
indent-line-function = ruby-indent-line

(find-library-name "ruby-mode")
Debugger entered--Lisp error: (void-function find-library-name)
  (find-library-name "ruby-mode")
  eval((find-library-name "ruby-mode") nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp record nil)
  command-execute(eval-last-sexp record)
  smex-read-and-run(("eval-last-sexp" "esk-eval-and-replace"
"package-list-packages" "package-install" "cd" "df" "5x5" "ecb-activate"
"all" "arp" "dbx" "dig" "erc" "ert" "ftp" "gdb" "irc" "jdb" "man" "mpc"
"pdb" "pwd" "rsh" "sdb" "tld" "xdb" "yow" "calc" "diff" "ffap" "ffip"
"gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "ping" "pong"
"rake" "smex" "talk" "term" "undo" "yank" "zone" "align" "bruce" ...))
  smex()
  call-interactively(smex nil nil)

Sayth

[-- Attachment #2: Type: text/html, Size: 2299 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-04 11:11             ` Sayth Renshaw
@ 2013-01-04 16:11               ` Dmitry Gutov
       [not found]                 ` <CAN2of03ausUrsd9LNqoN=r4o3YmD8YF=8ObiHqQxEx4QaUvKHw@mail.gmail.com>
  0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2013-01-04 16:11 UTC (permalink / raw)
  To: Sayth Renshaw; +Cc: help-gnu-emacs

On 04.01.2013 15:11, Sayth Renshaw wrote:
>  >> inf-ruby-proc: No current process. See variable inf-ruby-buffer
>
>      >
>      > Is this you trying to make Robe completion work? Because it does not
>      > look related to the expressions I asked you to evaluate.
>
>     Sorry, I've just now realized that this is probably the result of you
>     typing `C-x C-e' is a ruby-mode buffer with inf-ruby initialized.
>
>     inf-ruby rebinds this key combination, but you can do `M-x
>     eval-last-sexp', or, since you have starter-kit installed,
>     `M-x esk-eval-and-replace'.
>
>
> major mode = ruby-mode
> indent-line-function = ruby-indent-line
>
> (find-library-name "ruby-mode")
> Debugger entered--Lisp error: (void-function find-library-name)
>    (find-library-name "ruby-mode")
>    eval((find-library-name "ruby-mode") nil)
>    eval-last-sexp-1(nil)
>    eval-last-sexp(nil)
>    call-interactively(eval-last-sexp record nil)
>    command-execute(eval-last-sexp record)
>    smex-read-and-run(("eval-last-sexp" "esk-eval-and-replace"
> "package-list-packages" "package-install" "cd" "df" "5x5" "ecb-activate"
> "all" "arp" "dbx" "dig" "erc" "ert" "ftp" "gdb" "irc" "jdb" "man" "mpc"
> "pdb" "pwd" "rsh" "sdb" "tld" "xdb" "yow" "calc" "diff" "ffap" "ffip"
> "gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "ping" "pong"
> "rake" "smex" "talk" "term" "undo" "yank" "zone" "align" "bruce" ...))
>    smex()
>    call-interactively(smex nil nil)

Very well, please evaluate (require 'find-func), and then try the last 
expression again.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
       [not found]                 ` <CAN2of03ausUrsd9LNqoN=r4o3YmD8YF=8ObiHqQxEx4QaUvKHw@mail.gmail.com>
@ 2013-01-05  5:42                   ` Dmitry Gutov
  2013-01-05 12:53                     ` Sayth Renshaw
  0 siblings, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2013-01-05  5:42 UTC (permalink / raw)
  To: Sayth Renshaw, help-gnu-emacs@gnu.org

On 05.01.2013 9:30, Sayth Renshaw wrote:
> Okay so I have removed emacs-starter-kit I have nothing but ruby-mode
> from marmalade installed.

Wonderful. Please uninstall it.

Like I mentioned in one of the previous messages, ruby-mode from 
Marmalade has been reported to cause problems with indentation.

Emacs already has ruby-mode bundled.

And you can reinstall emacs-starter-kit packages (to be safe, better do 
it after you make sure ruby-mode is working), maybe except the Ruby one.

> The outputs of the commands appear to work now but I have no line indenting.
>
> Making completion list...
> ruby-mode
> You can run the command `eval-last-sexp' with C-x C-e
> Mark set [2 times]
> Entering debugger...
> Auto-saving...done
> ruby-mode
> You can run the command `eval-last-sexp' with C-x C-e
> ruby-indent-line
> You can run the command `eval-last-sexp' with C-x C-e

Yep, we've already established the values of major-mode and 
indent-line-function. They are as they should be.

I don't understand why (find-library-name "ruby-mode") still signals 
error, but hopefully after you uninstall ruby-mode from Marmalade the 
problem goes away, so we won't have to dig deeper.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-05  5:42                   ` Dmitry Gutov
@ 2013-01-05 12:53                     ` Sayth Renshaw
  2013-01-05 13:04                       ` Sayth Renshaw
  2013-01-05 14:59                       ` Dmitry Gutov
  0 siblings, 2 replies; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-05 12:53 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]

On Sat, Jan 5, 2013 at 4:42 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:

> On 05.01.2013 9:30, Sayth Renshaw wrote:
>
>> Okay so I have removed emacs-starter-kit I have nothing but ruby-mode
>> from marmalade installed.
>>
>
> Wonderful. Please uninstall it.
>
> Like I mentioned in one of the previous messages, ruby-mode from Marmalade
> has been reported to cause problems with indentation.
>
> Emacs already has ruby-mode bundled.
>
> And you can reinstall emacs-starter-kit packages (to be safe, better do it
> after you make sure ruby-mode is working), maybe except the Ruby one.
>
>
>  The outputs of the commands appear to work now but I have no line
>> indenting.
>>
>> Making completion list...
>> ruby-mode
>> You can run the command `eval-last-sexp' with C-x C-e
>> Mark set [2 times]
>> Entering debugger...
>> Auto-saving...done
>> ruby-mode
>> You can run the command `eval-last-sexp' with C-x C-e
>> ruby-indent-line
>> You can run the command `eval-last-sexp' with C-x C-e
>>
>
> Yep, we've already established the values of major-mode and
> indent-line-function. They are as they should be.
>
> I don't understand why (find-library-name "ruby-mode") still signals
> error, but hopefully after you uninstall ruby-mode from Marmalade the
> problem goes away, so we won't have to dig deeper.
>


After uninstalling ruby-mode the problem still exists

Debugger entered--Lisp error: (void-function find-library-name)
  (find-library-name "ruby-mode")
  eval((find-library-name "ruby-mode") nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)

Sayth

[-- Attachment #2: Type: text/html, Size: 2497 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-05 12:53                     ` Sayth Renshaw
@ 2013-01-05 13:04                       ` Sayth Renshaw
  2013-01-05 14:59                       ` Dmitry Gutov
  1 sibling, 0 replies; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-05 13:04 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1958 bytes --]

On Sat, Jan 5, 2013 at 11:53 PM, Sayth Renshaw <flebber.crue@gmail.com>wrote:

>
>
> On Sat, Jan 5, 2013 at 4:42 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:
>
>> On 05.01.2013 9:30, Sayth Renshaw wrote:
>>
>>> Okay so I have removed emacs-starter-kit I have nothing but ruby-mode
>>> from marmalade installed.
>>>
>>
>> Wonderful. Please uninstall it.
>>
>> Like I mentioned in one of the previous messages, ruby-mode from
>> Marmalade has been reported to cause problems with indentation.
>>
>> Emacs already has ruby-mode bundled.
>>
>> And you can reinstall emacs-starter-kit packages (to be safe, better do
>> it after you make sure ruby-mode is working), maybe except the Ruby one.
>>
>>
>>  The outputs of the commands appear to work now but I have no line
>>> indenting.
>>>
>>> Making completion list...
>>> ruby-mode
>>> You can run the command `eval-last-sexp' with C-x C-e
>>> Mark set [2 times]
>>> Entering debugger...
>>> Auto-saving...done
>>> ruby-mode
>>> You can run the command `eval-last-sexp' with C-x C-e
>>> ruby-indent-line
>>> You can run the command `eval-last-sexp' with C-x C-e
>>>
>>
>> Yep, we've already established the values of major-mode and
>> indent-line-function. They are as they should be.
>>
>> I don't understand why (find-library-name "ruby-mode") still signals
>> error, but hopefully after you uninstall ruby-mode from Marmalade the
>> problem goes away, so we won't have to dig deeper.
>>
>
>
> After uninstalling ruby-mode the problem still exists
>
> Debugger entered--Lisp error: (void-function find-library-name)
>   (find-library-name "ruby-mode")
>   eval((find-library-name "ruby-mode") nil)
>   eval-last-sexp-1(nil)
>   eval-last-sexp(nil)
>   call-interactively(eval-last-sexp t nil)
>   execute-extended-command(nil)
>   call-interactively(execute-extended-command nil nil)
>
> Sayth
>
>
So I installed ruby-mode from melpa and it now works. I installed robe and
ruby-electric all seems to work.

Sayth

[-- Attachment #2: Type: text/html, Size: 3090 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-05 12:53                     ` Sayth Renshaw
  2013-01-05 13:04                       ` Sayth Renshaw
@ 2013-01-05 14:59                       ` Dmitry Gutov
  2013-01-05 21:07                         ` Sayth Renshaw
  1 sibling, 1 reply; 14+ messages in thread
From: Dmitry Gutov @ 2013-01-05 14:59 UTC (permalink / raw)
  To: Sayth Renshaw; +Cc: help-gnu-emacs@gnu.org

On 05.01.2013 16:53, Sayth Renshaw wrote:
>     I don't understand why (find-library-name "ruby-mode") still signals
>     error, but hopefully after you uninstall ruby-mode from Marmalade
>     the problem goes away, so we won't have to dig deeper.
>
>
>
> After uninstalling ruby-mode the problem still exists
>
> Debugger entered--Lisp error: (void-function find-library-name)
>    (find-library-name "ruby-mode")
>    eval((find-library-name "ruby-mode") nil)
>    eval-last-sexp-1(nil)
>    eval-last-sexp(nil)
>    call-interactively(eval-last-sexp t nil)
>    execute-extended-command(nil)
>    call-interactively(execute-extended-command nil nil)

This error says is can't find the function find-library-name, which 
should be fixed with (require 'find-func).

But we're trying to solve the problem with indentation, not this.

 > So I installed ruby-mode from melpa and it now works. I installed 
robe and ruby-electric all seems to work.

Well, that's good. But are you saying that stuff didn't work before you 
installed it?

The Fedora emacs-common package has a byte-compiled ruby-mode included:

http://pkgs.org/fedora-rawhide/fedora-i386/emacs-common-24.2-7.fc19.i686.rpm.html

(Which is, I guess, the reason we couldn't find the library, uncompiled 
sources are in separate package: 
http://pkgs.org/fedora-rawhide/fedora-i386/emacs-el-24.2-7.fc19.noarch.rpm.html)

I guess the ruby-mode from Melpa is good enough for now, but please 
don't forget to uninstall it when Emacs 24.3 comes out.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
  2013-01-05 14:59                       ` Dmitry Gutov
@ 2013-01-05 21:07                         ` Sayth Renshaw
  0 siblings, 0 replies; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-05 21:07 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]

On Sunday, January 6, 2013, Dmitry Gutov wrote:

> On 05.01.2013 16:53, Sayth Renshaw wrote:
>
>>     I don't understand why (find-library-name "ruby-mode") still signals
>>     error, but hopefully after you uninstall ruby-mode from Marmalade
>>     the problem goes away, so we won't have to dig deeper.
>>
>>
>>
>> After uninstalling ruby-mode the problem still exists
>>
>> Debugger entered--Lisp error: (void-function find-library-name)
>>    (find-library-name "ruby-mode")
>>    eval((find-library-name "ruby-mode") nil)
>>    eval-last-sexp-1(nil)
>>    eval-last-sexp(nil)
>>    call-interactively(eval-last-**sexp t nil)
>>    execute-extended-command(nil)
>>    call-interactively(execute-**extended-command nil nil)
>>
>
> This error says is can't find the function find-library-name, which should
> be fixed with (require 'find-func).
>
> But we're trying to solve the problem with indentation, not this.
>
> > So I installed ruby-mode from melpa and it now works. I installed robe
> and ruby-electric all seems to work.
>
> Well, that's good. But are you saying that stuff didn't work before you
> installed it?
>
> The Fedora emacs-common package has a byte-compiled ruby-mode included:
>
> http://pkgs.org/fedora-**rawhide/fedora-i386/emacs-**
> common-24.2-7.fc19.i686.rpm.**html<http://pkgs.org/fedora-rawhide/fedora-i386/emacs-common-24.2-7.fc19.i686.rpm.html>
>
> (Which is, I guess, the reason we couldn't find the library, uncompiled
> sources are in separate package: http://pkgs.org/fedora-**
> rawhide/fedora-i386/emacs-el-**24.2-7.fc19.noarch.rpm.html<http://pkgs.org/fedora-rawhide/fedora-i386/emacs-el-24.2-7.fc19.noarch.rpm.html>
> )
>
> I guess the ruby-mode from Melpa is good enough for now, but please don't
> forget to uninstall it when Emacs 24.3 comes out.
>

Ok

Thanks for your patient help.

Sayth

[-- Attachment #2: Type: text/html, Size: 2404 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-01-05 21:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-01 12:27 Ruby and RubyOn Rails setup - Cannot enable indentation and snippets Sayth Renshaw
2013-01-01 14:24 ` Dmitry Gutov
     [not found] ` <mailman.16475.1357050313.855.help-gnu-emacs@gnu.org>
2013-01-02 13:24   ` Sayth Renshaw
2013-01-02 14:52     ` Dmitry Gutov
     [not found]     ` <mailman.16528.1357138350.855.help-gnu-emacs@gnu.org>
2013-01-03  6:25       ` Sayth Renshaw
2013-01-03 14:23         ` Dmitry Gutov
2013-01-03 15:15           ` Dmitry Gutov
2013-01-04 11:11             ` Sayth Renshaw
2013-01-04 16:11               ` Dmitry Gutov
     [not found]                 ` <CAN2of03ausUrsd9LNqoN=r4o3YmD8YF=8ObiHqQxEx4QaUvKHw@mail.gmail.com>
2013-01-05  5:42                   ` Dmitry Gutov
2013-01-05 12:53                     ` Sayth Renshaw
2013-01-05 13:04                       ` Sayth Renshaw
2013-01-05 14:59                       ` Dmitry Gutov
2013-01-05 21:07                         ` Sayth Renshaw

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.