From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Peter Milliken" Newsgroups: gmane.emacs.help Subject: Re: Best way to turn on a mode *always*? Date: Mon, 1 Dec 2008 09:02:27 +1100 Message-ID: <791153ba0811301402xca180b5wcc64dd0b1944a79f@mail.gmail.com> References: <5f7c7fc4-ddae-44ba-8d09-b668f3343900@q26g2000prq.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_82033_1779979.1228082547496" X-Trace: ger.gmane.org 1228082589 21430 80.91.229.12 (30 Nov 2008 22:03:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2008 22:03:09 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 30 23:04:12 2008 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 1L6uOg-0001gV-QY for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Nov 2008 23:04:11 +0100 Original-Received: from localhost ([127.0.0.1]:37680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6uNW-00053Z-QN for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Nov 2008 17:02:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6uN8-00050d-KV for help-gnu-emacs@gnu.org; Sun, 30 Nov 2008 17:02:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6uN7-0004xK-0f for help-gnu-emacs@gnu.org; Sun, 30 Nov 2008 17:02:34 -0500 Original-Received: from [199.232.76.173] (port=54692 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6uN6-0004x0-KN for help-gnu-emacs@gnu.org; Sun, 30 Nov 2008 17:02:32 -0500 Original-Received: from ug-out-1314.google.com ([66.249.92.168]:25061) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6uN5-0003J3-Rx for help-gnu-emacs@gnu.org; Sun, 30 Nov 2008 17:02:32 -0500 Original-Received: by ug-out-1314.google.com with SMTP id 36so2751079uga.17 for ; Sun, 30 Nov 2008 14:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=kqzfP3HuwKctruUiY/RerXAXeUSvEQ4q4NXB1ENPm2Y=; b=i76kHVkp3qupqepZzGOWmHdkL412y0VnHVRw/++KxHDACyLfhZQM9qz7rEJE32jTM2 5GY3V+9Axl/WV0WosIG7pErLl85mJ+AjV2dOlxP57Ov1aXSgm9AEjizGbnH+AKq/auI4 zGAeLRD8I7ibPK8MiWcPwSWTGku4nYe5wWSAk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=GiblVRzRkqFqp0LM/t/a4FumgVaQDLoK36UYMbbLO5M2cm1pcR9n53C3nd4PRWJy5+ TnfFsiGW2QwHvo4UykIobRvODtb5WFdJEEVUEw9RdUyP2WXm52fnzig1OpIgKpkUyUcv RnW1nkuUxT/Y8yMaN0xAmpyYkvNfPgAfNXX6A= Original-Received: by 10.103.11.7 with SMTP id o7mr4221082mui.103.1228082547505; Sun, 30 Nov 2008 14:02:27 -0800 (PST) Original-Received: by 10.103.218.14 with HTTP; Sun, 30 Nov 2008 14:02:27 -0800 (PST) In-Reply-To: <5f7c7fc4-ddae-44ba-8d09-b668f3343900@q26g2000prq.googlegroups.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:60267 Archived-At: ------=_Part_82033_1779979.1228082547496 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline There is probably some global way to set it ALWAYS but... I define a lambda function that I hook in for all my major modes and then put all the stuff I want turned on in it i.e. the following is typical of what I have in my .emacs (add-hook 'ada-mode-hook (lambda () ;; add your customizations here... this can set ;; variables, turn on minor modes, etc. (tmmofl-mode) (show-paren-mode) (else-mode) (setq else-follow-menus nil))) Since I only ever look at a limited set of file types i.e. major modes, this has worked perfectly well for me. Peter On Mon, Dec 1, 2008 at 5:18 AM, seberino@spawar.navy.mil < seberino@spawar.navy.mil> wrote: > Some modes like Auto Fill mode only get turned on for a specific > buffer. > When you change buffers you are NOT in Auto Fill mode anymore! > > How turn on a mode ALWAYS? > > This works but I wonder if there is a simpler way that will work for > other modes: > > (add-hook 'find-file-hooks 'turn-on-auto-fill) > > Chris > ------=_Part_82033_1779979.1228082547496 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline There is probably some global way to set it ALWAYS but...

I define a lambda function that I hook in for all my major modes and then put all the stuff I want turned on in it i.e. the following is typical of what I have in my .emacs

(add-hook 'ada-mode-hook
          (lambda ()
            ;; add your customizations here... this can set
            ;; variables, turn on minor modes, etc.
            (tmmofl-mode)
            (show-paren-mode)
            (else-mode)
            (setq else-follow-menus nil)))

Since I only ever look at a limited set of file types i.e. major modes, this has worked perfectly well for me.

Peter

On Mon, Dec 1, 2008 at 5:18 AM, seberino@spawar.navy.mil <seberino@spawar.navy.mil> wrote:
Some modes like Auto Fill mode only get turned on for a specific
buffer.
When you change buffers you are NOT in Auto Fill mode anymore!

How turn on a mode ALWAYS?

This works but I wonder if there is a simpler way that will work for
other modes:

(add-hook 'find-file-hooks 'turn-on-auto-fill)

Chris

------=_Part_82033_1779979.1228082547496--