Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-gcc-externalize-attachments: "query the user" option
@ 2004-03-31 15:35 Reiner Steib
  2004-05-16 14:00 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Reiner Steib @ 2004-03-31 15:35 UTC (permalink / raw)


Hi,

Sometimes, I'd like to have the attachments included in Gcc and
sometimes not (I cannot give a rule based on group name).  I'd like to
add a "query the user option when sending" option to
`gnus-gcc-externalize-attachments':

,----[ C-h v gnus-gcc-externalize-attachments RET ]
| gnus-gcc-externalize-attachments's value is ask
| 
| Documentation:
| Should local-file attachments be included as external parts in Gcc copies?
| If it is `all', attach files as external parts;
| if a regexp and matches the Gcc group name, attach files as external parts;
| if `ask', query the user; if nil, attach files as normal parts.
| 
| You can customize this variable.
| 
| Defined in `gnus-msg'.
`----

I've implemented it, but the problem is, that I get asked on sending
for every message, even those that don't have attachments.  How can I
test if there is an attachment?

--8<---------------cut here---------------start------------->8---
--- gnus-msg.el	4 Mar 2004 06:30:18 -0000	7.7
+++ gnus-msg.el	31 Mar 2004 15:31:28 -0000
@@ -1591,11 +1594,15 @@
 					      (car method))))
 	    (unless (gnus-request-group group nil method)
 	      (gnus-request-create-group group method))
-	    (setq mml-externalize-attachments
-		  (if (stringp gnus-gcc-externalize-attachments)
-		      (string-match gnus-gcc-externalize-attachments group)
-		    gnus-gcc-externalize-attachments))
-	    (save-excursion
+	    (setq
+	     mml-externalize-attachments
+	     (cond ((and (stringp gnus-gcc-externalize-attachments)
+			 (string-match gnus-gcc-externalize-attachments group))
+		    t)
+		   ((eq gnus-gcc-externalize-attachments 'ask)
+		    (gnus-y-or-n-p
+		     "Externalize attachments in this message? "))
+		   (t gnus-gcc-externalize-attachments)))
 	      (nnheader-set-temp-buffer " *acc*")
 	      (insert-buffer-substring cur)
 	      (message-encode-message-body)
--8<---------------cut here---------------end--------------->8---

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




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

* Re: gnus-gcc-externalize-attachments: "query the user" option
  2004-03-31 15:35 gnus-gcc-externalize-attachments: "query the user" option Reiner Steib
@ 2004-05-16 14:00 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2004-05-16 14:00 UTC (permalink / raw)


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> I've implemented it, but the problem is, that I get asked on sending
> for every message, even those that don't have attachments.  How can I
> test if there is an attachment?

Well, you could check for MML tags.  Or is it called before that?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2004-05-16 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-31 15:35 gnus-gcc-externalize-attachments: "query the user" option Reiner Steib
2004-05-16 14:00 ` 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).