From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/39244 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: auto-fill in body after "^[A-Za-z]: " Date: Fri, 12 Oct 2001 17:51:32 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035174981 26856 80.91.224.250 (21 Oct 2002 04:36:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:36:21 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: (qmail 10147 invoked from network); 12 Oct 2001 15:52:32 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 12 Oct 2001 15:52:32 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 15s4bU-0007At-00; Fri, 12 Oct 2001 10:52:04 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 12 Oct 2001 10:51:40 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id KAA10064 for ; Fri, 12 Oct 2001 10:51:29 -0500 (CDT) Original-Received: (qmail 10138 invoked by alias); 12 Oct 2001 15:51:44 -0000 Original-Received: (qmail 10133 invoked from network); 12 Oct 2001 15:51:43 -0000 Original-Received: from dolk.extundo.com (195.42.214.242) by gnus.org with SMTP; 12 Oct 2001 15:51:43 -0000 Original-Received: from barbar.josefsson.org (slipsten.extundo.com [195.42.214.241]) (authenticated bits=0) by dolk.extundo.com (8.12.0/8.12.0) with ESMTP id f9CFpk0r018561; Fri, 12 Oct 2001 17:51:47 +0200 Original-To: Oliver Scholz In-Reply-To: (Oliver Scholz's message of "12 Oct 2001 15:28:51 +0200") Mail-Copies-To: nobody Original-Lines: 34 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.106 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:39244 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:39244 Oliver Scholz writes: > This is the offspring from a discussion on gnu.emacs.gnus about the > fact that something like "Suggestion: bla bla ..." breaks auto-fill in > message buffer. I have added the following to my .emacs to correct > that behaviour while still inhibiting auto-fill in the header. Kai > suggested that I should mail my code to this list. > > (defun os-header-set-text-property () > "Put a text-property \"field\" with value \"header\" to the header lines." > (save-excursion > (put-text-property (point-min) > (re-search-forward > (concat "^" > mail-header-separator) nil nil 1) > 'field 'header))) > > > (defun message-do-auto-fill () > "Test if point is in message-header before auto-filling." > (unless (text-property-any (line-beginning-position) (point) 'field 'header) > (do-auto-fill))) This doesn't work if I manually add a header, right? It wouldn't have the proper text property. Maybe the above be replaced by something such as the following? (defun message-do-auto-fill () (when (> (point) (save-excursion (rfc822-goto-eoh))) (do-auto-fill))) (Btw, use `gnus-point-at-bol' instead of `line-beginning-position' to make it works in XEmacs as well.)