Gnus development mailing list
 help / color / mirror / Atom feed
* Control body encoding of Gcc copies (was: Don't encrypt Gcc'ed messages)
       [not found] <20120311222924.9C0AC1FDFB@saturn.ch.ristopher.com>
@ 2012-03-13 18:01 ` Christopher Schmidt
  2012-03-14 14:34   ` Control body encoding of Gcc copies Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Schmidt @ 2012-03-13 18:01 UTC (permalink / raw)
  To: ding; +Cc: info-gnus-english

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

Christopher Schmidt <christopher@ch.ristopher.com> writes:

> is there any way to get Gnus to ignore mml encrypt tags when storing
> sent mail in a Gcc group?  (I looked in gnus-inews-do-gcc but it looks
> like there is no customisation point or handy hook that I could use to
> achieve that.)

Here is a patch for Gnus master that adds more flexibility to
gnus-inews-do-gcc.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-msg.diff --]
[-- Type: text/x-diff, Size: 1294 bytes --]

diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el
index 9411f46..d158600 100644
--- a/lisp/gnus-msg.el
+++ b/lisp/gnus-msg.el
@@ -313,6 +313,20 @@ If nil, the address field will always be empty after invoking
   :group 'gnus-message
   :type 'boolean)
 
+(defcustom gnus-gcc-pre-body-encode-hook nil
+  "A hook called before encoding the body of the Gcc copy of a message.
+Changes made to the message will only affect the Gcc copy, but
+not the original message."
+  :group 'gnus-message
+  :type 'hook)
+
+(defcustom gnus-gcc-post-body-encode-hook nil
+    "A hook called after encoding the body of the Gcc copy of a message.
+Changes made to the message will only affect the Gcc copy, but
+not the original message."
+  :group 'gnus-message
+  :type 'hook)
+
 (autoload 'gnus-message-citation-mode "gnus-cite" nil t)
 
 ;;; Internal variables.
@@ -1643,7 +1657,9 @@ this is a reply."
 	      (nnheader-set-temp-buffer " *acc*")
 	      (setq message-options (with-current-buffer cur message-options))
 	      (insert-buffer-substring cur)
+	      (run-hooks 'gnus-gcc-pre-body-encode-hook)
 	      (message-encode-message-body)
+	      (run-hooks 'gnus-gcc-post-body-encode-hook)
 	      (save-restriction
 		(message-narrow-to-headers)
 		(let* ((mail-parse-charset message-default-charset)

[-- Attachment #3: Type: text/plain, Size: 38 bytes --]


Is this one OK?

        Christopher

[-- Attachment #4: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Control body encoding of Gcc copies
  2012-03-13 18:01 ` Control body encoding of Gcc copies (was: Don't encrypt Gcc'ed messages) Christopher Schmidt
@ 2012-03-14 14:34   ` Lars Magne Ingebrigtsen
  2012-03-14 17:31     ` Christopher Schmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-14 14:34 UTC (permalink / raw)
  To: ding; +Cc: info-gnus-english

Christopher Schmidt <christopher@ch.ristopher.com> writes:

> Is this one OK?

Looks good to me.  Could you also submit the changes to the gnus.texi
file?

And do you have FSF copyright assignment papers on file?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: Control body encoding of Gcc copies
  2012-03-14 14:34   ` Control body encoding of Gcc copies Lars Magne Ingebrigtsen
@ 2012-03-14 17:31     ` Christopher Schmidt
  2012-03-15  1:32       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Schmidt @ 2012-03-14 17:31 UTC (permalink / raw)
  To: ding; +Cc: info-gnus-english

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

> Christopher Schmidt <christopher@ch.ristopher.com> writes:
>
>> Is this one OK?
>
> Looks good to me.  Could you also submit the changes to the gnus.texi
> file?


[-- Attachment #2: gnus.diff --]
[-- Type: text/x-diff, Size: 3959 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3e50751..611779c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-14  Christopher Schmidt  <christopher@ch.ristopher.com>
+
+        * gnus-msg.el (gnus-inews-do-gcc): Add gnus-gcc-pre-body-encode-hook
+        and gnus-gcc-post-body-encode-hook.
+
 2012-03-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus-group.el (gnus-group-expire-articles-1): Don't try to expire
diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el
index 9411f46..58f962e 100644
--- a/lisp/gnus-msg.el
+++ b/lisp/gnus-msg.el
@@ -313,6 +313,22 @@ If nil, the address field will always be empty after invoking
   :group 'gnus-message
   :type 'boolean)
 
+(defcustom gnus-gcc-pre-body-encode-hook nil
+  "A hook called before encoding the body of the Gcc copy of a message.
+The current buffer (when the hook is run) contains the message
+including the message header.  Changes made to the message will
+only affect the Gcc copy, but not the original message."
+  :group 'gnus-message
+  :type 'hook)
+
+(defcustom gnus-gcc-post-body-encode-hook nil
+    "A hook called after encoding the body of the Gcc copy of a message.
+The current buffer (when the hook is run) contains the message
+including the message header.  Changes made to the message will
+only affect the Gcc copy, but not the original message."
+  :group 'gnus-message
+  :type 'hook)
+
 (autoload 'gnus-message-citation-mode "gnus-cite" nil t)
 
 ;;; Internal variables.
@@ -1643,7 +1659,9 @@ this is a reply."
 	      (nnheader-set-temp-buffer " *acc*")
 	      (setq message-options (with-current-buffer cur message-options))
 	      (insert-buffer-substring cur)
+	      (run-hooks 'gnus-gcc-pre-body-encode-hook)
 	      (message-encode-message-body)
+	      (run-hooks 'gnus-gcc-post-body-encode-hook)
 	      (save-restriction
 		(message-narrow-to-headers)
 		(let* ((mail-parse-charset message-default-charset)
diff --git a/texi/ChangeLog b/texi/ChangeLog
index df08f5a..be92527 100644
--- a/texi/ChangeLog
+++ b/texi/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-14  Christopher Schmidt  <christopher@ch.ristopher.com>
+
+	* gnus.texi (Archived Messages): Mention gnus-gcc-pre-body-encode-hook
+	and gnus-gcc-post-body-encode-hook. 
+
 2012-02-28  Glenn Morris  <rgm@gnu.org>
 
 	* gnus-faq.texi, gnus-news.texi, gnus.texi:
diff --git a/texi/gnus.texi b/texi/gnus.texi
index 2520e63..0c40d56 100644
--- a/texi/gnus.texi
+++ b/texi/gnus.texi
@@ -12675,6 +12675,19 @@ this is @code{no-gcc-self}, that is the default, resent messages will be
 @code{Gcc} copied to groups that existing @code{Gcc} header specifies,
 except for the current group.
 
+@item gnus-gcc-pre-body-encode-hook
+@vindex gnus-gcc-pre-body-encode-hook
+@itemx gnus-gcc-post-body-encode-hook
+@vindex gnus-gcc-post-body-encode-hook
+
+These hooks are run before/after encoding the message body of the Gcc
+copy of a sent message.  The current buffer (when the hook is run)
+contains the message including the message header.  Changes made to
+the message will only affect the Gcc copy, but not the original
+message.  You can use these hooks to edit the copy (and influence
+subsequent transformations), e.g. remove MML secure tags
+(@pxref{Signing and encrypting}).
+
 @end table
 
 
@@ -28329,6 +28342,25 @@ New features in No Gnus:
 I'm sure there will be lots of text here.  It's really spelled 真
 Gnus.
 
+New features in Ma Gnus:
+
+@itemize @bullet
+
+@item Changes in Message mode and related Gnus features
+@c ****************************************************
+
+@itemize @bullet
+
+@item
+The new hooks @code{gnus-gcc-pre-body-encode-hook} and
+@code{gnus-gcc-post-body-encode-hook} are run before/after encoding
+the message body of the Gcc copy of a sent message.  See
+@xref{Archived Messages}.
+
+@end itemize
+
+@end itemize
+
 @iftex
 
 @page

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]


> And do you have FSF copyright assignment papers on file?

I signed FSF papers for EMACS (RT 720243).  Does this cover Gnus?

        Christopher

[-- Attachment #4: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: Control body encoding of Gcc copies
  2012-03-14 17:31     ` Christopher Schmidt
@ 2012-03-15  1:32       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-15  1:32 UTC (permalink / raw)
  To: ding; +Cc: info-gnus-english

Christopher Schmidt <christopher@ch.ristopher.com> writes:

> I signed FSF papers for EMACS (RT 720243).  Does this cover Gnus?

Yup.

I've now applied the patch.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

end of thread, other threads:[~2012-03-15  1:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20120311222924.9C0AC1FDFB@saturn.ch.ristopher.com>
2012-03-13 18:01 ` Control body encoding of Gcc copies (was: Don't encrypt Gcc'ed messages) Christopher Schmidt
2012-03-14 14:34   ` Control body encoding of Gcc copies Lars Magne Ingebrigtsen
2012-03-14 17:31     ` Christopher Schmidt
2012-03-15  1:32       ` Lars Magne Ingebrigtsen

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