From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: auto-mode-alist, adding two modes Date: 8 Oct 2007 18:20:15 GMT Message-ID: References: <878x6dboyn.fsf@hillenius.net> <87ejg57apj.fsf@hillenius.net> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1191868854 2618 80.91.229.12 (8 Oct 2007 18:40:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Oct 2007 18:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 08 20:40:51 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IexX0-0002ZB-6j for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Oct 2007 20:40:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IexWu-0006VY-Oq for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Oct 2007 14:40:36 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-X-Trace: individual.net erYsXwgnnqiCPCUdaQvGUAiO09K/O+xJFWYqSUK/QAO/uO/j8+ Cancel-Lock: sha1:VexArJcWHKiOlwpaWUm7oExFo1Y= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/0.9.8.1 (Linux) Original-Xref: shelby.stanford.edu gnu.emacs.help:152714 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: news.gmane.org gmane.emacs.help:48220 Archived-At: Gijs Hillenius wrote: > I do *not* want to add both of these minor modes to text-mode, for > this messes up other applications, such as my dear gnus. > > So, I settled on > > (add-to-list 'auto-mode-alist '("\\.txt\\'" . longlines-mode )) however, this is just plain wrong. auto-mode-alist is for *major* modes, and longlines-mode is not a major mode. while it may work right now, chances are it'll come back to bite you at some point in the future, and may then be all the harder to debug, because you're doing something that's not intended. > (add-hook 'longlines-mode-hook 'flyspell-mode) > > The latter of which, if I understand it correctly, adds a fly-spell > wherever I have longlines-mode. Which is something I can live with, > for now. yes, that is what it does. if you don't want to add longlines-mode and flyspell-mode to text-mode-hook, there is always the possibility to create a derived major mode, which is easier than you might think: (define-derived-mode my-text-mode text-mode "Text" "Modified text-mode, includes longlines-mode and flyspell-mode" (longlines-mode 1) (flyspell-mode 1)) then: (add-to-list 'auto-mode-alist '("\\.txt\'" . my-text-mode)) this should do what you want without messing up gnus. HTH -- Joost Kremers joostkremers@yahoo.com Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)