Gnus development mailing list
 help / color / mirror / Atom feed
From: Oliver Scholz <oscholz@my.gnus.org>
Subject: patches (Re: auto-fill in body after "^[A-Za-z]: ")
Date: Sat, 13 Oct 2001 22:36:27 +0200	[thread overview]
Message-ID: <m33d4nqoot.fsf@ID-87814.user.dfncis.de> (raw)
In-Reply-To: <m3r8s7bt8l.fsf@ID-87814.user.dfncis.de>

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

*blushes* I'm sorry for the spam. I was a bit careless as I posted my last
message. :-¬ 

I worked a bit on the code. Please note that my lisp-writing is
pure diletantism. It is very probable that this is not worth anything.

Furthermore: I never made a diff before. I followed the instructions
in the Emacs Manual. I hope I made it right.

1. Patch to message.el

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to message.el --]
[-- Type: text/x-patch, Size: 1188 bytes --]

*** message.el	Fri Oct 12 16:39:31 2001
--- /home/egoge/message.el	Sat Oct 13 21:04:09 2001
***************
*** 3943,3955 ****
    (when message-default-headers
      (insert message-default-headers)
      (or (bolp) (insert ?\n)))
-   (put-text-property (point-min) (point) 'field 'header)
    (put-text-property
     (point)
     (progn
       (insert mail-header-separator "\n")
       (1- (point)))
!    'read-only nil)
    (forward-line -1)
    (when (message-news-p)
      (when message-default-news-headers
--- 3943,3954 ----
    (when message-default-headers
      (insert message-default-headers)
      (or (bolp) (insert ?\n)))
    (put-text-property
     (point)
     (progn
       (insert mail-header-separator "\n")
       (1- (point)))
!    'read-only t)
    (forward-line -1)
    (when (message-news-p)
      (when message-default-news-headers
***************
*** 3979,3984 ****
--- 3978,3986 ----
    (set-buffer-modified-p nil)
    (setq buffer-undo-list nil)
    (run-hooks 'message-setup-hook)
+   (save-restriction
+     (message-narrow-to-headers)
+     (put-text-property (point-min) (point-max) 'field 'header))
    (message-position-point)
    (undo-boundary))
  

[-- Attachment #3: Type: text/plain, Size: 195 bytes --]

a. This sets the 'field 'header property to the whole header.
b. This sets the read-only property of the mail-header-separator to t.
(changes are in `message-setup-1')

2. Patch to gnus-draft.el

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Patch to gnus.draft.el --]
[-- Type: text/x-patch, Size: 1799 bytes --]

*** gnus-draft.el	Sun Sep 23 12:37:11 2001
--- /home/egoge/gnus-draft.el	Sat Oct 13 21:42:02 2001
***************
*** 102,108 ****
      (save-excursion
        (save-restriction
  	(message-narrow-to-headers)
! 	(message-remove-header "date")))
      (save-buffer)
      (let ((gnus-verbose-backends nil))
        (gnus-request-expire-articles (list article) group t))
--- 102,109 ----
      (save-excursion
        (save-restriction
  	(message-narrow-to-headers)
! 	(message-remove-header "date")
! 	(put-text-property (point-min) (point-max) 'field 'header)))
      (save-buffer)
      (let ((gnus-verbose-backends nil))
        (gnus-request-expire-articles (list article) group t))
***************
*** 218,224 ****
  
  (progn
    (defun gnus-draft-setup (narticle group &optional restore)
!     (let (ga)
        (gnus-setup-message 'forward
  	(let ((article narticle))
  	  (message-mail)
--- 219,225 ----
  
  (progn
    (defun gnus-draft-setup (narticle group &optional restore)
!     (let (ga (inhibit-read-only t))
        (gnus-setup-message 'forward
  	(let ((article narticle))
  	  (message-mail)
***************
*** 232,238 ****
  	    (goto-char (point-min))
  	    (search-forward "\n\n")
  	    (forward-char -1)
! 	    (insert mail-header-separator)
  	    (forward-line 1)
  	    (setq ga (message-fetch-field gnus-draft-meta-information-header))
  	    (message-set-auto-save-file-name))))
--- 233,244 ----
  	    (goto-char (point-min))
  	    (search-forward "\n\n")
  	    (forward-char -1)
! 	    (put-text-property
! 	     (point)
! 	     (progn
! 	       (insert mail-header-separator)
! 	       (point))
! 	     'read-only t)
  	    (forward-line 1)
  	    (setq ga (message-fetch-field gnus-draft-meta-information-header))
  	    (message-set-auto-save-file-name))))

[-- Attachment #5: Type: text/plain, Size: 800 bytes --]

To change only message.el is not enough. When I save a message to the
drafts folder and edit it then, then the text properties are not set
accordingly and I cannot -- for example -- add a long Cc without
auto-filling.

And: The read-only property of the mail-header-separator causes an
error.

This change
a. sets the 'field property to the header again (in
   `gnus-draft-edit-message')

b. sets inhibit-read-only to t for the erasion of the buffer. (in
   `gnus-draft-setup').

I tested it with GNU Emacs 21.0.106 and GNU Emacs 20.7 (both only on a
tty if that matters). I'm not familiar with XEmacs, so I could not set
it up appropriately to run Gnus. But I checked in the Lispref that the
functions/variables I added are known to XEmacs.


    'oliver

-- 
22 Vendémiaire an 210 de la Révolution

  reply	other threads:[~2001-10-13 20:36 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-12 13:28 auto-fill in body after "^[A-Za-z]: " Oliver Scholz
2001-10-12 13:18 ` Kai Großjohann
2001-10-12 14:57   ` David S. Goldberg
2001-10-12 20:53   ` Oliver Scholz
2001-10-12 22:18     ` Kai Großjohann
2001-10-13 12:34       ` Oliver Scholz
2001-10-13 19:52         ` Kai Großjohann
2001-10-13 12:42       ` Oliver Scholz
2001-10-13 12:48       ` Oliver Scholz
2001-10-13 20:36         ` Oliver Scholz [this message]
2001-10-13 19:55           ` patches (Re: auto-fill in body after "^[A-Za-z]: ") Kai Großjohann
2001-10-14  1:02             ` Henrik Enberg
2001-10-15 20:47               ` Oliver Scholz
2001-10-15 20:37                 ` Kai Großjohann
2001-10-16  0:04                   ` Oliver Scholz
2001-10-16  8:27                     ` Kai Großjohann
2001-10-19  6:41                       ` Per Abrahamsen
2001-10-19  9:21                         ` Kai Großjohann
2001-10-19 10:10                           ` Per Abrahamsen
2001-10-19 11:41                             ` Kai Großjohann
2001-10-19 13:27                               ` Per Abrahamsen
2001-10-19 16:29                                 ` Kai Großjohann
2001-10-13 19:56           ` Kai Großjohann
2001-10-12 15:51 ` auto-fill in body after "^[A-Za-z]: " Simon Josefsson
2001-10-12 16:45   ` Kai Großjohann
2001-10-12 17:05     ` Paul Jarc
2001-10-12 17:10       ` Paul Jarc
2001-10-12 17:16       ` Kai Großjohann
2001-10-12 17:09     ` ShengHuo ZHU
2001-10-12 17:22       ` Kai Großjohann
2001-10-12 17:19     ` Simon Josefsson
2001-10-12 18:53   ` Oliver Scholz

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m33d4nqoot.fsf@ID-87814.user.dfncis.de \
    --to=oscholz@my.gnus.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 NNTP newsgroup(s).