Gnus development mailing list
 help / color / mirror / Atom feed
* follow-up & CC
@ 2003-11-10  1:18 Sam Steingold
  2003-11-10 12:30 ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-10  1:18 UTC (permalink / raw)


When I do "F" in a gmane newsgroup for which I set a to-address
parameter, I get a message buffer addressed to the mailing list address
(to-address).  If I want to CC to the author of the article to which I
am following up, I have to manually copy his address and do C-c c.
Is there a better way?
E.g., in a mail group, "F" will make the message buffer addressed to
all the senders and recipients of the message.
-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
(let ((a "(let ((a %c%s%c)) (format a 34 a 34))")) (format a 34 a 34))




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10  1:18 follow-up & CC Sam Steingold
@ 2003-11-10 12:30 ` Reiner Steib
  2003-11-10 14:47   ` Sam Steingold
  0 siblings, 1 reply; 19+ messages in thread
From: Reiner Steib @ 2003-11-10 12:30 UTC (permalink / raw)


On Mon, Nov 10 2003, Sam Steingold wrote:

> When I do "F" in a gmane newsgroup for which I set a to-address
> parameter, I get a message buffer addressed to the mailing list address
> (to-address).  If I want to CC to the author of the article to which I
> am following up, I have to manually copy his address and do C-c c.
> Is there a better way?

What comes quite close to your wish is to use `F', followed by `C-c
C-t' (message-insert-to).

,----[ C-h f message-insert-to RET ]
| message-insert-to is an interactive compiled Lisp function in `message'.
| (message-insert-to &optional FORCE)
| 
| Insert a To header that points to the author of the article being replied to.
| If the original author requested not to be sent mail, the function signals
| an error.
| With the prefix argument FORCE, insert the header anyway.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 12:30 ` Reiner Steib
@ 2003-11-10 14:47   ` Sam Steingold
  2003-11-10 17:44     ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-10 14:47 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-10 13:30:04 +0100]:
>
> On Mon, Nov 10 2003, Sam Steingold wrote:
>
>> When I do "F" in a gmane newsgroup for which I set a to-address
>> parameter, I get a message buffer addressed to the mailing list address
>> (to-address).  If I want to CC to the author of the article to which I
>> am following up, I have to manually copy his address and do C-c c.
>> Is there a better way?
>
> What comes quite close to your wish is to use `F', followed by `C-c
> C-t' (message-insert-to).
>
> ,----[ C-h f message-insert-to RET ]
> | message-insert-to is an interactive compiled Lisp function in `message'.
> | (message-insert-to &optional FORCE)
> | 
> | Insert a To header that points to the author of the article being replied to.
> | If the original author requested not to be sent mail, the function signals
> | an error.
> | With the prefix argument FORCE, insert the header anyway.
> `----

Thanks!
I would like to add this function to `message-setup-hook', but it
signals an error for people who do not want copies.
Wouldn't it be better to use this instead?

2003-11-10  Sam Steingold  <sds@gnu.org>

	* message.el (message-insert-to): Do not signal an error when the
	user requested no CC; can be added to `message-setup-hook' now.



(defun message-insert-to (&optional force)
  "Insert a To header that points to the author of the article being replied to.
If the original author requested not to be sent mail, the function signals
an error.
With the prefix argument FORCE, insert the header anyway."
  (interactive "P")
  (let* ((co (message-fetch-reply-field "mail-copies-to"))
         (dont (and co (or (equal (downcase co) "never")
                           (equal (downcase co) "nobody")))))
    (when dont
      (if force
        (warn "Ignoring the user request not to have copies sent via mail")
        (warn "Complying with the user request not to have copies sent via mail")))
    (when (or force (not dont))
      (message-carefully-insert-headers
       (list (cons 'To
                   (or (message-fetch-reply-field "mail-reply-to")
                       (message-fetch-reply-field "reply-to")
                       (message-fetch-reply-field "from")
                       "")))))))

Thanks.


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Man has 2 states: hungry/angry and sate/sleepy.  Catch him in transition.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 14:47   ` Sam Steingold
@ 2003-11-10 17:44     ` Reiner Steib
  2003-11-10 18:04       ` Sam Steingold
  0 siblings, 1 reply; 19+ messages in thread
From: Reiner Steib @ 2003-11-10 17:44 UTC (permalink / raw)


On Mon, Nov 10 2003, Sam Steingold wrote:

[ C-h f message-insert-to RET ]
> I would like to add this function to `message-setup-hook', but it
> signals an error for people who do not want copies.
> Wouldn't it be better to use this instead?
[...]
>     (when dont
>       (if force
>         (warn "Ignoring the user request not to have copies sent via mail")
>         (warn "Complying with the user request not to have copies sent via mail")))

`warn' isn't available in Emacs 21.3, so we cannot use it (Gnus 5.10
is supposed to run on Emacs 20.7 and up).

But we could use something like this:

    (when dont
      (if force
	  (gnus-message
	   1 "Ignoring the user request not to have copies sent via mail.")
        (gnus-message 3 (concat "Complying with the user request "
				"not to have copies sent via mail.")))
      (sit-for 1))

BTW: Gmane renames "To:" to "Original-To:".  So if you want a more
"wide" reply, you could consider those, too.

,----
| From: Karl <k@invalid>
| Newsgroups: gmane.emacs.devel
| Cc: David <d@invalid>, emacs-devel@gnu.org
| Original-To: b@invalid
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 17:44     ` Reiner Steib
@ 2003-11-10 18:04       ` Sam Steingold
  2003-11-10 18:54         ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-10 18:04 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-10 18:44:26 +0100]:
>
> On Mon, Nov 10 2003, Sam Steingold wrote:
>
> [ C-h f message-insert-to RET ]
>> I would like to add this function to `message-setup-hook', but it
>> signals an error for people who do not want copies.
>> Wouldn't it be better to use this instead?
> [...]
>>     (when dont
>>       (if force
>>         (warn "Ignoring the user request not to have copies sent via mail")
>>         (warn "Complying with the user request not to have copies sent via mail")))
>
> `warn' isn't available in Emacs 21.3, so we cannot use it (Gnus 5.10
> is supposed to run on Emacs 20.7 and up).

yeah, `warn' is actually no good, I replaced it with `message', but
`gnus-message' is even better.

> But we could use something like this:
>
>     (when dont
>       (if force
> 	  (gnus-message
> 	   1 "Ignoring the user request not to have copies sent via mail.")
>         (gnus-message 3 (concat "Complying with the user request "
> 				"not to have copies sent via mail.")))
>       (sit-for 1))

why sit-for?

Do you have gnus write access?
Can you check this in?

Thanks.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Why do we want intelligent terminals when there are so many stupid users?




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 18:04       ` Sam Steingold
@ 2003-11-10 18:54         ` Reiner Steib
  2003-11-10 19:12           ` Sam Steingold
  2003-11-10 19:26           ` Sam Steingold
  0 siblings, 2 replies; 19+ messages in thread
From: Reiner Steib @ 2003-11-10 18:54 UTC (permalink / raw)


On Mon, Nov 10 2003, Sam Steingold wrote:

> why sit-for?

Removed now.

> Do you have gnus write access?  Can you check this in?

Yes, I will check it in later (this is a bug fix, IMO).  I presume
that you have papers on file for Emacs (or Gnus), i.e. I don't need to
care about whether the patch is "tiny" or not?

I changed the doc-string to reflect the new behavior (any suggestions
for better wording?):

,----[ C-h f message-insert-to RET ]
| Insert a To header that points to the author of the article being replied to.
| If the original author requested not to be sent mail, don't insert it.  With
| the prefix argument FORCE, insert the header anyway.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 18:54         ` Reiner Steib
@ 2003-11-10 19:12           ` Sam Steingold
  2003-11-10 19:26           ` Sam Steingold
  1 sibling, 0 replies; 19+ messages in thread
From: Sam Steingold @ 2003-11-10 19:12 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-10 19:54:29 +0100]:
>
>> Do you have gnus write access?  Can you check this in?
>
> Yes, I will check it in later (this is a bug fix, IMO).
thanks!

> I presume that you have papers on file for Emacs (or Gnus), i.e. I
> don't need to care about whether the patch is "tiny" or not?

I have papers on file for Emacs and I have Emacs CVS write access.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Fighting for peace is like screwing for virginity.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 18:54         ` Reiner Steib
  2003-11-10 19:12           ` Sam Steingold
@ 2003-11-10 19:26           ` Sam Steingold
  2003-11-10 20:26             ` Reiner Steib
  1 sibling, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-10 19:26 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-10 19:54:29 +0100]:
>
> I changed the doc-string to reflect the new behavior (any suggestions
> for better wording?):
>
> ,----[ C-h f message-insert-to RET ]
> | Insert a To header that points to the author of the article being replied to.
> | If the original author requested not to be sent mail, don't insert it.  With
> | the prefix argument FORCE, insert the header anyway.
> `----

Another suggested change: when there is no reasonable reply-to address,
`message-insert-to' will insert an empty "To: " field (like C-c C-f C-t
`message-goto-to' does), which is undesirable when `message-insert-to'
is run from `message-setup-hook'.

Maybe the following is even better?

(defun message-insert-to (&optional force)
  "Insert a To header that points to the author of the article being replied to.
If the original author requested not to be sent mail, the function signals
an error.
With the prefix argument FORCE, insert the header anyway."
  (interactive "P")
  (let* ((co (message-fetch-reply-field "mail-copies-to"))
         (dont (and co (or (equal (downcase co) "never")
                           (equal (downcase co) "nobody"))))
         (to (or (message-fetch-reply-field "mail-reply-to")
                 (message-fetch-reply-field "reply-to")
                 (message-fetch-reply-field "from"))))
    (when (and dont to)
      (message
       (if force
         "Ignoring the user request not to have copies sent via mail"
         "Complying with the user request not to have copies sent via mail")))
    (when (and force (not to))
      (error "no mail address in the article"))
    (when (and to (or force (not dont)))
      (message-carefully-insert-headers (list (cons 'To to))))))


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Only adults have difficulty with child-proof caps.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 19:26           ` Sam Steingold
@ 2003-11-10 20:26             ` Reiner Steib
  2003-11-12 16:05               ` Sam Steingold
  0 siblings, 1 reply; 19+ messages in thread
From: Reiner Steib @ 2003-11-10 20:26 UTC (permalink / raw)


On Mon, Nov 10 2003, Sam Steingold wrote:

> Another suggested change: when there is no reasonable reply-to address,
> `message-insert-to' will insert an empty "To: " field [...]
> Maybe the following is even better?

Thanks.  Committed (slightly modified).

I also changed the menu entries ("Field" menu) and added one for
`message-insert-wide-reply'.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-10 20:26             ` Reiner Steib
@ 2003-11-12 16:05               ` Sam Steingold
  2003-11-12 16:54                 ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-12 16:05 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-10 21:26:22 +0100]:
>
> Thanks.  Committed (slightly modified).
thanks.

there appears to be a bug in `message-carefully-insert-headers': it
does not check that the recipient is already mentioned in To or CC, so
subsequent C-c C-t will just insert more and more identical To:
addresses.

Another dubious element is that `gnus-message' is defined in
gnus-util.el which is not required by message.el.
I think you need to add an autoload statement
  (autoload 'gnus-message "gnus-util")
to the beginning of message.el.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Lisp: Serious empowerment.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-12 16:05               ` Sam Steingold
@ 2003-11-12 16:54                 ` Reiner Steib
  2003-11-12 18:36                   ` Sam Steingold
  0 siblings, 1 reply; 19+ messages in thread
From: Reiner Steib @ 2003-11-12 16:54 UTC (permalink / raw)


On Wed, Nov 12 2003, Sam Steingold wrote:

> there appears to be a bug in `message-carefully-insert-headers': it
> does not check that the recipient is already mentioned in To or CC, so
> subsequent C-c C-t will just insert more and more identical To:
> addresses.

I guess `message-insert-to' isn't supposed to be called repeatedly.
But if you (or anyone else) want to implement such checks in
`message-carefully-insert-headers'... ;-)

> Another dubious element is that `gnus-message' is defined in
> gnus-util.el which is not required by message.el.
> I think you need to add an autoload statement
>   (autoload 'gnus-message "gnus-util")
> to the beginning of message.el.

I will change `gnus-message 3' to `message'.  `message.el' is supposed
to be independent from Gnus.  Thanks for pointing this out.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-12 16:54                 ` Reiner Steib
@ 2003-11-12 18:36                   ` Sam Steingold
  2003-11-12 20:00                     ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-12 18:36 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-12 17:54:10 +0100]:
>
> On Wed, Nov 12 2003, Sam Steingold wrote:
>
>> there appears to be a bug in `message-carefully-insert-headers': it
>> does not check that the recipient is already mentioned in To or CC, so
>> subsequent C-c C-t will just insert more and more identical To:
>> addresses.
>
> I guess `message-insert-to' isn't supposed to be called repeatedly.
> But if you (or anyone else) want to implement such checks in
> `message-carefully-insert-headers'... ;-)

Patch appended.

>> Another dubious element is that `gnus-message' is defined in
>> gnus-util.el which is not required by message.el.
>> I think you need to add an autoload statement
>>   (autoload 'gnus-message "gnus-util")
>> to the beginning of message.el.
>
> I will change `gnus-message 3' to `message'.  `message.el' is supposed
> to be independent from Gnus.  Thanks for pointing this out.

actually, message.el autoloads quite a few gnus-util.el and other functions.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
((lambda (x) (list x (list 'quote x))) '(lambda (x) (list x (list 'quote x))))


--- message.el.~6.380.~	2003-11-10 15:26:08.612774400 -0500
+++ message.el	2003-11-12 13:35:06.653238500 -0500
@@ -2599,15 +2599,31 @@
 		   (message-get-reply-headers t))))
     (message-carefully-insert-headers headers)))
 
+(defvar message-header-synonyms
+  '((To Cc Bcc))
+  "List of lists of header synonyms.
+E.g., if this list contains a member list with elements `Cc' and `To',
+then `message-carefully-insert-headers' will not insert a `To' header
+when the message is already `Cc'ed to the recipient.")
+
 (defun message-carefully-insert-headers (headers)
   (dolist (header headers)
-    (let ((header-name (symbol-name (car header))))
+    (let* ((header-name (symbol-name (car header)))
+           (new-header (cdr header))
+           (synonyms (loop for synonym in message-header-synonyms
+                       when (memq (car header) synonym) return synonym))
+           (old-header
+            (loop for synonym in synonyms
+              for old-header = (mail-fetch-field (symbol-name synonym))
+              when (string-match new-header old-header)
+              return synonym)))
+      (if old-header
+          (message "already have `%s' in `%s'" new-header old-header)
       (when (and (message-position-on-field header-name)
-		 (mail-fetch-field header-name)
-		 (not (string-match "\\` *\\'"
-				    (mail-fetch-field header-name))))
+                   (setq old-header (mail-fetch-field header-name))
+                   (not (string-match "\\` *\\'" old-header)))
 	(insert ", "))
-      (insert (cdr header)))))
+        (insert new-header)))))
 
 (defun message-widen-reply ()
   "Widen the reply to include maximum recipients."




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-12 18:36                   ` Sam Steingold
@ 2003-11-12 20:00                     ` Reiner Steib
  2003-11-12 21:13                       ` Sam Steingold
  0 siblings, 1 reply; 19+ messages in thread
From: Reiner Steib @ 2003-11-12 20:00 UTC (permalink / raw)


On Wed, Nov 12 2003, Sam Steingold wrote:

>> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-12 17:54:10 +0100]:
[...]
>> But if you (or anyone else) want to implement such checks in
>> `message-carefully-insert-headers'... ;-)
>
> Patch appended.

When following up to my previous message...

,----
| Newsgroups: gmane.emacs.gnus.general
| Message-ID: <v94qx97cjx.fsf@marauder.physik.uni-ulm.de>
| Reply-To: reiner.steib@gmx.de
| Mail-Followup-To: ding@gnus.org
| Original-To: ding@gnus.org
| Mail-Copies-To: nobody
`----

... and using `message-insert-wide-reply' (`C-c C-f w'), I get a
failing (string-match "ding@gnus.org" nil) here:

+              for old-header = (mail-fetch-field (symbol-name synonym))
+              when (string-match new-header old-header)

"ding@gnus.org" comes from "Mail-Followup-To:" (I replied "yes"
when asked about obeying MFT).

Is this the correct fix?  Can `new-header' ever be nil?

| 		  for old-header = (mail-fetch-field (symbol-name synonym))
| 		  when (and new-header old-header
| 			    (string-match new-header old-header))

BTW, suggestions for a doc-string for
`message-carefully-insert-headers', anyone?

>> I will change `gnus-message 3' to `message'.  `message.el' is supposed
>> to be independent from Gnus.  Thanks for pointing this out.
>
> actually, message.el autoloads quite a few gnus-util.el and other
> functions.

Yes, but I don't intend to make this situation worse.  `gnus-message'
hasn't been used before there.

(Maybe someday we will factor out stuff from `gnus-util.el' used in
`message.el' to, say `msg-util.el' and require it from Gnus and
Message.)

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-12 20:00                     ` Reiner Steib
@ 2003-11-12 21:13                       ` Sam Steingold
  2003-11-18 16:05                         ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-12 21:13 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-12 21:00:06 +0100]:
>
> Can `new-header' ever be nil?

no, it is later passed to `insert' which complains about nils.

> BTW, suggestions for a doc-string for
> `message-carefully-insert-headers', anyone?

appended is the new and improved patch.


-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
nobody's life, liberty or property are safe while the legislature is in session


--- message.el.~6.380.~	2003-11-10 15:26:08.612774400 -0500
+++ message.el	2003-11-12 16:08:18.618979700 -0500
@@ -2599,15 +2599,34 @@
 		   (message-get-reply-headers t))))
     (message-carefully-insert-headers headers)))
 
+(defvar message-header-synonyms
+  '((To Cc Bcc))
+  "List of lists of header synonyms.
+E.g., if this list contains a member list with elements `Cc' and `To',
+then `message-carefully-insert-headers' will not insert a `To' header
+when the message is already `Cc'ed to the recipient.")
+
 (defun message-carefully-insert-headers (headers)
+  "Insert the headers, an alist, into the message buffer.
+Does not insert the headers when they are already present there
+or in the synonym headers, defined by `message-header-synonyms'."
   (dolist (header headers)
-    (let ((header-name (symbol-name (car header))))
+    (let* ((header-name (symbol-name (car header)))
+           (new-header (cdr header))
+           (synonyms (loop for synonym in message-header-synonyms
+                       when (memq (car header) synonym) return synonym))
+           (old-header
+            (loop for synonym in synonyms
+              for old-header = (mail-fetch-field (symbol-name synonym))
+              when (and old-header (string-match new-header old-header))
+              return synonym)))
+      (if old-header
+          (message "already have `%s' in `%s'" new-header old-header)
       (when (and (message-position-on-field header-name)
-		 (mail-fetch-field header-name)
-		 (not (string-match "\\` *\\'"
-				    (mail-fetch-field header-name))))
+                   (setq old-header (mail-fetch-field header-name))
+                   (not (string-match "\\` *\\'" old-header)))
 	(insert ", "))
-      (insert (cdr header)))))
+        (insert new-header)))))
 
 (defun message-widen-reply ()
   "Widen the reply to include maximum recipients."




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-12 21:13                       ` Sam Steingold
@ 2003-11-18 16:05                         ` Reiner Steib
  2003-11-18 18:50                           ` Sam Steingold
  0 siblings, 1 reply; 19+ messages in thread
From: Reiner Steib @ 2003-11-18 16:05 UTC (permalink / raw)


On Wed, Nov 12 2003, Sam Steingold wrote:

> +(defvar message-header-synonyms
> +  '((To Cc Bcc))
> +  "List of lists of header synonyms.
> +E.g., if this list contains a member list with elements `Cc' and `To',
> +then `message-carefully-insert-headers' will not insert a `To' header
> +when the message is already `Cc'ed to the recipient.")
> +
>  (defun message-carefully-insert-headers (headers)
> +  "Insert the headers, an alist, into the message buffer.
> +Does not insert the headers when they are already present there
> +or in the synonym headers, defined by `message-header-synonyms'."
[...]

Committed, thanks.

> +              when (and old-header (string-match new-header old-header))

Hm, another problem here.  Say, I have "To: bar@foo.invalid.my.domain"
in the current message.  Then, the following examples wont work as
expected:

- (message-carefully-insert-headers '((To . "bar@foo.invalid")))

- (message-carefully-insert-headers '((To . "ar@foo.invalid.my.domain")))

- (setq case-fold-search nil)
  (message-carefully-insert-headers '((To . "bar@FOO.INVALID.my.domain")))

Maybe it would be better to use something like (gnus-string-equal (nth
1 (mail-extract-address-components ...))).

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-18 16:05                         ` Reiner Steib
@ 2003-11-18 18:50                           ` Sam Steingold
  2003-11-18 19:57                             ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-18 18:50 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-18 17:05:42 +0100]:
>
>> +              when (and old-header (string-match new-header old-header))
>
> Hm, another problem here.  Say, I have "To: bar@foo.invalid.my.domain"
> in the current message.  Then, the following examples wont work as
> expected:
>
> - (message-carefully-insert-headers '((To . "bar@foo.invalid")))
>
> - (message-carefully-insert-headers '((To . "ar@foo.invalid.my.domain")))
>
> - (setq case-fold-search nil)
>   (message-carefully-insert-headers '((To . "bar@FOO.INVALID.my.domain")))
>
> Maybe it would be better to use something like (gnus-string-equal (nth
> 1 (mail-extract-address-components ...))).

it depends on what you want.
I wouldn't want to see _both_ "bar@foo.invalid" and
"bar@foo.invalid.my.domain", I would prefer to either pick the shortest
or the "correct" one or...

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Just because you're paranoid doesn't mean they AREN'T after you.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-18 18:50                           ` Sam Steingold
@ 2003-11-18 19:57                             ` Reiner Steib
  2003-11-18 20:47                               ` Sam Steingold
  0 siblings, 1 reply; 19+ messages in thread
From: Reiner Steib @ 2003-11-18 19:57 UTC (permalink / raw)


On Tue, Nov 18 2003, Sam Steingold wrote:

>> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-18 17:05:42 +0100]:
[...]
>> Maybe it would be better to use something like (gnus-string-equal (nth
>> 1 (mail-extract-address-components ...))).
>
> it depends on what you want.
> I wouldn't want to see _both_ "bar@foo.invalid" and
> "bar@foo.invalid.my.domain", I would prefer to either pick the shortest
> or the "correct" one or...

Maybe my examples were too strange.  "bar@foo.invalid" and
"bar@foo.invalid.my.domain" are completely different addresses.
E.g. I know about a domain where the local parts "au", "bau" and "nau"
exist and belong to different persons.  It's wrong to assume that they
belong to the same person.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-18 19:57                             ` Reiner Steib
@ 2003-11-18 20:47                               ` Sam Steingold
  2004-01-03 14:07                                 ` Reiner Steib
  0 siblings, 1 reply; 19+ messages in thread
From: Sam Steingold @ 2003-11-18 20:47 UTC (permalink / raw)


> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-18 20:57:16 +0100]:
>
> On Tue, Nov 18 2003, Sam Steingold wrote:
>
>>> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-18 17:05:42 +0100]:
> [...]
>>> Maybe it would be better to use something like (gnus-string-equal (nth
>>> 1 (mail-extract-address-components ...))).
>>
>> it depends on what you want.
>> I wouldn't want to see _both_ "bar@foo.invalid" and
>> "bar@foo.invalid.my.domain", I would prefer to either pick the shortest
>> or the "correct" one or...
>
> Maybe my examples were too strange.  "bar@foo.invalid" and
> "bar@foo.invalid.my.domain" are completely different addresses.
> E.g. I know about a domain where the local parts "au", "bau" and "nau"
> exist and belong to different persons.  It's wrong to assume that they
> belong to the same person.

OK, I guess your suggestion makes sense then.
you might compare just the user name and not the full e-mail address.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
We're too busy mopping the floor to turn off the faucet.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: follow-up & CC
  2003-11-18 20:47                               ` Sam Steingold
@ 2004-01-03 14:07                                 ` Reiner Steib
  0 siblings, 0 replies; 19+ messages in thread
From: Reiner Steib @ 2004-01-03 14:07 UTC (permalink / raw)
  Cc: Sam Steingold

On Tue, Nov 18 2003, Sam Steingold wrote:

>> * Reiner Steib <4.hpr.03.e.f@aheshrefcnz.qr> [2003-11-18 20:57:16 +0100]:
[...]
>> Maybe my examples were too strange.  "bar@foo.invalid" and
>> "bar@foo.invalid.my.domain" are completely different addresses.
>> E.g. I know about a domain where the local parts "au", "bau" and "nau"
>> exist and belong to different persons.  It's wrong to assume that they
>> belong to the same person.
>
> OK, I guess your suggestion makes sense then.  you might compare
> just the user name and not the full e-mail address.

As the user full name isn't always available, it's better to check the
mail address.  I didn't find time to implement it, though (I added a
"FIXME" comment in `message-carefully-insert-headers').

I added a check for "Original-To" (if present in
`message-header-synonyms') to `message-get-reply-headers'.  Could you
please check if it still works for you?

BTW, I added the following to the manual: 

,----[ (info "(message)Message Headers") ]
| `message-header-synonyms'
|      A list of lists of header synonyms.  E.g., if this list contains a
|      member list with elements `Cc' and `To', then
|      `message-carefully-insert-headers' will not insert a `To' header
|      when the message is already `Cc'ed to the recipient.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2004-01-03 14:07 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-10  1:18 follow-up & CC Sam Steingold
2003-11-10 12:30 ` Reiner Steib
2003-11-10 14:47   ` Sam Steingold
2003-11-10 17:44     ` Reiner Steib
2003-11-10 18:04       ` Sam Steingold
2003-11-10 18:54         ` Reiner Steib
2003-11-10 19:12           ` Sam Steingold
2003-11-10 19:26           ` Sam Steingold
2003-11-10 20:26             ` Reiner Steib
2003-11-12 16:05               ` Sam Steingold
2003-11-12 16:54                 ` Reiner Steib
2003-11-12 18:36                   ` Sam Steingold
2003-11-12 20:00                     ` Reiner Steib
2003-11-12 21:13                       ` Sam Steingold
2003-11-18 16:05                         ` Reiner Steib
2003-11-18 18:50                           ` Sam Steingold
2003-11-18 19:57                             ` Reiner Steib
2003-11-18 20:47                               ` Sam Steingold
2004-01-03 14:07                                 ` Reiner Steib

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