From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Robert Thorpe" Newsgroups: gmane.emacs.help Subject: Re: How to apply a minor mode to all buffers Date: 20 Jan 2007 09:38:08 -0800 Organization: http://groups.google.com Message-ID: <1169314688.257876.13620@q2g2000cwa.googlegroups.com> References: <877ivkjb66.fsf@trick.ulm.malte.spiess> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1169314837 17384 80.91.229.12 (20 Jan 2007 17:40:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 20 Jan 2007 17:40:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 20 18:40:34 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 1H8KCa-00005G-A3 for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Jan 2007 18:40:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H8KCa-0007qf-F6 for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Jan 2007 12:40:28 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!q2g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: 213.94.228.213 Original-X-Trace: posting.google.com 1169314698 29357 127.0.0.1 (20 Jan 2007 17:38:18 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 20 Jan 2007 17:38:18 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 EMF3ASPROXY03 Complaints-To: groups-abuse@google.com Injection-Info: q2g2000cwa.googlegroups.com; posting-host=213.94.228.213; posting-account=hWoAPxMAAAAnBKSBz1ZivwUPPjEuve7bvVCHZQ8rhrluPfwcBJd92w Original-Xref: shelby.stanford.edu gnu.emacs.help:144877 Original-To: help-gnu-emacs@gnu.org 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:40481 Archived-At: Eli Zaretskii wrote: > > Date: Fri, 19 Jan 2007 08:30:31 -0800 > > From: "James Aguilar" > > Cc: help-gnu-emacs@gnu.org > > This applies to several programming languages, text files, configuration > > files, and even non-files (I have a personal aversion to >80 chars in all > > files I edit). Since my only use for emacs is to edit these kinds of files, > > I'd like to have a guard at the end so that I can know when I'm over the > > line. > > Then mode hooks are probably the way to go. I doubt that you use too > many major modes, so this boils down to crafting a dozen or so mode > hooks in your .emacs file. For the few exceptions, you can always > turn on the mode by hand. I think it would be useful is Emacs had some more general hooks than the ones it has a present, for example:- progmodes-hook - A hook ran whenever a programming language mode starts plain-text-modes-hook - A hook ran by text-mode, paragraph-indent-text-mode etc formatted-text-modes-hook - A hook ran by tex-mode, nroff-mode, sgml-mode etc This would provide the functionality with less code than hooking many modes. It would avoid the problem of weird minor modes affecting temporary buffers and things like M-x snake. I might write that sometime, but I can't right now.