From: bojohan+news@dd.chalmers.se (Johan Bockgård)
Subject: Re: adding hook to auto-mode-alist load
Date: Fri, 22 Aug 2003 16:40:24 +0200 [thread overview]
Message-ID: <yoijlltlsqlj.fsf@frealaf.dd.chalmers.se> (raw)
In-Reply-To: sgdekze6vox.fsf@occarina.pna.cwi.nl
Lute Kamstra <Lute.Kamstra@cwi.nl> writes:
> In this case you can do
>
> (add-hook 'paragraph-indent-text-mode-hook (lambda () (auto-fill-mode 1)))
>
> to automatically start the auto-fill minor mode whenever you start
> the paragraph-indent-text major mode. If you want auto-fill-mode
> started only for .plan files and not for other files that are put in
> paragraph-indent-text-mode, then you could start auto-fill-mode
> conditionally (e.g., write a function to do this and put this
> function on paragraph-indent-text-mode-hook).
AFAICS auto-mode-alist just specifies a function to call. Is there any
reason the following is not a good idea?
(defun foo ()
(paragraph-indent-text-mode)
(turn-on-auto-fill))
(setq auto-mode-alist (cons '("\.plan$" . foo) auto-mode-alist))
You could call foo `plan-mode' if you like.
--
Johan Bockgård
next prev parent reply other threads:[~2003-08-22 14:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.634.1061522029.29551.help-gnu-emacs@gnu.org>
2003-08-22 6:41 ` adding hook to auto-mode-alist load Lute Kamstra
2003-08-22 14:40 ` Johan Bockgård [this message]
2003-08-22 15:57 ` Lute Kamstra
2003-08-21 21:09 Todd Wylie
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=yoijlltlsqlj.fsf@frealaf.dd.chalmers.se \
--to=bojohan+news@dd.chalmers.se \
/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).