aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1998-06-25 17:14:47 +0000
committerKarl Heuer1998-06-25 17:14:47 +0000
commit0bb37c1a185a604ae250c378a97297b40c594103 (patch)
tree74cf07503e8c5050f2e4de6505fcbc3f728c2c1e
parent9648a1e6e069aed864132de4d3cdd43273dae5a6 (diff)
downloademacs-0bb37c1a185a604ae250c378a97297b40c594103.tar.gz
emacs-0bb37c1a185a604ae250c378a97297b40c594103.zip
Style and doc fixes.
-rw-r--r--lisp/mail/feedmail.el271
1 files changed, 137 insertions, 134 deletions
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 2e0db248409..2c5b72c6c19 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -1,15 +1,19 @@
1;;; feedmail.el --- assist other email packages to massage outgoing messages 1;;; feedmail.el --- assist other email packages to massage outgoing messages
2;;; A replacement for parts of GNUemacs' sendmail.el (specifically, 2;;; This file is in the public domain.
3;;; it's what handles your outgoing mail after you hit C-c C-c in mail 3
4;;; mode). See below for a list of additional features, including the 4;;; Commentary:
5;;; ability to queue messages for later sending. If you are using 5
6;;; fakemail as a subprocess, you can switch to feedmail and eliminate 6;; A replacement for parts of Emacs' sendmail.el (specifically,
7;;; the use of fakemail. feedmail works with recent versions of 7;; it's what handles your outgoing mail after you hit C-c C-c in mail
8;;; GNUemacs (mostly, but not exclusively, tested against 19.34 on 8;; mode). See below for a list of additional features, including the
9;;; Win95; some testing on 20.x) and XEmacs (tested with 20.4 and 9;; ability to queue messages for later sending. If you are using
10;;; later betas). It probably no longer works with GNUemacs v18, 10;; fakemail as a subprocess, you can switch to feedmail and eliminate
11;;; though I haven't tried that in a long time. Sorry, no manual yet 11;; the use of fakemail. feedmail works with recent versions of
12;;; in this release. Look for one with the next release. 12;; Emacs (mostly, but not exclusively, tested against 19.34 on
13;; Win95; some testing on 20.x) and XEmacs (tested with 20.4 and
14;; later betas). It probably no longer works with Emacs 18,
15;; though I haven't tried that in a long time. Sorry, no manual yet
16;; in this release. Look for one with the next release.
13 17
14;; As far as I'm concerned, anyone can do anything they want with 18;; As far as I'm concerned, anyone can do anything they want with
15;; this specific piece of code. No warranty or promise of support is 19;; this specific piece of code. No warranty or promise of support is
@@ -25,8 +29,6 @@
25;; but that doesn't correlate well with the list of folks who have 29;; but that doesn't correlate well with the list of folks who have
26;; actually helped me along the way. 30;; actually helped me along the way.
27 31
28;;; Commentary:
29;;
30;; If you use feedmail, I invite you to send me some email about it. 32;; If you use feedmail, I invite you to send me some email about it.
31;; I appreciate feedback about problems you find or suggestions for 33;; I appreciate feedback about problems you find or suggestions for
32;; improvements or added features (even though I can't predict when 34;; improvements or added features (even though I can't predict when
@@ -35,11 +37,11 @@
35;; tried feedmail and didn't find it useful, so I stopped using it". 37;; tried feedmail and didn't find it useful, so I stopped using it".
36;; 38;;
37;; It is most useful, when sending a bug report, if you tell me what 39;; It is most useful, when sending a bug report, if you tell me what
38;; version of emacs you are using, what version of feedmail you are 40;; version of Emacs you are using, what version of feedmail you are
39;; using, and what versions of other email-related elisp packages you 41;; using, and what versions of other email-related elisp packages you
40;; are using. If in doubt about any of that, send the bug report 42;; are using. If in doubt about any of that, send the bug report
41;; anyhow. 43;; anyhow.
42;; 44;;
43;; ===== 45;; =====
44;; A NOTE TO THOSE WHO WOULD CHANGE THIS CODE... Since it is PD, 46;; A NOTE TO THOSE WHO WOULD CHANGE THIS CODE... Since it is PD,
45;; you're within your rights to do whatever you want. If you do 47;; you're within your rights to do whatever you want. If you do
@@ -142,7 +144,7 @@
142;; (autoload 'feedmail-run-the-queue-no-prompts "feedmail") 144;; (autoload 'feedmail-run-the-queue-no-prompts "feedmail")
143;; (setq auto-mode-alist (cons '("\\.fqm$" . mail-mode) auto-mode-alist)) 145;; (setq auto-mode-alist (cons '("\\.fqm$" . mail-mode) auto-mode-alist))
144;; 146;;
145;; If you are using the desktop.el library to restore your sessions, you might 147;; If you are using the desktop.el library to restore your sessions, you might
146;; like to add the suffix ".fqm" to the list of non-saved things via the variable 148;; like to add the suffix ".fqm" to the list of non-saved things via the variable
147;; desktop-files-not-to-save. 149;; desktop-files-not-to-save.
148;; 150;;
@@ -182,7 +184,7 @@
182;; patchlevel 1, 5 April 1991 184;; patchlevel 1, 5 April 1991
183;; patchlevel 2, 24 May 1991 185;; patchlevel 2, 24 May 1991
184;; 5-may-92 jwz Conditionalized calling expand-mail-aliases, since that 186;; 5-may-92 jwz Conditionalized calling expand-mail-aliases, since that
185;; function doesn't exist in Lucid GNU Emacs or when using 187;; function doesn't exist in Lucid Emacs or when using
186;; mail-abbrevs.el. 188;; mail-abbrevs.el.
187;; patchlevel 3, 3 October 1996 189;; patchlevel 3, 3 October 1996
188;; added queue stuff; still works in v18 190;; added queue stuff; still works in v18
@@ -190,7 +192,7 @@
190;; patchlevel 5, issued by someone else 192;; patchlevel 5, issued by someone else
191;; patchlevel 6, not issued as far as I know 193;; patchlevel 6, not issued as far as I know
192;; patchlevel 7, 20 May 1997 194;; patchlevel 7, 20 May 1997
193;; abandon futile support of GNUemacs v18 (sorry if that hurts you) 195;; abandon futile support of Emacs 18 (sorry if that hurts you)
194;; provide a DATE: header by default 196;; provide a DATE: header by default
195;; provide a default for generating MESSAGE-ID: header contents 197;; provide a default for generating MESSAGE-ID: header contents
196;; and use it by default (slightly changed API) 198;; and use it by default (slightly changed API)
@@ -223,7 +225,7 @@
223;; any other way 225;; any other way
224;; cleanup some of my sloppiness about case-fold-search (a strange 226;; cleanup some of my sloppiness about case-fold-search (a strange
225;; variable) 227;; variable)
226;; best effort following coding conventions from GNUemacs 228;; best effort following coding conventions from Emacs
227;; elisp manual appendix 229;; elisp manual appendix
228;; "customize" (see custom.el) 230;; "customize" (see custom.el)
229;; when user selects "immediate send", clear action prompt since 231;; when user selects "immediate send", clear action prompt since
@@ -335,8 +337,8 @@ feedmail-confirm-outgoing-timeout."
335 "*If non-nil, a timeout in seconds at the send confirmation prompt. 337 "*If non-nil, a timeout in seconds at the send confirmation prompt.
336If a positive number, it's a timeout before sending. If a negative 338If a positive number, it's a timeout before sending. If a negative
337number, it's a timeout before not sending. This will not work if your 339number, it's a timeout before not sending. This will not work if your
338version of emacs doesn't include the function y-or-n-p-with-timeout 340version of Emacs doesn't include the function y-or-n-p-with-timeout
339(e.g., some versions of XEmacs)." 341\(e.g., some versions of XEmacs\)."
340 :group 'feedmail-misc 342 :group 'feedmail-misc
341 :type '(choice (const nil) integer) 343 :type '(choice (const nil) integer)
342) 344)
@@ -346,7 +348,7 @@ version of emacs doesn't include the function y-or-n-p-with-timeout
346 "*If non-nil remove BCC: lines from the message headers. 348 "*If non-nil remove BCC: lines from the message headers.
347In any case, the BCC: lines do participate in the composed address 349In any case, the BCC: lines do participate in the composed address
348list. You may want to leave them in if you're using sendmail 350list. You may want to leave them in if you're using sendmail
349(see feedmail-buffer-eating-function)." 351\(see feedmail-buffer-eating-function\)."
350 :group 'feedmail-headers 352 :group 'feedmail-headers
351 :type 'boolean 353 :type 'boolean
352) 354)
@@ -356,20 +358,20 @@ list. You may want to leave them in if you're using sendmail
356 "*If non-nil remove RESENT-BCC: lines from the message headers. 358 "*If non-nil remove RESENT-BCC: lines from the message headers.
357In any case, the RESENT-BCC: lines do participate in the composed 359In any case, the RESENT-BCC: lines do participate in the composed
358address list. You may want to leave them in if you're using sendmail 360address list. You may want to leave them in if you're using sendmail
359(see feedmail-buffer-eating-function)." 361\(see feedmail-buffer-eating-function\)."
360 :group 'feedmail-headers 362 :group 'feedmail-headers
361 :type 'boolean 363 :type 'boolean
362) 364)
363 365
364 366
365(defcustom feedmail-deduce-bcc-where nil 367(defcustom feedmail-deduce-bcc-where nil
366 "*Where should BCC:/RESENT-BCC: addresses appear in the envelope list? 368 "*Where Bcc:/Resent-Bcc: addresses should appear in the envelope list.
367Addresses for the message envelope are deduced by examining 369Addresses for the message envelope are deduced by examining
368appropriate address headers in the message. Generally, they will show 370appropriate address headers in the message. Generally, they will show
369up in the list of deduced addresses in the order that the headers 371up in the list of deduced addresses in the order that the headers
370happen to appear (duplicate addresses are eliminated in any case). 372happen to appear (duplicate addresses are eliminated in any case).
371This variable can be set to the symbol 'first, in which case the 373This variable can be set to the symbol 'first, in which case the
372BCC:/RESENT-BCC: addresses will appear at the beginning in the list; 374Bcc:/Resent-Bcc: addresses will appear at the beginning in the list;
373or, it can be set to the symbol 'last, in which case they will appear 375or, it can be set to the symbol 'last, in which case they will appear
374at the end of the list. 376at the end of the list.
375 377
@@ -430,9 +432,9 @@ message log."
430 432
431 433
432(defcustom feedmail-force-expand-mail-aliases nil 434(defcustom feedmail-force-expand-mail-aliases nil
433 "*If non-nil force the calling of expand-mail-aliases. 435 "*If non-nil, force the calling of `expand-mail-aliases'.
434Normally, feedmail tries to figure out if you're using mailalias or 436Normally, feedmail tries to figure out if you're using mailalias or
435mailabbrevs and only calls expand-mail-aliases if it thinks you're 437mailabbrevs and only calls `expand-mail-aliases' if it thinks you're
436using the mailalias package. This user option can be used to force 438using the mailalias package. This user option can be used to force
437the issue since there are configurations which fool the figuring 439the issue since there are configurations which fool the figuring
438out." 440out."
@@ -487,9 +489,9 @@ header is fiddled after the FROM: header is fiddled."
487 489
488 490
489(defcustom feedmail-force-binary-write t 491(defcustom feedmail-force-binary-write t
490 "*If non-nil, force writing file as binary. Applies to queues and FCC:. 492 "*If non-nil, force writing file as binary (this applies to queues and FCC:).
491On systems where there is a difference between binary and text files, 493On systems where there is a difference between binary and text files,
492feedmail will temporarily manipulate the values of buffer-file-type 494feedmail will temporarily manipulate the values of `buffer-file-type'
493and/or default-buffer-file-type to make the writing as binary. If 495and/or default-buffer-file-type to make the writing as binary. If
494nil, writing will be in text mode. On systems where there is no 496nil, writing will be in text mode. On systems where there is no
495distinction or where it is controlled by other variables or other 497distinction or where it is controlled by other variables or other
@@ -520,8 +522,8 @@ by feedmail to either \"X-From\" or \"X-Resent-From\".
520A good value would be a string fully-qualified domain name form of 522A good value would be a string fully-qualified domain name form of
521your address. For example, \"bill@bubblegum.net (WJCarpenter)\". The 523your address. For example, \"bill@bubblegum.net (WJCarpenter)\". The
522default value of this variable uses the standard elisp variable 524default value of this variable uses the standard elisp variable
523user-mail-address which should be set on every system but has a decent 525`user-mail-address' which should be set on every system but has a decent
524chance of being wrong. It also honors mail-from-style. Better to set 526chance of being wrong. It also honors `mail-from-style'. Better to set
525this variable explicitly to the string you want or find some other way 527this variable explicitly to the string you want or find some other way
526to arrange for the message to get a FROM: line." 528to arrange for the message to get a FROM: line."
527 :group 'feedmail-headers 529 :group 'feedmail-headers
@@ -532,7 +534,7 @@ to arrange for the message to get a FROM: line."
532(defcustom feedmail-deduce-envelope-from t 534(defcustom feedmail-deduce-envelope-from t
533 "*If non-nil, deduce message envelope \"from\" from header FROM: or SENDER:. 535 "*If non-nil, deduce message envelope \"from\" from header FROM: or SENDER:.
534In other words, if there is a SENDER: header in the message, temporarily 536In other words, if there is a SENDER: header in the message, temporarily
535change the value of user-mail-address to be the same while the message 537change the value of `user-mail-address' to be the same while the message
536is being sent. If there is no SENDER: header, use the FROM: header, 538is being sent. If there is no SENDER: header, use the FROM: header,
537if any. Address values are taken from the actual message just before 539if any. Address values are taken from the actual message just before
538it is sent, and the process is independent of the values of 540it is sent, and the process is independent of the values of
@@ -550,7 +552,7 @@ some normal way for yourself. If for some reason you want to send a
550message with another FROM: line, you can just type it at the top of 552message with another FROM: line, you can just type it at the top of
551the message, and feedmail will take care of \"fixing up\" the envelope 553the message, and feedmail will take care of \"fixing up\" the envelope
552\"from\". This only works for mail senders which make use of 554\"from\". This only works for mail senders which make use of
553user-mail-address as the envelope \"from\" value. For some mail 555`user-mail-address' as the envelope \"from\" value. For some mail
554senders (e.g., feedmail-buffer-to-bin-mail), there is no simple way to 556senders (e.g., feedmail-buffer-to-bin-mail), there is no simple way to
555influence what they will use as the envelope." 557influence what they will use as the envelope."
556 :group 'feedmail-headers 558 :group 'feedmail-headers
@@ -578,7 +580,7 @@ If t, an X-MAILER: header of a predetermined format is produced,
578combining its efforts with any existing X-MAILER: header. If you want 580combining its efforts with any existing X-MAILER: header. If you want
579to take the default construct and just add a little blob of your own 581to take the default construct and just add a little blob of your own
580at the end, define the variable feedmail-x-mailer-line-user-appendage 582at the end, define the variable feedmail-x-mailer-line-user-appendage
581as that blob string. A value of t is equivalent to using the function 583as that blob string. A value of t is equivalent to using the function
582feedmail-default-x-mailer-generator. 584feedmail-default-x-mailer-generator.
583 585
584If neither nil nor t, it may be a string, a fiddle-plex, or a function 586If neither nil nor t, it may be a string, a fiddle-plex, or a function
@@ -626,13 +628,14 @@ in the saved message if you use FCC:."
626 628
627 629
628(defcustom feedmail-message-id-suffix nil 630(defcustom feedmail-message-id-suffix nil
629 "*If non-nil, used as a suffix in generated MESSAGE-ID: headers for uniqueness. 631 "*If non-nil, used as a suffix for generating unique Message-Id: headers.
630The function feedmail-default-message-id-generator creates its work based 632The function `feedmail-default-message-id-generator' creates its work based
631on a formatted date-time string, a random number, and a domain-looking suffix. 633on a formatted date-time string, a random number, and a domain-looking suffix.
632You can control the suffix used by assigning a string value to this variable. If 634You can control the suffix used by assigning a string value to this variable.
633you don't supply one, the value of the variable user-mail-address will be used. 635If you don't supply one, the value of the variable `user-mail-address' will be
634If the value of feedmail-message-id-suffix contains an \"@\" character, the string 636used. If the value of `feedmail-message-id-suffix' contains an \"@\" character,
635will be used verbatim, else an \"@\" character will be prepended automatically." 637the string will be used verbatim, else an \"@\" character will be prepended
638automatically."
636 :group 'feedmail-headers 639 :group 'feedmail-headers
637 :type 'string 640 :type 'string
638) 641)
@@ -674,7 +677,7 @@ in the saved message if you use FCC:."
674 677
675 678
676(defcustom feedmail-fiddle-headers-upwardly t 679(defcustom feedmail-fiddle-headers-upwardly t
677 "*Non-nil means fiddled header fields should be inserted at the top of the header. 680 "*Non-nil means fiddled header fields should go at the top of the header.
678Nil means insert them at the bottom. This is mostly a novelty issue since 681Nil means insert them at the bottom. This is mostly a novelty issue since
679the standards define the ordering of header fields to be immaterial and it's 682the standards define the ordering of header fields to be immaterial and it's
680fairly likely that some MTA along the way will have its own idea of what the 683fairly likely that some MTA along the way will have its own idea of what the
@@ -709,11 +712,11 @@ along with that list to a buffer-eating function which expects any number
709of addressees. If this variable is non-nil, however, feedmail will 712of addressees. If this variable is non-nil, however, feedmail will
710repeatedly call the same buffer-eating function. Each time, the list of 713repeatedly call the same buffer-eating function. Each time, the list of
711addressees will be just one item from the original list. This only affects 714addressees will be just one item from the original list. This only affects
712the message envelope addresses and doesn't affect what appears in the 715the message envelope addresses and doesn't affect what appears in the
713message headers except as noted. 716message headers except as noted.
714 717
715Spray mode is usually pointless, and if you can't think of a good reason for 718Spray mode is usually pointless, and if you can't think of a good reason for
716it, you should avoid it since it is inherently less efficient than normal 719it, you should avoid it since it is inherently less efficient than normal
717multiple delivery. One reason to use it is to overcome mis-featured mail 720multiple delivery. One reason to use it is to overcome mis-featured mail
718transports which betray your trust by revealing BCC: addressees in the 721transports which betray your trust by revealing BCC: addressees in the
719headers of a message. Another use is to do a crude form of mailmerge, for 722headers of a message. Another use is to do a crude form of mailmerge, for
@@ -732,9 +735,9 @@ what happens next is carelessly defined, so beware."
732 "User-supplied specification for a crude form of mailmerge capability. 735 "User-supplied specification for a crude form of mailmerge capability.
733When spraying is enabled, feedmail composes a list of envelope addresses. 736When spraying is enabled, feedmail composes a list of envelope addresses.
734In turn, feedmail-spray-this-address is temporarily set to each address 737In turn, feedmail-spray-this-address is temporarily set to each address
735(stripped of any comments and angle brackets) and calls a function which 738\(stripped of any comments and angle brackets\) and calls a function which
736fiddles message headers according to this variable. For an overview of 739fiddles message headers according to this variable. See the documentation for
737fiddle-plex data structures, see the documentation for feedmail-fiddle-plex-blurb. 740`feedmail-fiddle-plex-blurb', for an overview of fiddle-plex data structures.
738 741
739May be nil, in which case nothing in particular is done about message 742May be nil, in which case nothing in particular is done about message
740headers for specific addresses. 743headers for specific addresses.
@@ -768,7 +771,7 @@ function should return an embellished form of the address.
768 771
769The recipe for sending form letters is: (1) create a message with all 772The recipe for sending form letters is: (1) create a message with all
770addressees on BCC: headers; (2) tell feedmail to remove BCC: headers 773addressees on BCC: headers; (2) tell feedmail to remove BCC: headers
771before sending the message; (3) create a function which will embellish 774before sending the message; (3) create a function which will embellish
772stripped addresses, if desired; (4) define feedmail-spray-address-fiddle-plex-list 775stripped addresses, if desired; (4) define feedmail-spray-address-fiddle-plex-list
773appropriately; (5) send the message with feedmail-enable-spray set 776appropriately; (5) send the message with feedmail-enable-spray set
774non-nil; (6) stand back and watch co-workers wonder at how efficient 777non-nil; (6) stand back and watch co-workers wonder at how efficient
@@ -1042,7 +1045,7 @@ any."
1042 1045
1043(defcustom feedmail-queue-default-file-slug t 1046(defcustom feedmail-queue-default-file-slug t
1044 "*Indicates what to use for subject-less messages when forming a file name. 1047 "*Indicates what to use for subject-less messages when forming a file name.
1045When feedmail queues a message, it creates a unique file name. By default, 1048When feedmail queues a message, it creates a unique file name. By default,
1046the file name is based in part on the subject of the message being queued. 1049the file name is based in part on the subject of the message being queued.
1047If there is no subject, consult this variable. See documentation for the 1050If there is no subject, consult this variable. See documentation for the
1048function feedmail-queue-subject-slug-maker. 1051function feedmail-queue-subject-slug-maker.
@@ -1093,7 +1096,7 @@ message buffers."
1093Normally, feedmail will notice such files when you send a message in 1096Normally, feedmail will notice such files when you send a message in
1094immediate mode (i.e., not when you're running the queue) and will ask if 1097immediate mode (i.e., not when you're running the queue) and will ask if
1095you want to delete them. Since the answer is usually yes, setting this 1098you want to delete them. Since the answer is usually yes, setting this
1096variable to non-nil will tell feedmail to skip the prompt and just delete 1099variable to non-nil will tell feedmail to skip the prompt and just delete
1097the file without bothering you." 1100the file without bothering you."
1098 :group 'feedmail-queue 1101 :group 'feedmail-queue
1099 :type 'boolean 1102 :type 'boolean
@@ -1101,10 +1104,10 @@ the file without bothering you."
1101 1104
1102 1105
1103;; defvars to make byte-compiler happy(er) 1106;; defvars to make byte-compiler happy(er)
1104(defvar feedmail-error-buffer nil "not a user option variable") 1107(defvar feedmail-error-buffer nil)
1105(defvar feedmail-prepped-text-buffer nil "not a user option variable") 1108(defvar feedmail-prepped-text-buffer nil)
1106(defvar feedmail-raw-text-buffer nil "not a user option variable") 1109(defvar feedmail-raw-text-buffer nil)
1107(defvar feedmail-address-list nil "not a user option variable") 1110(defvar feedmail-address-list nil)
1108 1111
1109 1112
1110(defun feedmail-mail-send-hook-splitter () 1113(defun feedmail-mail-send-hook-splitter ()
@@ -1185,15 +1188,15 @@ internal buffers will be reused and things will get confused."
1185 1188
1186(defcustom feedmail-queue-runner-mode-setter 1189(defcustom feedmail-queue-runner-mode-setter
1187 '(lambda (&optional arg) (mail-mode)) 1190 '(lambda (&optional arg) (mail-mode))
1188 "*A function to set the proper mode of a message file. Called when 1191 "*A function to set the proper mode of a message file.
1189the message is read back out of the queue directory with a single 1192Called when the message is read back out of the queue directory with a single
1190argument, the optional argument used in the call to 1193argument, the optional argument used in the call to
1191feedmail-run-the-queue or feedmail-run-the-queue-no-prompts. 1194feedmail-run-the-queue or feedmail-run-the-queue-no-prompts.
1192 1195
1193Most people want mail-mode, so the default value is an anonymous 1196Most people want `mail-mode', so the default value is an anonymous
1194function which is just a wrapper to ignore the supplied argument when 1197function which is just a wrapper to ignore the supplied argument when
1195calling it, but here's your chance to have something different. 1198calling it, but here's your chance to have something different.
1196Called with funcall, not call-interactively." 1199Called with funcall, not `call-interactively'."
1197 :group 'feedmail-queue 1200 :group 'feedmail-queue
1198 :type 'function 1201 :type 'function
1199) 1202)
@@ -1201,15 +1204,15 @@ Called with funcall, not call-interactively."
1201 1204
1202(defcustom feedmail-queue-alternative-mail-header-separator nil 1205(defcustom feedmail-queue-alternative-mail-header-separator nil
1203 "*Alternative header demarcation for queued messages. 1206 "*Alternative header demarcation for queued messages.
1204If you sometimes get alternative values for mail-header-separator in 1207If you sometimes get alternative values for `mail-header-separator' in
1205queued messages, set the value of this variable to whatever it is. 1208queued messages, set the value of this variable to whatever it is.
1206For example, rmail-resend uses a mail-header-separator value of empty 1209For example, `rmail-resend' uses a `mail-header-separator' value of empty
1207string (\"\") when you send/queue a message. 1210string (\"\") when you send/queue a message.
1208 1211
1209When trying to send a queued message, if the value of this variable is 1212When trying to send a queued message, if the value of this variable is
1210non-nil, feedmail will first try to send the message using the value 1213non-nil, feedmail will first try to send the message using the value
1211of mail-header-separator. If it can't find that, it will temporarily 1214of `mail-header-separator'. If it can't find that, it will temporarily
1212set mail-header-separator to the value of 1215set `mail-header-separator' to the value of
1213feedmail-queue-alternative-mail-header-separator and try again." 1216feedmail-queue-alternative-mail-header-separator and try again."
1214 :group 'feedmail-queue 1217 :group 'feedmail-queue
1215 :type 'string 1218 :type 'string
@@ -1234,20 +1237,19 @@ call-interactively."
1234 '(lambda (fqm-file &optional arg) 1237 '(lambda (fqm-file &optional arg)
1235 (delete-file fqm-file) 1238 (delete-file fqm-file)
1236 (if (and arg feedmail-queue-chatty) (message "FQM: Nuked %s" fqm-file))) 1239 (if (and arg feedmail-queue-chatty) (message "FQM: Nuked %s" fqm-file)))
1237 "*Function that will be called after a message has been sent. It's 1240 "*Function that will be called after a message has been sent.
1238not called in the case of errors. This function is called with two 1241Not called in the case of errors. This function is called with two
1239arguments, the name of the message queue file for the message just 1242arguments: the name of the message queue file for the message just sent,
1240sent, and the optional argument used in the call to 1243and the optional argument used in the call to `feedmail-run-the-queue'
1241feedmail-run-the-queue or feedmail-run-the-queue-no-prompts. 1244or `feedmail-run-the-queue-no-prompts' (prefix arg if interactive).
1242Interactively, that argument will be the prefix argument. In any 1245In any case, the affiliated buffer is killed elsewhere, so don't do that
1243case, the affiliated buffer is killed elsewhere, so don't do that
1244inside this function. Return value is ignored. 1246inside this function. Return value is ignored.
1245 1247
1246The default action is an anonymous function which gets rid of the file 1248The default action is an anonymous function which gets rid of the file
1247from the queue directory. With a non-nil second argument, a brief 1249from the queue directory. With a non-nil second argument, a brief
1248message is give for each file deleted. You could replace this 1250message is give for each file deleted. You could replace this
1249function, for example, to archive all of your sent messages someplace 1251function, for example, to archive all of your sent messages someplace
1250(though there are better ways to get that particular result)." 1252\(though there are better ways to get that particular result\)."
1251 :group 'feedmail-queue 1253 :group 'feedmail-queue
1252 :type 'function 1254 :type 'function
1253) 1255)
@@ -1295,7 +1297,7 @@ Used in feedmail-buffer-to-binmail to form the shell command which
1295will receive the contents of the prepped buffer as stdin. If you'd 1297will receive the contents of the prepped buffer as stdin. If you'd
1296like your errors to come back as mail instead of immediately in a 1298like your errors to come back as mail instead of immediately in a
1297buffer, try /bin/rmail instead of /bin/mail (this can be accomplished 1299buffer, try /bin/rmail instead of /bin/mail (this can be accomplished
1298by keeping the default nil setting of mail-interactive). You might 1300by keeping the default nil setting of `mail-interactive'). You might
1299also like to consult local mail experts for any other interesting 1301also like to consult local mail experts for any other interesting
1300command line possibilities." 1302command line possibilities."
1301 :group 'feedmail-misc 1303 :group 'feedmail-misc
@@ -1364,27 +1366,27 @@ complicated cases."
1364 1366
1365;; just a place to park a docstring 1367;; just a place to park a docstring
1366(defconst feedmail-fiddle-plex-blurb nil 1368(defconst feedmail-fiddle-plex-blurb nil
1367 "A fiddle-plex is a concise way of specifying how to fiddle with a header field. 1369 "A fiddle-plex is a concise way of specifying header field fiddling.
1368It is a list of up to 4 elements: NAME, VALUE, ACTION, FOLDING. The element 1370It is a list of up to 4 elements: NAME, VALUE, ACTION, FOLDING. The element
1369VALUE can also be a list sometimes. 1371VALUE can also be a list sometimes.
1370 1372
1371NAME is the name of the header field to be fiddled with. Although case doesn't 1373NAME is the name of the header field to be fiddled with. Although case
1372matter in looking for headers, case of NAME is preserved when a header is inserted 1374doesn't matter in looking for headers, case of NAME is preserved when a header
1373via fiddling. It shouldn't include the trailing colon. 1375is inserted via fiddling. It shouldn't include the trailing colon.
1374 1376
1375VALUE is either nil, a simple string, a function returning nil or a string, or, 1377VALUE is either nil, a simple string, a function returning nil or a string, or,
1376as described below for ACTION 'combine, a list of up to three values. 1378as described below for ACTION `combine', a list of up to three values.
1377 1379
1378ACTION describes the nature of the fiddling to be done. Possibilities 1380ACTION describes the nature of the fiddling to be done. Possibilities
1379for ACTION (default is 'supplement): 1381for ACTION (default is `supplement'):
1380 1382
1381 'supplement Leave other like fields as-is, insert this one. 1383 `supplement' Leave other like fields as-is, insert this one.
1382 1384
1383 'replace Delete other like fields, if any, and insert this one. 1385 `replace' Delete other like fields, if any, and insert this one.
1384 1386
1385 'create Insert this one only if no like field exists. 1387 `create' Insert this one only if no like field exists.
1386 1388
1387 'combine Combine aggregate values of like fields with this one. 1389 `combine' Combine aggregate values of like fields with this one.
1388 In this case, VALUE has a special form. It is a list 1390 In this case, VALUE has a special form. It is a list
1389 of three items: VAL-PRE, VAL-LIKE, and VAL-POST. 1391 of three items: VAL-PRE, VAL-LIKE, and VAL-POST.
1390 VAL-PRE and VAL-POST are strings or nil. VAL-LIKE may 1392 VAL-PRE and VAL-POST are strings or nil. VAL-LIKE may
@@ -1397,7 +1399,7 @@ for ACTION (default is 'supplement):
1397 fields, or the aggregate value is an empty string, 1399 fields, or the aggregate value is an empty string,
1398 VAL-LIKE is not used. Else, if VAL-LIKE is a function, 1400 VAL-LIKE is not used. Else, if VAL-LIKE is a function,
1399 it is called with two arguments: NAME and the 1401 it is called with two arguments: NAME and the
1400 aggregate like values. Else, if VAL-LIKE is a string, it is 1402 aggregate like values. Else, if VAL-LIKE is a string, it is
1401 used as a format string where a single \%s will be 1403 used as a format string where a single \%s will be
1402 replaced by the aggregate values of like fields. 1404 replaced by the aggregate values of like fields.
1403 1405
@@ -1416,12 +1418,11 @@ for ACTION (default is 'supplement):
1416 1418
1417FOLDING can be nil, in which case VALUE is used as-is. If FOLDING is 1419FOLDING can be nil, in which case VALUE is used as-is. If FOLDING is
1418non-nil, feedmail \"smart filling\" is done on VALUE just before 1420non-nil, feedmail \"smart filling\" is done on VALUE just before
1419insertion. 1421insertion.")
1420")
1421 1422
1422 1423
1423(defun feedmail-send-it () 1424(defun feedmail-send-it ()
1424 "A function which is a suitable value for send-mail-function. 1425 "A function which is a suitable value for `send-mail-function'.
1425To use it, you probably want something like this in your .emacs or 1426To use it, you probably want something like this in your .emacs or
1426similar place: 1427similar place:
1427 1428
@@ -1523,7 +1524,7 @@ similar place:
1523;;;###autoload 1524;;;###autoload
1524(defun feedmail-run-the-queue-global-prompt (&optional arg) 1525(defun feedmail-run-the-queue-global-prompt (&optional arg)
1525 "Like feedmail-run-the-queue, but with a global confirmation prompt. 1526 "Like feedmail-run-the-queue, but with a global confirmation prompt.
1526This is generally most useful if run non-interactively, since you can 1527This is generally most useful if run non-interactively, since you can
1527bail out with an appropriate answer to the global confirmation prompt." 1528bail out with an appropriate answer to the global confirmation prompt."
1528 (interactive "p") 1529 (interactive "p")
1529 (let ((feedmail-queue-runner-confirm-global t)) (feedmail-run-the-queue arg))) 1530 (let ((feedmail-queue-runner-confirm-global t)) (feedmail-run-the-queue arg)))
@@ -1573,7 +1574,7 @@ backup file names and the like)."
1573 '(lambda (blobby) 1574 '(lambda (blobby)
1574 (setq maybe-file (expand-file-name blobby feedmail-queue-directory)) 1575 (setq maybe-file (expand-file-name blobby feedmail-queue-directory))
1575 (cond 1576 (cond
1576 ((file-directory-p maybe-file) nil) ; don't care about subdirs 1577 ((file-directory-p maybe-file) nil) ; don't care about subdirs
1577 ((feedmail-fqm-p blobby) 1578 ((feedmail-fqm-p blobby)
1578 (setq blobby-buffer (generate-new-buffer (concat "FQM " blobby))) 1579 (setq blobby-buffer (generate-new-buffer (concat "FQM " blobby)))
1579 (setq already-buffer 1580 (setq already-buffer
@@ -1604,7 +1605,7 @@ backup file names and the like)."
1604 ;; if M-H-S not found and (a-M-H-S is nil or not found) 1605 ;; if M-H-S not found and (a-M-H-S is nil or not found)
1605 (if (and (not (feedmail-find-eoh t)) 1606 (if (and (not (feedmail-find-eoh t))
1606 (or (not feedmail-queue-alternative-mail-header-separator) 1607 (or (not feedmail-queue-alternative-mail-header-separator)
1607 (not 1608 (not
1608 (let ((mail-header-separator feedmail-queue-alternative-mail-header-separator)) 1609 (let ((mail-header-separator feedmail-queue-alternative-mail-header-separator))
1609 (feedmail-find-eoh t))))) 1610 (feedmail-find-eoh t)))))
1610 (let ((file-name-buffer-file-type-alist nil) (default-buffer-file-type nil)) 1611 (let ((file-name-buffer-file-type-alist nil) (default-buffer-file-type nil))
@@ -1645,7 +1646,7 @@ backup file names and the like)."
1645 (sit-for feedmail-queue-chatty-sit-for)))))) 1646 (sit-for feedmail-queue-chatty-sit-for))))))
1646 list-of-possible-fqms))) 1647 list-of-possible-fqms)))
1647 (if feedmail-queue-chatty 1648 (if feedmail-queue-chatty
1648 (progn 1649 (progn
1649 (message "FQM: %d sent, %d skipped (%d other files ignored)" 1650 (message "FQM: %d sent, %d skipped (%d other files ignored)"
1650 messages-sent messages-skipped q-oth) 1651 messages-sent messages-skipped q-oth)
1651 (sit-for feedmail-queue-chatty-sit-for) 1652 (sit-for feedmail-queue-chatty-sit-for)
@@ -1670,8 +1671,8 @@ internally by feedmail):
1670 1671
1671WHAT-EVENT is used as a key into the table feedmail-queue-reminder-alist. If 1672WHAT-EVENT is used as a key into the table feedmail-queue-reminder-alist. If
1672the associated value is a function, it is called without arguments and is expected 1673the associated value is a function, it is called without arguments and is expected
1673to perform the reminder activity. You can supply your own reminder functions 1674to perform the reminder activity. You can supply your own reminder functions
1674by redefining feedmail-queue-reminder-alist. If you don't want any reminders, 1675by redefining feedmail-queue-reminder-alist. If you don't want any reminders,
1675you can set feedmail-queue-reminder-alist to nil." 1676you can set feedmail-queue-reminder-alist to nil."
1676 (interactive "p") 1677 (interactive "p")
1677 (let ((key (if (and what-event (symbolp what-event)) what-event 'on-demand)) entry reminder) 1678 (let ((key (if (and what-event (symbolp what-event)) what-event 'on-demand)) entry reminder)
@@ -1735,9 +1736,11 @@ you can set feedmail-queue-reminder-alist to nil."
1735 (setq answer '(^ . feedmail-message-action-help)) 1736 (setq answer '(^ . feedmail-message-action-help))
1736 (if (or (eq user-sez ?\C-m) (eq user-sez ?\C-j) (eq user-sez ?y)) 1737 (if (or (eq user-sez ?\C-m) (eq user-sez ?\C-j) (eq user-sez ?y))
1737 (setq user-sez d-char)) 1738 (setq user-sez d-char))
1738 ;; these char-to-int things because of some incomprensible difference 1739 ;; these char-to-int things are because of some
1739 ;; between the two in byte-compiled stuff between GNUemacs and XEmacs 1740 ;; incomprensible difference between the two in
1740 ;; (well, I'm sure someone could comprehend it, but I say 'uncle') 1741 ;; byte-compiled stuff between Emacs and XEmacs
1742 ;; (well, I'm sure someone could comprehend it,
1743 ;; but I say 'uncle')
1741 (setq answer (or (assoc user-sez feedmail-prompt-before-queue-user-alist) 1744 (setq answer (or (assoc user-sez feedmail-prompt-before-queue-user-alist)
1742 (and (fboundp 'char-to-int) 1745 (and (fboundp 'char-to-int)
1743 (assoc (char-to-int user-sez) feedmail-prompt-before-queue-user-alist)) 1746 (assoc (char-to-int user-sez) feedmail-prompt-before-queue-user-alist))
@@ -1831,7 +1834,7 @@ the counts."
1831 (list q-cnt q-oth high-water))) 1834 (list q-cnt q-oth high-water)))
1832 1835
1833(defun feedmail-tidy-up-slug (slug) 1836(defun feedmail-tidy-up-slug (slug)
1834 "Utility for mapping out suspect characters in a potential filename" 1837 "Utility for mapping out suspect characters in a potential filename."
1835 ;; even programmers deserve a break sometimes, so cover nil for them 1838 ;; even programmers deserve a break sometimes, so cover nil for them
1836 (if (null slug) (setq slug "")) 1839 (if (null slug) (setq slug ""))
1837 ;; replace all non-alphanumerics with hyphen for safety 1840 ;; replace all non-alphanumerics with hyphen for safety
@@ -1843,7 +1846,7 @@ the counts."
1843 ;; for tidyness, peel off trailing hyphens 1846 ;; for tidyness, peel off trailing hyphens
1844 (if (string-match "-*$" slug) (setq slug (replace-match "" nil nil slug))) 1847 (if (string-match "-*$" slug) (setq slug (replace-match "" nil nil slug)))
1845 slug 1848 slug
1846) 1849)
1847 1850
1848(defun feedmail-queue-subject-slug-maker (&optional queue-directory) 1851(defun feedmail-queue-subject-slug-maker (&optional queue-directory)
1849 "Create a name for storing the message in the queue. 1852 "Create a name for storing the message in the queue.
@@ -2077,7 +2080,7 @@ mapped to mostly alphanumerics for safety."
2077 (y-or-n-p (format "FQM: Delete message file %s? " also-file))) 2080 (y-or-n-p (format "FQM: Delete message file %s? " also-file)))
2078 (save-excursion 2081 (save-excursion
2079 ;; if we delete the affiliated file, get rid 2082 ;; if we delete the affiliated file, get rid
2080 ;; of the file name association and make sure we 2083 ;; of the file name association and make sure we
2081 ;; don't annoy people with a prompt on exit 2084 ;; don't annoy people with a prompt on exit
2082 (delete-file also-file) 2085 (delete-file also-file)
2083 (set-buffer feedmail-raw-text-buffer) 2086 (set-buffer feedmail-raw-text-buffer)
@@ -2194,7 +2197,7 @@ feedmail-fiddle-plex-blurb."
2194 (mapcar 2197 (mapcar
2195 '(lambda (feedmail-spray-this-address) 2198 '(lambda (feedmail-spray-this-address)
2196 (let ((spray-buffer (get-buffer-create " *FQM Outgoing Email Spray*"))) 2199 (let ((spray-buffer (get-buffer-create " *FQM Outgoing Email Spray*")))
2197 (save-excursion 2200 (save-excursion
2198 (set-buffer spray-buffer) 2201 (set-buffer spray-buffer)
2199 (erase-buffer) 2202 (erase-buffer)
2200 ;; not life's most efficient methodology, but spraying isn't 2203 ;; not life's most efficient methodology, but spraying isn't
@@ -2225,8 +2228,8 @@ feedmail-fiddle-plex-blurb."
2225 2228
2226 2229
2227(defun feedmail-envelope-deducer (eoh-marker) 2230(defun feedmail-envelope-deducer (eoh-marker)
2228 "If feedmail-deduce-envelope-from is false, simply return 2231 "If feedmail-deduce-envelope-from is false, simply return `user-mail-address'.
2229user-mail-address. Else, look for SENDER: or FROM: (or RESENT-*) and 2232Else, look for SENDER: or FROM: (or RESENT-*) and
2230return that value." 2233return that value."
2231 (if (not feedmail-deduce-envelope-from) 2234 (if (not feedmail-deduce-envelope-from)
2232 user-mail-address 2235 user-mail-address
@@ -2254,7 +2257,7 @@ return that value."
2254 ;; improvement using user-mail-address suggested by 2257 ;; improvement using user-mail-address suggested by
2255 ;; gray@austin.apc.slb.com (Douglas Gray Stephens) 2258 ;; gray@austin.apc.slb.com (Douglas Gray Stephens)
2256 ((eq t feedmail-from-line) 2259 ((eq t feedmail-from-line)
2257 (let ((feedmail-from-line 2260 (let ((feedmail-from-line
2258 (let ((at-stuff 2261 (let ((at-stuff
2259 (if user-mail-address user-mail-address (concat (user-login-name) "@" (system-name))))) 2262 (if user-mail-address user-mail-address (concat (user-login-name) "@" (system-name)))))
2260 (cond 2263 (cond
@@ -2353,7 +2356,7 @@ return that value."
2353(defun feedmail-default-message-id-generator (maybe-file) 2356(defun feedmail-default-message-id-generator (maybe-file)
2354 "Default function for generating MESSAGE-ID: header contents. 2357 "Default function for generating MESSAGE-ID: header contents.
2355Based on a date and a sort of random number for tie breaking. Unless 2358Based on a date and a sort of random number for tie breaking. Unless
2356feedmail-message-id-suffix is defined, uses user-mail-address, so be 2359feedmail-message-id-suffix is defined, uses `user-mail-address', so be
2357sure it's set." 2360sure it's set."
2358 (let ((date-time) 2361 (let ((date-time)
2359 (end-stuff (if feedmail-message-id-suffix feedmail-message-id-suffix user-mail-address))) 2362 (end-stuff (if feedmail-message-id-suffix feedmail-message-id-suffix user-mail-address)))
@@ -2474,34 +2477,34 @@ sure it's set."
2474 "Fiddling based on a list of fiddle-plexes for spraying." 2477 "Fiddling based on a list of fiddle-plexes for spraying."
2475 ;; default is to fall off the end of the list and do nothing 2478 ;; default is to fall off the end of the list and do nothing
2476 (let ((lofp list-of-fiddle-plexes) fp) 2479 (let ((lofp list-of-fiddle-plexes) fp)
2477 (if (listp lofp) 2480 (if (listp lofp)
2478 (while lofp 2481 (while lofp
2479 (setq fp (car lofp)) 2482 (setq fp (car lofp))
2480 (setq lofp (cdr lofp)) 2483 (setq lofp (cdr lofp))
2481 (feedmail-fiddle-spray-address fp)) 2484 (feedmail-fiddle-spray-address fp))
2482 (feedmail-fiddle-spray-address lofp)))) 2485 (feedmail-fiddle-spray-address lofp))))
2483 2486
2484 2487
2485(defun feedmail-fiddle-list-of-fiddle-plexes (list-of-fiddle-plexes) 2488(defun feedmail-fiddle-list-of-fiddle-plexes (list-of-fiddle-plexes)
2486 "Fiddling based on a list of fiddle-plexes. Values t, nil, and string are pointless." 2489 "Fiddling based on a list of fiddle-plexes. Values t, nil, and string are pointless."
2487 ;; default is to fall off the end of the list and do nothing 2490 ;; default is to fall off the end of the list and do nothing
2488 (let ((lofp list-of-fiddle-plexes) fp) 2491 (let ((lofp list-of-fiddle-plexes) fp)
2489 (while lofp 2492 (while lofp
2490 (setq fp (car lofp)) 2493 (setq fp (car lofp))
2491 (setq lofp (cdr lofp)) 2494 (setq lofp (cdr lofp))
2492 (cond 2495 (cond
2493 2496
2494 ;; if it's a function, call it and recurse with the resulting value 2497 ;; if it's a function, call it and recurse with the resulting value
2495 ((and (symbolp fp) (fboundp fp)) 2498 ((and (symbolp fp) (fboundp fp))
2496 (let ((lofp (list (funcall fp)))) (feedmail-fiddle-list-of-fiddle-plexes lofp))) 2499 (let ((lofp (list (funcall fp)))) (feedmail-fiddle-list-of-fiddle-plexes lofp)))
2497 2500
2498 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle 2501 ;; if it's a list, it must be a fiddle-plex -- so fiddle, man, fiddle
2499 ((listp fp) 2502 ((listp fp)
2500 (feedmail-fiddle-header 2503 (feedmail-fiddle-header
2501 (nth 0 fp) 2504 (nth 0 fp)
2502 (nth 1 fp) ;; value 2505 (nth 1 fp);; value
2503 (nth 2 fp) ;; action 2506 (nth 2 fp);; action
2504 (nth 3 fp))))))) ;; folding 2507 (nth 3 fp)))))));; folding
2505 2508
2506 2509
2507(defun feedmail-accume-n-nuke-header (header-end header-regexp) 2510(defun feedmail-accume-n-nuke-header (header-end header-regexp)
@@ -2510,18 +2513,18 @@ There may be multiple such lines, and each may have arbitrarily
2510many continuation lines. Return an accumulation of the deleted 2513many continuation lines. Return an accumulation of the deleted
2511headers, including the intervening newlines." 2514headers, including the intervening newlines."
2512 (let ((case-fold-search t) (dropout)) 2515 (let ((case-fold-search t) (dropout))
2513 (save-excursion 2516 (save-excursion
2514 (goto-char (point-min)) 2517 (goto-char (point-min))
2515 ;; iterate over all matching lines 2518 ;; iterate over all matching lines
2516 (while (re-search-forward header-regexp header-end t) 2519 (while (re-search-forward header-regexp header-end t)
2517 (forward-line 1) 2520 (forward-line 1)
2518 (setq dropout (concat dropout (buffer-substring (match-beginning 0) (point)))) 2521 (setq dropout (concat dropout (buffer-substring (match-beginning 0) (point))))
2519 (delete-region (match-beginning 0) (point)) 2522 (delete-region (match-beginning 0) (point))
2520 ;; get rid of any continuation lines 2523 ;; get rid of any continuation lines
2521 (while (and (looking-at "^[ \t].*\n") (< (point) header-end)) 2524 (while (and (looking-at "^[ \t].*\n") (< (point) header-end))
2522 (forward-line 1) 2525 (forward-line 1)
2523 (setq dropout (concat dropout (buffer-substring (match-beginning 0) (point)))) 2526 (setq dropout (concat dropout (buffer-substring (match-beginning 0) (point))))
2524 (replace-match "")))) 2527 (replace-match ""))))
2525 (identity dropout))) 2528 (identity dropout)))
2526 2529
2527(defun feedmail-fill-to-cc-function (header-end) 2530(defun feedmail-fill-to-cc-function (header-end)