From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: mike hardy Newsgroups: gmane.emacs.help Subject: Re: mode-aware fill-column? Date: Tue, 17 Sep 2002 04:48:39 GMT Organization: "We'd prefer you called it the 'Outfit'" Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032238563 12383 127.0.0.1 (17 Sep 2002 04:56:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 17 Sep 2002 04:56:03 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17rAP2-0003DD-00 for ; Tue, 17 Sep 2002 06:56:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17rAPG-0000pU-00; Tue, 17 Sep 2002 00:56:14 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.stueberl.de!cox.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus v5.9.0/Emacs 21.0.102 X-Newsreader: Gnus v5.9.0/Emacs 21.0.102 X-Mailer: Gnus v5.9.0/Emacs 21.0.102 Original-Lines: 46 Original-NNTP-Posting-Host: 63.214.93.92 Original-X-Complaints-To: abuse@earthlink.net Original-X-Trace: newsread1.prod.itd.earthlink.net 1032238119 63.214.93.92 (Mon, 16 Sep 2002 21:48:39 PDT) Original-NNTP-Posting-Date: Mon, 16 Sep 2002 21:48:39 PDT Original-Xref: nntp.stanford.edu gnu.emacs.help:104967 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1522 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1522 Nostradamus foretold that on Tue Sep 17 2002, Oliver Scholz would write: > mike hardy writes: > [...] > > Using Emacs for personal editing I like text columns to wrap around 84 > > chars. But (some) ppl prefer to see 72-ish for posting to Usenet. I'd > > like to accomodate them if there is some automatic way of changing > > fill-column's value between the two. Say somehow using ~/.gnus.el to > > change it to 72 but all other times use 84 (and when exiting Gnus it > > reverts to 84 automatically)? > > The usual way for a task like this in Emacs is to use a hook (See in > the manual: ==> Customization ==> Variables ==> Hooks). Almost every > major mode is supposed to provide at least one hook: the > -mode-hook. Since you use Gnus, you write messages in > `message-mode', so this would be `message-mode-hook'. > > The variable `fill-column' becomes automatically a local variable if > you set it to a different value in a buffer. So all you have to do is > to put a `(setq fill-column 72)' in the `message-mode-hook'. But you > have to wrap this into an anonymous function via `lambda': > > (add-hook 'message-mode-hook (lambda () (setq fill-column 72))) > > -- Oliver Excellent - works great!! Thanks both for the info/code. I did try (before posting) using text-mode-hook (copied the format from somewhere else) but I kept getting an error which I see on occasion (don't recall what it was but it's a common one for me when experimenting :->). I bet it was for lack of this lamdba reference. Thanks... Mike -- ------------------------ mhardy_mail@NO_SPAM@yahoo.com Help Wanted: Psychic. You know where to apply.