help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ruby-mode not started automatically


From: Daniel Pittman
Subject: Re: ruby-mode not started automatically
Date: Thu, 20 Jan 2005 16:53:51 +1100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]