Gnus development mailing list
 help / color / mirror / Atom feed
* repeated headers from gnus-reply-to-function
@ 1996-03-19 21:52 Roderick Schertler
  0 siblings, 0 replies; only message in thread
From: Roderick Schertler @ 1996-03-19 21:52 UTC (permalink / raw)


Here's a fix for a couple of problems with gnus-mail-reply, both
related to gnus-reply-to-function.

  - The first problem is that gnus-mail-reply would lose when it tried
    to append a header in follow-to to an existing header of that name.
    Eg, given

	(setq gnus-followup-to-function
	      (lambda (group)
		'(("cc" . "first-cc")
		  ("cc" . "second-cc"))))

    I'd get a cc: header like

	cc:, second-ccfirst-cc

    (with the ", " inserted in the wrong place).

  - The second problem is that gnus-mh-mail-setup (and MH in general)
    creates empty headers without a trailing space.  When
    gnus-mail-reply would try to add to such a header it wouldn't insert
    the missing space, leaving something like

    	cc:address@home.org

gnus-news-followup doesn't need either of these fixes because it doesn't
try to integrate the follow-to headers with whatever already exists in
the buffer, it just inserts a new header for each follow-to element.  It
might be better to change both of these functions to use
mail-position-on-field or something like that.

--- ChangeLog~	Sun Mar 17 10:46:18 1996
+++ ChangeLog	Tue Mar 19 16:32:57 1996
@@ -1,3 +1,8 @@
+Tue Mar 19 16:26:13 1996  Roderick Schertler  <roderick@gate.net>
+
+	* gnus-msg.el (gnus-mail-reply): Would bug out given multiple
+	follow-to elements for the same header.
+
 Sun Mar 17 13:17:26 1996  Lars Magne Ingebrigtsen  <larsi@eistla.ifi.uio.no>
 
 	* gnus.el (gnus-article-hide-pgp): Would hide one char too many.
--- gnus-msg.el.~1~	Sun Mar 17 10:46:08 1996
+++ gnus-msg.el	Tue Mar 19 16:06:14 1996
@@ -2023,12 +2023,16 @@
 	    (while follow-to
 	      (goto-char (point-min))
 	      (if (not (re-search-forward 
-			(concat "^" (caar follow-to) ": *") nil t))
+			(concat "^" (caar follow-to) ":") nil t))
 		  (progn
 		    (goto-char beg)
 		    (insert (caar follow-to) ": " (cdar follow-to) "\n"))
-		(unless (eolp)
-		  (insert ", "))
+		(if (eolp)
+		    (insert " ")
+		  (skip-chars-forward " ")
+		  (unless (eolp)
+		    (end-of-line)
+		    (insert ", ")))
 		(insert (cdar follow-to)))
 	      (setq follow-to (cdr follow-to)))
 	    (widen)))

-- 
Roderick Schertler
roderick@gate.net


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-03-19 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-19 21:52 repeated headers from gnus-reply-to-function Roderick Schertler

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).