[comp.mail.mh] replcomps

djossou@snoopy.inria.fr (Coco Djossou) (02/20/91)

Bonjour,
I want to modify my replcomps file in order to get:
In-Reply-To: SenderName's message of Tue, 19 Feb 91 18:21:53 +0100.
             ^^^^^^^^^^^^
instead of the default:
In-Reply-To: Your message of Tue, 19 Feb 91 18:21:53 +0100.
             ^^^^
I've tried
%<{date}In-reply-to: %{from}'s message of \
%<(nodate{date})%{date}%|%(tws{date})%>.%<{message-id}
             %{message-id}%>\n%>\
But I get the complete string of the sender's address with %{from}.
The man page of mh-format suggest to use something like
%(putstrf(pers({from})) to get the personal name of the address, but
this return an empty string.

version: MH 6.5 #67[UCI] (miracle) of Thu Oct 27 13:30:33 MET 1988
options: [BSD42] [MHE] [TTYD] [BERK] [SBACKUP='"#"'] [NFS] [SENDMTS]

Colud you please give me a clue or mail me any replcomps file that do
the right thing?
Thanks in advance,
Coco D.
-- 
Coco Djossou			|
Secoia Project			| voice (+33) 93.65.77.46
INRIA Sophia Antipolis		| fax   (+33) 93.65.77.65
2004, route des Lucioles	| E-mail djosssou@mirsa.inria.fr
F-06561 Valbonne Cedex (France)	| 

wohler@sapwdf.UUCP (Bill Wohler) (02/22/91)

djossou@snoopy.inria.fr (Coco Djossou) writes:
>Bonjour,
>I want to modify my replcomps file in order to get:
>In-Reply-To: SenderName's message of Tue, 19 Feb 91 18:21:53 +0100.
>             ^^^^^^^^^^^^
>instead of the default:
>In-Reply-To: Your message of Tue, 19 Feb 91 18:21:53 +0100.
>             ^^^^

bonjour coco,

  ich kenne genau deine problem.

  sorry, i don't know of any other variable other than %{from} or
  %{friendly}.

  however, i happened to have thrown nuclear tonnage at the problem.
  this problably isn't the answer you want, but if you happen to use
  mh-e under gnuemacs, you can add the following to your
  .emacs file to have emacs edit the In-reply-to header automatically.
  there are still a couple of rare cases where it blows it:

  i hope that this evokes simpler, more elegant solutions from the
  others. ;-)

					--b "a san franciscan abroad" w
					wohler@sap-ag.de


(setq mh-compose-letter-hook 
      '(lambda (&optional to &optional subject &optional cc)
	 (mh-e-replyto)))

;;; Customize the in-reply-to header.
;;; Need to generalize so that one could have "name <address>", "<address> 
;;; <name>", or just "<address>".  Currently only works for the first.  Same
;;; with "(".
(defun mh-e-replyto ()
  "Edit 'In-reply-to' header so that only the person's finger name remains."
  (interactive)
  (point-to-register 'a)
  (goto-char (dot-min))
  (if (search-forward "In-reply-to" nil t)
      (progn
	(end-of-line)
	(set-mark (dot))
	(beginning-of-line)
	(cond
	 ((search-forward "<" (mark) t)
	  (backward-char 2)
	  (zap-to-char 1 '?'))
	 ((search-forward "(" (mark) t)
	  (beginning-of-line)
	  (search-forward ":" (mark) t)
	  (zap-to-char 1 '?\()
	  (delete-char 1)
	  (insert " ")
	  (search-forward ")" (mark) t)
	  (while (looking-at "[') \t]") (backward-char))
	  (forward-char)
	  (zap-to-char 1 '?'))
	 (t
	  (search-forward " 's" (mark) t)
	  (backward-char 3)
	  (delete-char 1)
	  (beginning-of-line)
	  (if (search-forward "!" (mark) t)
	      (clean-uucp-path))
	  (message "No comment present in In-reply-to header")
	  (sit-for 2)))))
  (register-to-point 'a))

(defun clean-uucp-path ()
  (search-forward "@")
  (while (looking-at "[^']")
    (delete-char 1))
  (delete-backward-char 1)
  (backward-word 2)
  (set-mark (point))
  (while (looking-at "[^ \t]")
    (backward-char 1))
  (forward-char 1)
  (kill-region (point) (mark)))

gildea@EXPO.LCS.MIT.EDU (Stephen Gildea) (02/28/91)

Here is the In-reply-to code from my replcomps:

%<{date}In-reply-to: Message from %(mbox{from})@%(host{from}) of \
%<(nodate{date})%{date}%|%(mday{date}) %(month{date}) %02(putnumf(year{date})) \
%(hour{date}):%02(putnumf(min{date})):%02(putnumf(sec{date})) %(tzone{date})%>\n%>

It produces headers formatted something like this:

In-Reply-To: Message from gildea@expo.lcs.mit.edu of 1 Feb 91 9:51:23 EST

I think the apostrophe in "name's message" is hard to get right all
the time (you risk it looking ugly), hence I say "message from x" instead.

I use the mailbox instead of the real name of the sender to make
conversation tracking more robust.  It also means I don't have to use
quotation marks around the (multi-word) name to make the line easy to
parse.

And I specially format the date to also increase machine parsability:
the default format has a comma in it, which might separate different
replied-to message specifications.  If you don't care about the date
so much, the above code would only be half as long.

Why does MH by default use the somewhat worthless "Your message" format?
When the conversation is on a list, I want to know: *whose* message?

 < Stephen
   MIT X Consortium