Features: * Management WEBrick - start, stop * Viewing log files * Abbrev from TextMate * Switching between View/Action http://www.emacswiki.org/cgi-bin/emacs/rails.el
I''m new to emacs, how should I enable this mode?
I''ve copied rails.el and all ruby''s el files to
C:\emacs-21.3\lisp\progmodes and edited the .emacs file, but there is
a problem.
I have syntax coloring, but an strange auto-complete, it autocomplete
everything, lisp command, dir and files, etc.
What''s wrong in my conif? May anyone help me, please?
Thanks
Here is my .emacs file:
(custom-set-variables
;; custom-set-variables was added by Custom -- don''t edit or
cut/paste it!
;; Your init file should contain only one such instance.
''(case-fold-search t)
''(current-language-environment "Latin-1")
''(default-frame-alist (quote ((mouse-color . "black")
(tool-bar-lines
. 0) (menu-bar-lines . 1) (background-color . "black")
(foreground-color . "white") (cursor-color . "orange")
(cursor-type .
box) (active-alpha . 0.875) (inactive-alpha . 0.75))))
''(default-input-method "latin-1-prefix")
''(global-font-lock-mode t nil (font-lock))
''(pop-up-frames nil))
(custom-set-faces
;; custom-set-faces was added by Custom -- don''t edit or cut/paste
it!
;; Your init file should contain only one such instance.
''(default ((t (:stipple nil :background "black" :foreground
"white"
:inverse-video nil :box nil :strike-through nil :overline nil
:underline nil :slant normal :weight normal :height 111 :width normal
:family "outline-consolas"))))
''(cursor ((t (:background "orange"))))
''(mouse ((t (:background "black")))))
(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))
(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)
))
;;(require ''ruby-electric)
(require ''rails)
On 2/5/06, dima <dima_exe@mail.ru> wrote:> Features:
> * Management WEBrick - start, stop
> * Viewing log files
> * Abbrev from TextMate
> * Switching between View/Action
>
> http://www.emacswiki.org/cgi-bin/emacs/rails.el
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
dima wrote:> Features: > * Management WEBrick - start, stop > * Viewing log files > * Abbrev from TextMate > * Switching between View/Action > > http://www.emacswiki.org/cgi-bin/emacs/rails.elI love it! Just made some adjustments for rjs templates, keep up the good work! Zsombor -- Company - http://primalgrasp.com Thoughts - http://deezsombor.blogspot.com -------------- next part -------------- A non-text attachment was scrubbed... Name: rails.el Type: text/x-emacs-lisp Size: 14670 bytes Desc: not available Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060205/fdda82c7/rails-0001.bin
Your Lisp coding style is really weird...all those )''s on separate lines ;-). I''m going to love this, because, until now, I have not used a Rails-aware editor. Thanks! Jules -- Posted via http://www.ruby-forum.com/.
Human Dunnil wrote:> I''m new to emacs, how should I enable this mode? > I''ve copied rails.el and all ruby''s el files to > C:\emacs-21.3\lisp\progmodes and edited the .emacs file, but there is > a problem. > I have syntax coloring, but an strange auto-complete, it autocomplete > everything, lisp command, dir and files, etc. > > What''s wrong in my conif? May anyone help me, please? >I do not know in what a problem, just in case here my fragment .emacs -- (autoload ''ruby-mode "ruby-mode" "Ruby editing mode." t) (setq auto-mode-alist (cons ''("\\.rb$" . ruby-mode) auto-mode-alist)) (setq auto-mode-alist (cons ''("\\.rhtml$" . html-mode) auto-mode-alist)) (modify-coding-system-alist ''file "\\.rb$" ''utf-8-dos) (modify-coding-system-alist ''file "\\.rhtml$" ''utf-8-dos) (require ''rails) (add-hook ''ruby-mode-hook (lambda() (add-hook ''local-write-file-hooks ''(lambda() (save-excursion (untabify (point-min) (point-max)) (delete-trailing-whitespace) ))) (set (make-local-variable ''indent-tabs-mode) ''nil) (set (make-local-variable ''tab-width) 2) (imenu-add-to-menubar "IMENU") (require ''ruby-electric) (ruby-electric-mode t) )) -- Posted via http://www.ruby-forum.com/.
dima wrote:> Features: > * Management WEBrick - start, stop > * Viewing log files > * Abbrev from TextMate > * Switching between View/Action > > http://www.emacswiki.org/cgi-bin/emacs/rails.elNew location of a file https://opensvn.csie.org/mvision/emacs/.emacs.d/rails.el Changes: * Added support RJS templates * Added navigation on configuration files in the menu * rails now run a minor-mode -- Posted via http://www.ruby-forum.com/.
dima wrote:> Features: > * Management WEBrick - start, stop > * Viewing log files > * Abbrev from TextMate > * Switching between View/Action > > http://www.emacswiki.org/cgi-bin/emacs/rails.elHm. I''m getting errors when trying to view a log file: Symbol''s function definition is void: rails-make-menu. Any idea how I could fix this? -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
Hello, Stefan Kaes! on 06.02.2006 16:42 > dima wrote: >> Features: >> * Management WEBrick - start, stop >> * Viewing log files >> * Abbrev from TextMate >> * Switching between View/Action >> >> http://www.emacswiki.org/cgi-bin/emacs/rails.el > Hm. I''m getting errors when trying to view a log file: > > Symbol''s function definition is void: rails-make-menu. > > Any idea how I could fix this? Already fixed, update you copy from https://opensvn.csie.org/mvision/emacs/.emacs.d/rails.el
dima wrote:> Hello, Stefan Kaes! > on 06.02.2006 16:42 > > dima wrote: > >> Features: > >> * Management WEBrick - start, stop > >> * Viewing log files > >> * Abbrev from TextMate > >> * Switching between View/Action > >> > >> http://www.emacswiki.org/cgi-bin/emacs/rails.el > > Hm. I''m getting errors when trying to view a log file: > > > > Symbol''s function definition is void: rails-make-menu. > > > > Any idea how I could fix this? > Already fixed, update you copy from > https://opensvn.csie.org/mvision/emacs/.emacs.d/rails.el >hm. now I get: Compiling file c:/Programme/emacs-21.3/site-lisp/rails.el at Tue Feb 07 00:21:06 2006 !! File error (("Cannot open load file" "snippet")) when trying to byte-compile rails.el -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
Hei Stefan! Tue, 07 Feb 2006, Stefan Kaes skrev:> dima wrote: > >Hello, Stefan Kaes! > >on 06.02.2006 16:42 > >> dima wrote: > >>> Features: > >>> * Management WEBrick - start, stop > >>> * Viewing log files > >>> * Abbrev from TextMate > >>> * Switching between View/Action > >>> > >>> http://www.emacswiki.org/cgi-bin/emacs/rails.el > >> Hm. I''m getting errors when trying to view a log file: > >> > >> Symbol''s function definition is void: rails-make-menu. > >> > >> Any idea how I could fix this? > >Already fixed, update you copy from > >https://opensvn.csie.org/mvision/emacs/.emacs.d/rails.el > > > hm. now I get: > > Compiling file c:/Programme/emacs-21.3/site-lisp/rails.el at Tue Feb 07 > 00:21:06 2006 > !! File error (("Cannot open load file" "snippet")) > > when trying to byte-compile rails.el > >~/lisp$ wget http://cryptocracy.hn.org/~cartel/elisp/snippet.el in your .emacs: (load "~/lisp/snippet.el") (load "~/lisp/rails.el") (require ''rails) - Henrik
Henrik Orm?sen wrote:> Hei Stefan! > > Tue, 07 Feb 2006, Stefan Kaes skrev: > >> hm. now I get: >> >> Compiling file c:/Programme/emacs-21.3/site-lisp/rails.el at Tue Feb 07 >> 00:21:06 2006 >> !! File error (("Cannot open load file" "snippet")) >> >> when trying to byte-compile rails.el >> >> >> > > ~/lisp$ wget http://cryptocracy.hn.org/~cartel/elisp/snippet.el > > in your .emacs: > (load "~/lisp/snippet.el") > (load "~/lisp/rails.el") > (require ''rails) > > - Henrik > >Thx. Now I only need a way to get color coding working for log views in emacs ... -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
> Thx. Now I only need a way to get color coding working for log views in > emacs ...If you find out how to make emacs interpret the ANSI codes as colors, please let me know :) cheers Gerret
rails.el is too cool! but I found a bit problem. Although a view path will be set to "adminpage" from camel named controller such as "AdminPageController", it should be "admin_page" in Rails rule. The following patch fixes this problem. http://rails.wota.jp/pubs/patches/rails-el-underscore.patch thanks. -- Maiha -- Posted via http://www.ruby-forum.com/.
On 2/7/06, Gerret Apelt <gerret.apelt@gmail.com> wrote:> > > Thx. Now I only need a way to get color coding working for log views in > > emacs ... > > If you find out how to make emacs interpret the ANSI codes as colors, > please let me know :)There''s ansi-color.el [1]. AFAIK it''s been part of the GNU Emacs distro since v 21. Works for me with shell-mode, but I haven''t tried configuring it with other items (like rails log files). Cheers, /Nick [1] http://www.emacswiki.org/cgi-bin/wiki/ansi-color.el -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060207/141fb030/attachment.html
Hello, Maiha Ishimura! on 07.02.2006 15:21> rails.el is too cool! but I found a bit problem. > > Although a view path will be set to "adminpage" from camel named > controller > such as "AdminPageController", it should be "admin_page" in Rails rule. > > The following patch fixes this problem. > http://rails.wota.jp/pubs/patches/rails-el-underscore.patch > > thanks. > > -- Maiha >I merge you patch. Big thanks!
Hello, Nick Sieger! on 07.02.2006 19:03> > On 2/7/06, *Gerret Apelt* > <gerret.apelt@gmail.com > <mailto:gerret.apelt@gmail.com>> wrote: > > > Thx. Now I only need a way to get color coding working for log > views in > > emacs ... > > If you find out how to make emacs interpret the ANSI codes as colors, > please let me know :) > > > There''s ansi-color.el [1]. AFAIK it''s been part of the GNU Emacs distro > since v 21. Works for me with shell-mode, but I haven''t tried > configuring it with other items (like rails log files). > > Cheers, > /Nick > > [1] http://www.emacswiki.org/cgi-bin/wiki/ansi-color.elThanks for assistance. rails.el now display color logs:)
While we''re on the rails+emacs topic -- I''m still looking for a good way to auto-indent rhtml files in an emacs buffer. Currently I use ruby-mode, ruby-electric and rails mode. rhtml indentation is a real pain to keep like this. If any of you have found a way to auto-indent rhtml I''d love to hear about it. cheers Gerret On 2/7/06, dima <dima.exe@gmail.com> wrote:> Hello, Nick Sieger! > on 07.02.2006 19:03 > > > > On 2/7/06, *Gerret Apelt* > > <gerret.apelt@gmail.com > > <mailto:gerret.apelt@gmail.com>> wrote: > > > > > Thx. Now I only need a way to get color coding working for log > > views in > > > emacs ... > > > > If you find out how to make emacs interpret the ANSI codes as colors, > > please let me know :) > > > > > > There''s ansi-color.el [1]. AFAIK it''s been part of the GNU Emacs distro > > since v 21. Works for me with shell-mode, but I haven''t tried > > configuring it with other items (like rails log files). > > > > Cheers, > > /Nick > > > > [1] http://www.emacswiki.org/cgi-bin/wiki/ansi-color.el > Thanks for assistance. > rails.el now display color logs:) > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Looks terrific. Two nits so far (emacs 21.3.1):
When I hit ''ctrl-t'' I end up with:
"Symbol''s value as variable is void: html-mode-abbrev-table"
the first
time. The second time I hit ctrl-t it works.
Also, I''ve included ''snippet.el'' but can''t
trigger abbreviation
expansion with TAB. Ideas?
--
from my .emacs:
;rails mode
(require ''snippet)
(defun try-complete-abbrev (old)
(if (expand-abbrev) t nil))
(setq hippie-expand-try-functions-list
''(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
(add-hook ''ruby-mode-hook
(lambda()
(add-hook ''local-write-file-hooks
''(lambda()
(save-excursion
(untabify (point-min) (point-max))
(delete-trailing-whitespace)
)))
(set (make-local-variable ''indent-tabs-mode) ''nil)
(set (make-local-variable ''tab-width) 2)
(imenu-add-to-menubar "IMENU")
(require ''ruby-electric)
(ruby-electric-mode t)
))
(require ''rails)
dima exe wrote:> dima wrote:
>
>>Features:
>>* Management WEBrick - start, stop
>>* Viewing log files
>>* Abbrev from TextMate
>>* Switching between View/Action
>>
>>http://www.emacswiki.org/cgi-bin/emacs/rails.el
>
>
> New location of a file
> https://opensvn.csie.org/mvision/emacs/.emacs.d/rails.el
> Changes:
> * Added support RJS templates
> * Added navigation on configuration files in the menu
> * rails now run a minor-mode
>
San wrote :
| Also, I''ve included ''snippet.el'' but can''t
trigger abbreviation
| expansion with TAB. Ideas?
Hi,
In fact I also had a problem to make snippet work with ruby-mode: the
TAB does not work for expansion whereas any other key works. This is
IMHO related to the ruby-mode only (note that I also have problemn with
snippet + c-mode, but not related to the TAB key ;)
--
Frederick Ros aka Sleeper -- sleeper@jabber.fr
Don''t diddle code to make it faster - find a better algorithm.
- The Elements of Programming Style (Kernighan & Plaugher)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060207/72a96c63/attachment.bin
Hello, San! on 08.02.2006 0:02> Looks terrific. Two nits so far (emacs 21.3.1): > > When I hit ''ctrl-t'' I end up with: > > "Symbol''s value as variable is void: html-mode-abbrev-table" the first > time. The second time I hit ctrl-t it works.try add in you .emacs this line, if not exists (setq auto-mode-alist (cons ''("\\.rhtml$" . html-mode) auto-mode-alist))> Also, I''ve included ''snippet.el'' but can''t trigger abbreviation > expansion with TAB. Ideas?rec<press TAB> - not work? Hmm... no ideas I''m using emacs from cvs 22.0.50.1 (2005/11/26), do not see this problem
Hi Dima,>> "Symbol''s value as variable is void: html-mode-abbrev-table" the first >> time. The second time I hit ctrl-t it works. > > try add in you .emacs this line, if not exists > (setq auto-mode-alist (cons ''("\\.rhtml$" . html-mode) auto-mode-alist))Doesn''t help w/ 21.3 or 21.4 Upgrading to CVS HEAD _does_ fix it.>> Also, I''ve included ''snippet.el'' but can''t trigger abbreviation >> expansion with TAB. Ideas? > > > rec<press TAB> - not work?No. (But I sure want it to! ;) > Hmm... no ideas > I''m using emacs from cvs 22.0.50.1 (2005/11/26), do not see this problem I just upgraded to 22.0.50.1, still no luck with TAB I''m also running ECB (Emacs Code Browser). Perhaps there''s a conflict? I tried (kbd "<f8">) instead of (kbd "<tab>") and that works. Though it gets me the crappy minibuffer prompt instead of the cool snippet.el inline mode. Thoughts? (Wishing he was more of an elisp hack) -San
> I tried (kbd "<f8">) instead of (kbd "<tab>") and that works. Though it > gets me the crappy minibuffer prompt instead of the cool snippet.el > inline mode. > > Thoughts?Try to update rails.el I rewrited code working with snippets. There are a lot of changes in this part, of the code. This must help. -- Posted via http://www.ruby-forum.com/.
Ok, some minor troubles:
I added find-recursive.el ok. Then ran into the following:
I commented out the following:
;(find-recursive-directory-relative-files
"Z:/WWW/cms3/ftp/ror/app/"
"" "\\.rb$")
Tried ctrl-T. It gives:
File /sites/foo.com/TAGS is not a valid tags table
But will work the second time.
TAB still doesn''t work. Nor does CTRL-. Rebount <tab> to
<F8> and that
doesn''t work now either.
If I add ruby-electric.el via ''add-hook'':
(add-hook ''ruby-mode-hook
(lambda()
(ruby-electric-mode t)
))
It no longer works when I (require ''rails)
Syntax coloring for ruby-mode is disabled.
Let me know if I can be of more help.
Guest wrote:>>I tried (kbd "<f8">) instead of (kbd
"<tab>") and that works. Though it
>> gets me the crappy minibuffer prompt instead of the cool snippet.el
>>inline mode.
>>
>>Thoughts?
>
>
> Try to update rails.el
>
> I rewrited code working with snippets.
> There are a lot of changes in this part, of the code.
>
> This must help.
>
Hello, San! on 08.02.2006 21:23> Ok, some minor troubles: > > I added find-recursive.el ok. Then ran into the following: > > I commented out the following: > > ;(find-recursive-directory-relative-files "Z:/WWW/cms3/ftp/ror/app/" > "" "\\.rb$")Corrected> Tried ctrl-T. It gives: > > File /sites/foo.com/TAGS is not a valid tags table > > But will work the second time.Corrected> > TAB still doesn''t work. Nor does CTRL-. Rebount <tab> to <F8> and that > doesn''t work now either. > > If I add ruby-electric.el via ''add-hook'': > > (add-hook ''ruby-mode-hook > (lambda() > (ruby-electric-mode t) > )) > > It no longer works when I (require ''rails) > > Syntax coloring for ruby-mode is disabled. > > > Let me know if I can be of more help. >Yet I do not know, from for what it can not work
Hi Dima! Big improvements, we''re super close.
re: syntax highlighting
If I comment out the following line in rails-minor-mode:
;******** uncomment and this breaks highlighting
; (visit-tags-table tags-file-name t)
Then syntax coloring starts to work again. Now I don''t have a TAGS
file setup, so perhaps the function is failing and causing the rest of
the hooks not to run? I''m groking elisp a little now, but not enough.
re: TAB key
I''ve removed ECB and just about everything else in my .emacs file.
binding to <tab> still doesn''t work, but I can bind to <f8>
and that
does work.
Here''s what''s left of my .emacs:
;;----------------------------------------------------------------------------
;; Set up syntax highlighting (font-lock)
;;----------------------------------------------------------------------------
(cond ((fboundp ''global-font-lock-mode)
;; Turn on font-lock in all modes that support it
(global-font-lock-mode t)
;; Maximum colors
(setq font-lock-maximum-decoration t)))
(setq ruby-program-name "/usr/local/bin/ruby")
(autoload ''ruby-mode "ruby-mode" "Mode for editing ruby
source files")
(add-to-list ''auto-mode-alist ''("\.rb$" .
ruby-mode))
(add-to-list ''auto-mode-alist ''("\.rjs$" .
ruby-mode))
(add-to-list ''interpreter-mode-alist ''("ruby" .
ruby-mode))
(require ''ruby-electric)
(defun try-complete-abbrev (old)
(if (expand-abbrev) t nil))
(setq hippie-expand-try-functions-list
''(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
(require ''rails)
(add-hook ''ruby-mode-hook
(lambda()
(ruby-electric-mode t)
))
That''s it... nothing else (removed ECB, etc)
Note: ruby-mode.el and ruby-electric.el are the latest from CVS
CVS HEAD emacs running in text mode under ssh/putty & screen.
Summary:
Broken Stuff:
* No TAB key
* (visit-tags-table) seems to be breaking font-lock
thoughts?
Good stuff:
* abbrevs, snippet replace mode, Ctrl-T and everything else seem to work
great.
rails.el rocks! This completely demotivates me from buying a MacBook ;)
Thanks,
-San
dima wrote:> Hello, San!
> on 08.02.2006 21:23
>
>> Ok, some minor troubles:
>>
>> I added find-recursive.el ok. Then ran into the following:
>>
>> I commented out the following:
>>
>> ;(find-recursive-directory-relative-files
>> "Z:/WWW/cms3/ftp/ror/app/" "" "\\.rb$")
>
>
> Corrected
>
>> Tried ctrl-T. It gives:
>>
>> File /sites/foo.com/TAGS is not a valid tags table
>>
>> But will work the second time.
>
>
> Corrected
>
>>
>> TAB still doesn''t work. Nor does CTRL-. Rebount <tab>
to <F8> and
>> that doesn''t work now either.
>>
>> If I add ruby-electric.el via ''add-hook'':
>>
>> (add-hook ''ruby-mode-hook
>> (lambda()
>> (ruby-electric-mode t)
>> ))
>>
>> It no longer works when I (require ''rails)
>>
>> Syntax coloring for ruby-mode is disabled.
>>
>>
>> Let me know if I can be of more help.
>>
> Yet I do not know, from for what it can not work
Hi Dima,
Here''s a fix to make TAB work:
(local-set-key (kbd "TAB")
''ruby-indent-or-complete)
Just replace ''<tab>'' with ''TAB'' and
all is good. Does that work on your
end too?
I can''t find any docs on the (kbd) function in elisp. (Where does one
find this stuff?)
Best,
-San
dima wrote:> Hello, San!
> on 08.02.2006 21:23
>
>> Ok, some minor troubles:
>>
>> I added find-recursive.el ok. Then ran into the following:
>>
>> I commented out the following:
>>
>> ;(find-recursive-directory-relative-files
>> "Z:/WWW/cms3/ftp/ror/app/" "" "\\.rb$")
>
>
> Corrected
>
>> Tried ctrl-T. It gives:
>>
>> File /sites/foo.com/TAGS is not a valid tags table
>>
>> But will work the second time.
>
>
> Corrected
>
>>
>> TAB still doesn''t work. Nor does CTRL-. Rebount <tab>
to <F8> and
>> that doesn''t work now either.
>>
>> If I add ruby-electric.el via ''add-hook'':
>>
>> (add-hook ''ruby-mode-hook
>> (lambda()
>> (ruby-electric-mode t)
>> ))
>>
>> It no longer works when I (require ''rails)
>>
>> Syntax coloring for ruby-mode is disabled.
>>
>>
>> Let me know if I can be of more help.
>>
> Yet I do not know, from for what it can not work
C-h f kbd RET (local-set-key [tab] ''ruby-indent-or-complete) -Rob At 2/8/2006 08:26 PM, you wrote:>Hi Dima, > >Here''s a fix to make TAB work: > > (local-set-key (kbd "TAB") ''ruby-indent-or-complete) > >Just replace ''<tab>'' with ''TAB'' and all is good. Does that work on >your end too? > >I can''t find any docs on the (kbd) function in elisp. (Where does >one find this stuff?) > >Best, > >-San > > >dima wrote: >>Hello, San! >>on 08.02.2006 21:23 >> >>>Ok, some minor troubles: >>> >>>I added find-recursive.el ok. Then ran into the following: >>> >>>I commented out the following: >>> >>> ;(find-recursive-directory-relative-files >>>"Z:/WWW/cms3/ftp/ror/app/" "" "\\.rb$") >> >>Corrected >> >>>Tried ctrl-T. It gives: >>> >>> File /sites/foo.com/TAGS is not a valid tags table >>> >>> But will work the second time. >> >>Corrected >> >>> >>>TAB still doesn''t work. Nor does CTRL-. Rebount <tab> to <F8> >>>and that doesn''t work now either. >>> >>>If I add ruby-electric.el via ''add-hook'': >>> >>> (add-hook ''ruby-mode-hook >>> (lambda() >>> (ruby-electric-mode t) >>> )) >>> >>> It no longer works when I (require ''rails) >>> >>>Syntax coloring for ruby-mode is disabled. >>> >>> >>>Let me know if I can be of more help. >>Yet I do not know, from for what it can not work > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails
Sweet, thanks Rob.
Dima, these fix the keyboard for me:
(local-set-key (kbd "TAB")
''ruby-indent-or-complete)
(local-set-key (kbd "RET")
''ruby-newline-and-indent)
(local-set-key (kbd "DEL")
''backward-delete-char-untabify)
''<return>'' and ''RET'' are supposed to
be synonomous, but RET works for me
<return> doesn''t.
Emacs + rails.el now bring joy to coding.
-San
Rob Biedenharn wrote:> C-h f kbd RET
>
> (local-set-key [tab] ''ruby-indent-or-complete)
>
>
> -Rob
>
>
> At 2/8/2006 08:26 PM, you wrote:
>
>> Hi Dima,
>>
>> Here''s a fix to make TAB work:
>>
>> (local-set-key (kbd "TAB")
''ruby-indent-or-complete)
>>
>> Just replace ''<tab>'' with
''TAB'' and all is good. Does that work on
>> your end too?
>>
>> I can''t find any docs on the (kbd) function in elisp. (Where
does one
>> find this stuff?)
>>
>> Best,
>>
>> -San
>>
>>
>> dima wrote:
>>
>>> Hello, San!
>>> on 08.02.2006 21:23
>>>
>>>> Ok, some minor troubles:
>>>>
>>>> I added find-recursive.el ok. Then ran into the following:
>>>>
>>>> I commented out the following:
>>>>
>>>> ;(find-recursive-directory-relative-files
>>>> "Z:/WWW/cms3/ftp/ror/app/" ""
"\\.rb$")
>>>
>>>
>>> Corrected
>>>
>>>> Tried ctrl-T. It gives:
>>>>
>>>> File /sites/foo.com/TAGS is not a valid tags table
>>>>
>>>> But will work the second time.
>>>
>>>
>>> Corrected
>>>
>>>>
>>>> TAB still doesn''t work. Nor does CTRL-. Rebount
<tab> to <F8> and
>>>> that doesn''t work now either.
>>>>
>>>> If I add ruby-electric.el via ''add-hook'':
>>>>
>>>> (add-hook ''ruby-mode-hook
>>>> (lambda()
>>>> (ruby-electric-mode t)
>>>> ))
>>>>
>>>> It no longer works when I (require ''rails)
>>>>
>>>> Syntax coloring for ruby-mode is disabled.
>>>>
>>>>
>>>> Let me know if I can be of more help.
>>>
>>> Yet I do not know, from for what it can not work
>>
>>
>> _______________________________________________
>> Rails mailing list
>> Rails@lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails
When you''ve got a few minutes, look at the value of global-map
C-h v global-map RET
In general, the argument is described best under define-key
C-h f define-key RET
But the "vector" is symbols or key values
These should be equivalent:
(local-set-key [tab] ''ruby-indent-or-complete)
(local-set-key "\C-i" ''ruby-indent-or-complete)
(local-set-key [9] ''ruby-indent-or-complete)
(local-set-key [return] ''ruby-newline-and-indent)
(local-set-key "\C-m" ''ruby-newline-and-indent)
(local-set-key [13] ''ruby-newline-and-indent)
These are tricky...
(local-set-key [backspace] ''backward-delete-char-untabify)
;; the [delete] is likely on the number pad
(local-set-key [delete] ''delete-char)
;; take your chances...
(local-set-key "\C-?"
''backward-delete-char-untabify)
You can probably guess what these mean: [f8] [C-f11] [S-f3]
Here''s a good way to figure out was a key IS rather than what it does:
C-h c KEYHERE C-h l
That''s "describe-key-briefly" the key you want (which might
be more
than one!) "view-lossage"
I use "view-lossage" when my fingers remember a command, but I
can''t
;-) (that stuff happens when you''ve used emacs on numerous platforms
over 20 years and your ~/.emacs file is approaching 1000 lines)
-Rob
At 2/8/2006 09:06 PM, you wrote:>Sweet, thanks Rob.
>
>Dima, these fix the keyboard for me:
>
> (local-set-key (kbd "TAB")
''ruby-indent-or-complete)
> (local-set-key (kbd "RET")
''ruby-newline-and-indent)
> (local-set-key (kbd "DEL")
''backward-delete-char-untabify)
>
>''<return>'' and ''RET'' are supposed
to be synonomous, but RET works
>for me <return> doesn''t.
>
>Emacs + rails.el now bring joy to coding.
>
>-San
>
>
>Rob Biedenharn wrote:
>>C-h f kbd RET
>>(local-set-key [tab] ''ruby-indent-or-complete)
>>
>>-Rob
>>
>>At 2/8/2006 08:26 PM, you wrote:
>>
>>>Hi Dima,
>>>
>>>Here''s a fix to make TAB work:
>>>
>>> (local-set-key (kbd "TAB")
''ruby-indent-or-complete)
>>>
>>>Just replace ''<tab>'' with
''TAB'' and all is good. Does that work
>>>on your end too?
>>>
>>>I can''t find any docs on the (kbd) function in elisp.
(Where does
>>>one find this stuff?)
>>>
>>>Best,
>>>
>>>-San
>>>
>>>
>>>dima wrote:
>>>
>>>>Hello, San!
>>>>on 08.02.2006 21:23
>>>>
>>>>>Ok, some minor troubles:
>>>>>
>>>>>I added find-recursive.el ok. Then ran into the following:
>>>>>
>>>>>I commented out the following:
>>>>>
>>>>> ;(find-recursive-directory-relative-files
>>>>>"Z:/WWW/cms3/ftp/ror/app/" ""
"\\.rb$")
>>>>
>>>>
>>>>Corrected
>>>>
>>>>>Tried ctrl-T. It gives:
>>>>>
>>>>> File /sites/foo.com/TAGS is not a valid tags table
>>>>>
>>>>> But will work the second time.
>>>>
>>>>
>>>>Corrected
>>>>
>>>>>
>>>>>TAB still doesn''t work. Nor does CTRL-. Rebount
<tab> to <F8>
>>>>>and that doesn''t work now either.
>>>>>
>>>>>If I add ruby-electric.el via ''add-hook'':
>>>>>
>>>>> (add-hook ''ruby-mode-hook
>>>>> (lambda()
>>>>> (ruby-electric-mode t)
>>>>> ))
>>>>>
>>>>> It no longer works when I (require ''rails)
>>>>>
>>>>>Syntax coloring for ruby-mode is disabled.
>>>>>
>>>>>
>>>>>Let me know if I can be of more help.
>>>>
>>>>Yet I do not know, from for what it can not work
>>>
>>>
>>>_______________________________________________
>>>Rails mailing list
>>>Rails@lists.rubyonrails.org
>>>http://lists.rubyonrails.org/mailman/listinfo/rails
>
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails
dima wrote:> Hello, Nick Sieger! > on 07.02.2006 19:03 >> >> On 2/7/06, *Gerret Apelt* <gerret.apelt@gmail.com >> <mailto:gerret.apelt@gmail.com>> wrote: >> >> > Thx. Now I only need a way to get color coding working for log >> views in >> > emacs ... >> >> If you find out how to make emacs interpret the ANSI codes as >> colors, >> please let me know :) >> >> >> There''s ansi-color.el [1]. AFAIK it''s been part of the GNU Emacs >> distro since v 21. Works for me with shell-mode, but I haven''t tried >> configuring it with other items (like rails log files). >> >> Cheers, >> /Nick >> >> [1] http://www.emacswiki.org/cgi-bin/wiki/ansi-color.el > Thanks for assistance. > rails.el now display color logs:)Cool. -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
With the most recent change I''m getting a ''Symbol''s
function
definition is void: posn-at-point'' when I try to Ctr-t in a
controller method. I''m running a clean build of GnuEmacs 21.4.1 with
ECB installed. I could also use a few pointers for getting my .rhtml
files to behave properly with expansion/tabbing. Here''s my .emacs:
------------------------------------------------
(add-to-list ''load-path
"/opt/emacs")
(setq x-select-request-type ''(UTF8_STRING COMPOUND_TEXT TEXT STRING))
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function ''x-cut-buffer-or-selection-value)
(load-file "/opt/emacs/common/cedet.el")
;; Enabling various SEMANTIC minor modes. See semantic/INSTALL for more ideas.
;; Select one of the following
(semantic-load-enable-code-helpers)
;; (semantic-load-enable-guady-code-helpers)
;; (semantic-load-enable-excessive-code-helpers)
;; Enable this if you develop in semantic, or develop grammars
;; (semantic-load-enable-semantic-debugging-helpers)
(require ''ecb-autoloads)
(custom-set-variables
;; custom-set-variables was added by Custom -- don''t edit or
cut/paste it!
;; Your init file should contain only one such instance.
''(case-fold-search t)
''(current-language-environment "Latin-1")
''(default-input-method "latin-1-prefix")
''(ecb-kill-buffer-clears-history (quote auto))
''(ecb-layout-name "left5")
''(ecb-layout-window-sizes (quote (("left5"
(0.15355805243445692 .
0.2823529411764706) (0.15355805243445692 . 0.32941176470588235)
(0.15355805243445692 . 0.3411764705882353)) ("left8"
(0.1647940074906367 . 0.25882352941176473) (0.1647940074906367 .
0.23529411764705882) (0.1647940074906367 . 0.2) (0.1647940074906367 .
0.25882352941176473)))))
''(ecb-maximize-ecb-window-after-selection t)
''(ecb-options-version "2.32")
''(ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
''(ecb-redraw-layout-quickly t)
''(ecb-source-path (quote (("/" "/")
("/var/www/ceivecms" "CeiveCMS")
("/var/www/allenmortuary" "AllenMortuary"))))
''(ecb-tip-of-the-day nil)
''(ecb-tree-buffer-style (quote image))
''(ecb-tree-expand-symbol-before nil)
''(ecb-windows-height 0.5)
''(global-font-lock-mode t nil (font-lock))
''(mouse-wheel-mode t nil (mwheel)))
(custom-set-faces
;; custom-set-faces was added by Custom -- don''t edit or cut/paste it!
;; Your init file should contain only one such instance.
)
(global-set-key "\M-g" ''goto-line)
(defun try-complete-abbrev (old)
(if (expand-abbrev) t nil))
(setq hippie-expand-try-functions-list
''(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
(setq interpreter-mode-alist
(cons ''("ruby" . ruby-mode) interpreter-mode-alist))
(setq auto-mode-alist
(cons ''("\\.rb$" . ruby-mode) auto-mode-alist))
(autoload ''ruby-mode "ruby-mode" nil t)
(require ''rails)
---------------------------------------