From: mike hardy <no_sp@m.for_me.org>
Subject: Re: mode-aware fill-column?
Date: Tue, 17 Sep 2002 04:48:39 GMT [thread overview]
Message-ID: <jbvg55rzf8.fsf@analog.net> (raw)
In-Reply-To: m3sn09h4za.fsf@ID-87814.user.dfncis.de
Nostradamus foretold that on Tue Sep 17 2002, Oliver Scholz would write:
> mike hardy <no_sp@m.for_me.org> 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-name>-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.
prev parent reply other threads:[~2002-09-17 4:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-16 20:45 mode-aware fill-column? mike hardy
2002-09-16 23:47 ` Oliver Scholz
2002-09-17 4:48 ` mike hardy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jbvg55rzf8.fsf@analog.net \
--to=no_sp@m.for_me.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).