[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trivial-cite attribution problem
From: |
Xavier Maillard |
Subject: |
Re: trivial-cite attribution problem |
Date: |
Thu, 09 Sep 2004 02:07:22 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
On 3 sep 2004, Sebastien Kirche wrote:
> Hi,
Yau,
[ ... ]
> Problem : it seems that a single word is not recognized by tc
> as a real name, thus when i reply to a message which author is
> "aname <an@address>", tc inserts the address and not the name.
> Is that a tc bug, or do i missed something in tc's attribution
> elisp ?
My guess would go for the bug but I am not an expert of TC :/
> As i have also set tc for quoting mails with (add-hook
> 'mail-citation-hook 'trivial-cite), is it possible to have a
> different function for mail ?
Dunno if it will answer to your question, but here is what I
currently use either for news or mails (in fact it is a
simplified function).
If the group I am in is nnml:mail, then the mail attribution is applying.
,----
| (defun xm/tc-attribution ()
| "Generate an attribution."
| (let ((style (random 6))
| (date (cdr (assoc "date" tc-strings-list)))
| (name (cdr (assoc "real-name" tc-strings-list)))
| (email (cdr (assoc "email-addr" tc-strings-list))))
| (cond ((string-match "fr.misc.bavardages.dinosaures" gnus-newsgroup-name)
| (concat "Le dino" name "<" email "> disait récemment: \n"))
|
| ;; le deuxième cas :
| ((string-match "nnml:mail" gnus-newsgroup-name)
| (insert "Vous m'avez dit récemment :\n\n" ))
|
| ;; le troisième cas :
| ;; pour montrer que toutes les conditions ne commencent pas par
| ;; 'string-match'
| ;; et pour ceux qui veulent la date et l'heure (voir
| ;; format-time-string dans emacs lisp reference manual)
| ((gnus-news-group-p gnus-newsgroup-name)
| (insert (mail-header-from message-reply-headers)
| " disait le "
| (format-time-string "%D"
| (gnus-date-get-time
| (mail-header-date
message-reply-headers)))
| " que :\n\n")))
| (cond ((= style 0)
| (concat "On " date ", " name "<" email "> stated:\n"))
| ((= style 1)
| (concat "On " date ", " name "<" email "> spake:\n"))
| ((= style 2)
| (concat "On " date ", " name "<" email "> said:\n"))
| ((= style 3)
| (concat "On " date ", " name "<" email "> verbalized:\n"))
| ((= style 4)
| (concat "On " date ", " name "<" email "> mused:\n"))
| ((= style 5)
| (concat "* Quoting " name " <" email ">:\n"))
| (t
| (concat "On " date ", " name "<" email "> wrote:\n")))))
`----
--
GNUSFR.ORG http://gnusfr.org/
EMACSFR.ORG http://emacsfr.org/
Xavier Maillard Tel: +33 6 68 04 64 37