* ruby-mode not started automatically
@ 2003-06-18 14:45 David Wende
0 siblings, 0 replies; 7+ messages in thread
From: David Wende @ 2003-06-18 14:45 UTC (permalink / raw)
Using emacs 21.2.1 under Win2K.
Problem:
When I visit a ruby file (*.rb) the
ruby mode is NOT entered automatically.
The file "ruby-mode.el" is apparently in the correct
place since a doing
M-: (load "ruby-mode")
does work and start the mode.
I have the following 2 lines in my .emacs
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(autoload 'ruby-mode "Ruby mode" "Ruby mode" t)
but this apparently does not work.
HELP!!
David Wende
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ruby-mode not started automatically
[not found] <mailman.8153.1055944086.21513.help-gnu-emacs@gnu.org>
@ 2003-06-18 14:50 ` Lute Kamstra
2005-01-20 3:41 ` Sergei Gnezdov
2003-06-18 15:05 ` John Paul Wallington
2003-06-18 16:34 ` Kai Großjohann
2 siblings, 1 reply; 7+ messages in thread
From: Lute Kamstra @ 2003-06-18 14:50 UTC (permalink / raw)
David Wende <dwende@lynxpn.com> writes:
> Using emacs 21.2.1 under Win2K.
>
> Problem:
> When I visit a ruby file (*.rb) the
> ruby mode is NOT entered automatically.
>
> The file "ruby-mode.el" is apparently in the correct
> place since a doing
>
> M-: (load "ruby-mode")
>
> does work and start the mode.
>
> I have the following 2 lines in my .emacs
>
> (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
> (autoload 'ruby-mode "Ruby mode" "Ruby mode" t)
>
> but this apparently does not work.
Does this work?
(add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
(autoload 'ruby-mode "ruby-mode" "Ruby mode" t)
Lute.
--
(spook) => "S Box jihad supercomputer"
(insert-file-contents "~/.signature") => (error "`~/.signature' too rude")
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ruby-mode not started automatically
[not found] <mailman.8153.1055944086.21513.help-gnu-emacs@gnu.org>
2003-06-18 14:50 ` Lute Kamstra
@ 2003-06-18 15:05 ` John Paul Wallington
2003-06-18 16:34 ` Kai Großjohann
2 siblings, 0 replies; 7+ messages in thread
From: John Paul Wallington @ 2003-06-18 15:05 UTC (permalink / raw)
David Wende <dwende@lynxpn.com> wrote:
> M-: (load "ruby-mode")
>
> does work and start the mode.
>
> I have the following 2 lines in my .emacs
>
> (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
> (autoload 'ruby-mode "Ruby mode" "Ruby mode" t)
> but this apparently does not work.
The second arg to `autoload' is the file name string of the emacs lisp
library to pass to `load'. It shouldn't be "Ruby mode"; try
"ruby-mode" instead.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ruby-mode not started automatically
[not found] <mailman.8153.1055944086.21513.help-gnu-emacs@gnu.org>
2003-06-18 14:50 ` Lute Kamstra
2003-06-18 15:05 ` John Paul Wallington
@ 2003-06-18 16:34 ` Kai Großjohann
2 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2003-06-18 16:34 UTC (permalink / raw)
David Wende <dwende@lynxpn.com> writes:
> (autoload 'ruby-mode "Ruby mode" "Ruby mode" t)
This tells it to load the function ruby-mode from a file called
Ruby mode.el
I guess you don't have that file. It is named ruby-mode.el instead.
--
This line is not blank.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ruby-mode not started automatically
2003-06-18 14:50 ` Lute Kamstra
@ 2005-01-20 3:41 ` Sergei Gnezdov
2005-01-20 5:53 ` Daniel Pittman
2005-01-20 10:23 ` Peter Dyballa
0 siblings, 2 replies; 7+ messages in thread
From: Sergei Gnezdov @ 2005-01-20 3:41 UTC (permalink / raw)
On 2003-06-18, Lute Kamstra <Lute.Kamstra@cwi.nl> wrote:
> David Wende <dwende@lynxpn.com> writes:
>
>> Using emacs 21.2.1 under Win2K.
>>
>> Problem:
>> When I visit a ruby file (*.rb) the
>> ruby mode is NOT entered automatically.
[snip]
> Does this work?
>
> (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
> (autoload 'ruby-mode "ruby-mode" "Ruby mode" t)
The two lines above work great. What's the difference when compared
with the following solution:
;; make ruby-mode available to emacs
(require 'ruby-mode)
;; autodetect mode by extension
(setq auto-mode-alist
(append
'(
("\\.rb\\'" . ruby-mode)
;; append any other modes here
)
auto-mode-alist))
The auto-mode-alist configuration is significantly longer in this
case.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ruby-mode not started automatically
2005-01-20 3:41 ` Sergei Gnezdov
@ 2005-01-20 5:53 ` Daniel Pittman
2005-01-20 10:23 ` Peter Dyballa
1 sibling, 0 replies; 7+ messages in thread
From: Daniel Pittman @ 2005-01-20 5:53 UTC (permalink / raw)
On 20 Jan 2005, Sergei Gnezdov wrote:
> On 2003-06-18, Lute Kamstra <Lute.Kamstra@cwi.nl> wrote:
>> David Wende <dwende@lynxpn.com> writes:
>>
>>> Using emacs 21.2.1 under Win2K.
>>>
>>> Problem:
>>> When I visit a ruby file (*.rb) the
>>> ruby mode is NOT entered automatically.
> [snip]
>> Does this work?
>>
>> (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
>> (autoload 'ruby-mode "ruby-mode" "Ruby mode" t)
>
> The two lines above work great. What's the difference when compared
> with the following solution:
>
> ;; make ruby-mode available to emacs
> (require 'ruby-mode)
> ;; autodetect mode by extension
> (setq auto-mode-alist
> (append
> '(
> ("\\.rb\\'" . ruby-mode)
> ;; append any other modes here
> )
> auto-mode-alist))
>
> The auto-mode-alist configuration is significantly longer in this
> case.
Aside from the very odd spacing, the second solution is a very wordy
version of the first.
If you look at the definition of the `add-to-list' function, using
'C-h f', you will see that it appends the value to the end of a list...
Regards,
Daniel
--
Can nature possibly be as absurd as it seemed to us in these atomic experiments?
-- Werner Heisenberg
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ruby-mode not started automatically
2005-01-20 3:41 ` Sergei Gnezdov
2005-01-20 5:53 ` Daniel Pittman
@ 2005-01-20 10:23 ` Peter Dyballa
1 sibling, 0 replies; 7+ messages in thread
From: Peter Dyballa @ 2005-01-20 10:23 UTC (permalink / raw)
Cc: help-gnu-emacs
Am 20.01.2005 um 04:41 schrieb Sergei Gnezdov:
> ;; make ruby-mode available to emacs
> (require 'ruby-mode)
require loads Emacs Lisp code when this statement is executed, at
startup for example. The autoload example loads the same when it's
needed (for ruby-mode). Using autoload keeps startup time short and
memory usage small.
> ;; autodetect mode by extension
> (setq auto-mode-alist
> (append
> '(
> ("\\.rb\\'" . ruby-mode)
> ;; append any other modes here
> )
> auto-mode-alist))
Using the following construct allows you to edit auto-mode-alist in one
place instead of having a dozen snippets scattered around:
(setq auto-mode-alist
(append
'(("\\.xsl$" . sgml-mode)
("\\.plist$" . sgml-mode)
("\\.idd$" . sgml-mode)
("\\.ide$" . sgml-mode)
("\\.rb$" . ruby-mode)
("\\.xml$" . xml-mode)
("\\.xsl$" . xml-mode)
("\\.fo$" . xml-mode)
("\\.f90$" . f90-mode)
("\\.tgz$" . tar-mode)
("\\.tar\\.bz2$" . tar-mode)
("\\.tar\\.gz$" . tar-mode))
auto-mode-alist))
--
Greetings
Pete
Remember: use logout to logout.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-01-20 10:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-18 14:45 ruby-mode not started automatically David Wende
[not found] <mailman.8153.1055944086.21513.help-gnu-emacs@gnu.org>
2003-06-18 14:50 ` Lute Kamstra
2005-01-20 3:41 ` Sergei Gnezdov
2005-01-20 5:53 ` Daniel Pittman
2005-01-20 10:23 ` Peter Dyballa
2003-06-18 15:05 ` John Paul Wallington
2003-06-18 16:34 ` Kai Großjohann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).