From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/27569 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.gnus.general Subject: message-do-auto-fill, to not fill some things Date: 03 Dec 1999 06:53:49 +1000 Organization: Bah Humbug Sender: owner-ding@hpc.uh.edu Message-ID: <87yabdcbdu.fsf@zip.com.au> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035164572 25231 80.91.224.250 (21 Oct 2002 01:42:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:42:52 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id PAA13977 for ; Thu, 2 Dec 1999 15:51:59 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id OAB30181; Thu, 2 Dec 1999 14:51:00 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 02 Dec 1999 14:50:37 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id OAA15135 for ; Thu, 2 Dec 1999 14:50:25 -0600 (CST) Original-Received: from vasquez.zip.com.au (mail@vasquez.zip.com.au [203.12.97.41]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id PAA13960 for ; Thu, 2 Dec 1999 15:49:51 -0500 (EST) Original-Received: from localhost (banana17.zip.com.au [61.8.30.49]) by vasquez.zip.com.au (8.9.2/8.9.1) with ESMTP id HAA19019 for ; Fri, 3 Dec 1999 07:49:41 +1100 (EST) Original-Received: from gg by localhost with local (Exim 2.05 #1 (Debian)) id 11tdEc-0000J9-00; Fri, 3 Dec 1999 06:53:50 +1000 Original-To: ding@gnus.org User-Agent: Gnus/5.070099 (Pterodactyl Gnus v0.99) Emacs/20.3 Original-Lines: 7 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:27569 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:27569 --=-=-= I use auto-fill-mode in text modes, but in message-mode I wanted it not to fill when editing headers or #part attachment lines. Here's what I came up with to do this, I think it'd be a good addition to message-mode. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=message-do-auto-fill.el ;; as per message-goto-body (defun message-body-pos () (save-excursion (goto-char (point-min)) (or (search-forward (concat "\n" mail-header-separator "\n") nil t) (search-forward "\n\n" nil t) (point-max)))) (defun message-do-auto-fill () (if (not (or (< (point) (message-body-pos)) (save-excursion (beginning-of-line) (looking-at "<#part")))) (funcall (default-value 'normal-auto-fill-function)))) (add-hook 'message-mode-hook '(lambda () (set (make-local-variable 'normal-auto-fill-function) 'message-do-auto-fill) ;; this bit only because text-mode-hook might have ;; already turned on auto-fill-mode (if auto-fill-function (setq auto-fill-function 'message-do-auto-fill)) )) --=-=-=--