From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sergei Gnezdov Newsgroups: gmane.emacs.help Subject: Re: ruby-mode not started automatically Date: Thu, 20 Jan 2005 03:41:00 +0000 (UTC) Message-ID: References: Reply-To: sgnezdov@sergei.homeunix.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1106195006 6336 80.91.229.6 (20 Jan 2005 04:23:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Jan 2005 04:23:26 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 20 05:23:22 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 1CrTqr-0003BA-00 for ; Thu, 20 Jan 2005 05:23:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CrU2q-0000Y2-TE for geh-help-gnu-emacs@m.gmane.org; Wed, 19 Jan 2005 23:35:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CrU0d-0007Eg-DE for help-gnu-emacs@gnu.org; Wed, 19 Jan 2005 23:33:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CrTx6-0005bl-Fp for help-gnu-emacs@gnu.org; Wed, 19 Jan 2005 23:29:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CrTx3-0005TN-Jx for help-gnu-emacs@gnu.org; Wed, 19 Jan 2005 23:29:45 -0500 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CrTN8-0001PZ-9u for help-gnu-emacs@gnu.org; Wed, 19 Jan 2005 22:52:38 -0500 Original-Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CrTN2-0004FH-00 for ; Thu, 20 Jan 2005 04:52:32 +0100 Original-Received: from 207-224-118-87.spkn.qwest.net ([207.224.118.87]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Jan 2005 04:52:32 +0100 Original-Received: from sgnezdov by 207-224-118-87.spkn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Jan 2005 04:52:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 30 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207-224-118-87.spkn.qwest.net User-Agent: slrn/0.9.8.1 (FreeBSD) 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:23494 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23494 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.