From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.help Subject: Re: ruby-mode not started automatically Date: Thu, 20 Jan 2005 16:53:51 +1100 Message-ID: <87wtu863yo.fsf@enki.rimspace.net> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1106201994 19126 80.91.229.6 (20 Jan 2005 06:19:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Jan 2005 06:19:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 20 07:19:48 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CrVfY-00084v-00 for ; Thu, 20 Jan 2005 07:19:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CrVrW-0005EN-J6 for geh-help-gnu-emacs@m.gmane.org; Thu, 20 Jan 2005 01:32:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CrVm5-0002Lq-Sm for help-gnu-emacs@gnu.org; Thu, 20 Jan 2005 01:26:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CrVlu-0002Eq-Mw for help-gnu-emacs@gnu.org; Thu, 20 Jan 2005 01:26:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CrVlu-000296-IF for help-gnu-emacs@gnu.org; Thu, 20 Jan 2005 01:26:22 -0500 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CrVP5-00019Q-5d for help-gnu-emacs@gnu.org; Thu, 20 Jan 2005 01:02:47 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CrVP4-00085k-00 for ; Thu, 20 Jan 2005 07:02:46 +0100 Original-Received: from 203-217-29-45.perm.iinet.net.au ([203.217.29.45]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Jan 2005 07:02:45 +0100 Original-Received: from daniel by 203-217-29-45.perm.iinet.net.au with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Jan 2005 07:02:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 43 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 203-217-29-45.perm.iinet.net.au User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:EWFGiOWCFBqFQn4K4PUx1l+nILc= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:23496 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23496 On 20 Jan 2005, Sergei Gnezdov wrote: > On 2003-06-18, Lute Kamstra wrote: >> David Wende 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