On Tue, 08 Apr 2003 00:36:13 +0200, Julien Avarre wrote: > (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime) > > > It allows me to automatically put the pattern in my message : > > <#secure method=pgpmime mode=sign> > > But when I reply to a message, this pattern is written at the end of > quoted text. Gnus do not interpret it. I have to move it manually to > the beginning of the body :-( > > Is there a way to avoid that, automatize this ? Yup. There is gnus-message-setup-hook. Unless, you want to sign not all the messages, it works. If it's not the case, huge constructions like this appear: (add-hook 'message-setup-hook 'mml-vk-maybe-sign) (add-hook 'gnus-message-setup-hook 'mml-vk-maybe-sign) (add-hook 'gnus-message-setup-hook 'mml-vk-remove-broken-sign) (add-hook 'tc-pre-hook 'mml-unsecure-message) ;; or sc-pre-hook, or whatever ;; Should we sign the message ;; (defun mml-vk-maybe-sign () "Sign the message with PGP/MIME (if mml-vk-maybe-sign-pgpmime is bound and returns anything, but nil) or PGP (same with mml-vk-maybe-sign-pgp)." (interactive) (cond ((and (fboundp 'mml-vk-maybe-sign-pgpmime) (mml-vk-maybe-sign-pgpmime)) (mml-secure-message-sign-pgpmime)) ((and (fboundp 'mml-vk-maybe-sign-pgp) (mml-vk-maybe-sign-pgp)) (mml-secure-message-sign-pgp)))) ;; sign all the mail messages (gmane.* newsgroups are mailing lists) (defun mml-vk-maybe-sign-pgpmime () (cond ((message-mail-p) t) ((message-news-p) (let ((groups (message-fetch-field "Newsgroups"))) (if (and groups (string= (substring groups 0 6) "gmane.")) t))))) ;; sign all the news messages, except fido7 hierarchy ;(defun mml-vk-maybe-sign-pgp () ; (if (message-news-p) ; (let ((groups (message-fetch-field "Newsgroups"))) ; (if (and groups (not (string= (substring groups 0 6) "fido7."))) ; t)))) (defun mml-vk-remove-broken-sign () "Remove a \"^<\#secure method=pgpmime mode=sign>$\" below the first line of the message body." (interactive) (save-excursion (message-goto-body) (forward-line) (when (search-forward-regexp "^<\#secure method=pgpmime mode=sign>$" nil t) (delete-region (point-at-bol) (point-at-eol)) (unless (eq (point) (point-max)) (delete-char))))) -- I accept RFC3156 and RFC2440-compatible encrypted mail. PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841