1. xemacs
  2. net-utils

Commits

didierv  committed c0430bf

Re: feedmail.el - Fix typo in BCC regex

  • Participants
  • Parent commits 05bcdb7
  • Branches default

Comments (0)

Files changed (2)

File ChangeLog

View file
  • Ignore whitespace
+2008-03-03  Didier Verna  <didier@xemacs.org>
+
+	* feedmail.el (feedmail-fill-to-cc-function): Fix BCC regexp (add
+	missing colon).
+	From Volker Zell  <Dr.Volker.Zell@oracle.com>
+
 2007-11-29  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.54 released.
 	Japanese, but that English is the working language of the project
 	and reports in it are preferred.
 	* xemacsbug.el (report-xemacs-bug-help):
-	Don't quote the lambda expression as a list. 
+	Don't quote the lambda expression as a list.
 	* xemacsbug.el (xemacs-default-composefunc-dont-nag): New.
 	defvar it here (it's been added to the core of 21.5) to avoid
-	compile errors on 21.4. 
+	compile errors on 21.4.
 	* xemacsbug.el (report-xemacs-bug):
 	Bind xemacs-default-composefunc-dont-nag to avoid warnings about
-	the crapness of the default email client when reporting bugs. 
+	the crapness of the default email client when reporting bugs.
 	* xemacsbug.el (report-xemacs-bug-hook):
-	Don't quote the lambda expression as a list. 
+	Don't quote the lambda expression as a list.
 
 2007-06-22  Norbert Koch  <viteno@xemacs.org>
 
 2006-12-29  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* json.el:
-	Imported from http://edward.oconnor.cx/elisp/json.el. 
+	Imported from http://edward.oconnor.cx/elisp/json.el.
 	* json.el (json-unicode-setup): New.
 	This function checks what Unicode support is available in the
 	current emacs, and initialises json-encode-char0 and
 	(google-query): No need to send ssl extension in the request.
 	Send either "SXEmacs" or "XEmacs" as part of the user-agent
 	string, depending on which flavour is being used.
-    
+
 	Somewhere along the line, google-query.el stopped working because
 	the Google folks decided to change the HTML of the search results
 	pages.  This changeset takes care of that.  Plus a couple of minor
 	things like nuking the RCS header and local-variables section.
-	
+
 2005-10-12  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.48 released.
 	(google-query-process-results): Use `google-query-mode' instead of
 	fooling around with electric help.
 	Tweak the code for filtering out all the useless crud that google
-	returns. 
+	returns.
 	Fill the results.
 
 2005-03-14  Norbert Koch  <viteno@xemacs.org>
 	(mozmail-compose-emacs): New.
 	(mozmail-compose-rmail): New.
 	(mozmail): Use `mozmail-compose' instead of
-	`mozmail-compose-gnus'. 
+	`mozmail-compose-gnus'.
 
 	Update the file's commentary section.
 
 	Don't require gnus-xmas.
 
 	* mozmail.el (mozmail-split-string): New.  For GNU/Emacs
-	compatibility. 
+	compatibility.
 	(mozmail-split-url): Use it.
 
 2004-01-04  Mario Lang  <lang@zid.tugraz.at>
 2003-12-03  Steve Youngs  <sryoungs@bigpond.net.au>
 
 	* xml.el: defalias `match-string-no-properties' to
-	`match-string'. 
+	`match-string'.
 
 	* webster-www.el: Autoload `w3-form-encode-xwfu' at compile time.
 
 2003-01-23  Steve Youngs  <youngs@xemacs.org>
 
 	* xemacsbug.el (report-xemacs-bug-beta-extra-headers): Default to
-	nil. 
+	nil.
 	(report-xemacs-bug-hook): Remove code that converted non-ASCII
 	characters to hex.  As advised by Stephen Turnbull.
 
 	(report-xemacs-bug-help): New.
 	(report-xemacs-bug-hook): Use electric help.
 	Fix bug that was causing an error when searching for the Cc
-	header. 
+	header.
 
 2003-01-13  Steve Youngs  <youngs@xemacs.org>
 
 2003-01-12  Steve Youngs  <youngs@xemacs.org>
 
 	* xemacsbug.el (report-xemacs-bug-address): Put address in angled
-	brackets. 
+	brackets.
 	(report-xemacs-bug-beta-address): Ditto.
 	(report-xemacs-bug-beta-extra-headers): Change Cc to my address.
 	(report-xemacs-bug): Update Instructions.

File feedmail.el

View file
  • Ignore whitespace
-;;; feedmail.el --- assist other email packages to massage outgoing messages 
+;;; feedmail.el --- assist other email packages to massage outgoing messages
 ;;; A replacement for parts of GNUemacs' sendmail.el (specifically,
 ;;; it's what handles your outgoing mail after you hit C-c C-c in mail
 ;;; mode).  See below for a list of additional features, including the
 ;; using, and what versions of other email-related elisp packages you
 ;; are using.  If in doubt about any of that, send the bug report
 ;; anyhow.
-;; 
+;;
 ;; =====
 ;; A NOTE TO THOSE WHO WOULD CHANGE THIS CODE...  Since it is PD,
 ;; you're within your rights to do whatever you want.  If you do
 ;;     (autoload 'feedmail-buffer-to-smtp "feedmail" nil t)
 ;;     (setq feedmail-buffer-eating-function 'feedmail-buffer-to-smtp)
 ;;
-;; If you are using the desktop.el library to restore your sessions, you might 
+;; If you are using the desktop.el library to restore your sessions, you might
 ;; like to add the suffix ".fqm" to the list of non-saved things via the variable
 ;; desktop-files-not-to-save.
 ;;
 ;;     (add-hook 'message-mail-send-hook 'feedmail-mail-send-hook-splitter)
 ;;
 ;; If you use message-mode and you make use of feedmail's queueing
-;; stuff, you might also like to adjust these variables to appropriate 
+;; stuff, you might also like to adjust these variables to appropriate
 ;; values for message-mode:
 ;;
 ;;     feedmail-queue-runner-mode-setter
 ;;     feedmail-queue-runner-message-sender
-;;      
+;;
 ;; If you are using the "cmail" email package, there is some built-in
 ;; support for feedmail in recent versions.  To enable it, you should:
 ;;
 ;;           systems with non-classic /bin/[r]mail behavior
 ;;         guard against nil user-mail-address in generating MESSAGE-ID:
 ;;         feedmail-queue-slug-suspect-regexp is now a variable to
-;;           accomodate non-ASCII environments (thanks to 
+;;           accomodate non-ASCII environments (thanks to
 ;;           Makoto.Nakagawa@jp.compaq.com for this suggestion)
 ;;         feedmail-buffer-to-smtp, to parallel feedmail-buffer-to-smtpmail
 ;; patchlevel 10, 22 April 2001
 combining its efforts with any existing X-MAILER: header.  If you want
 to take the default construct and just add a little blob of your own
 at the end, define the variable feedmail-x-mailer-line-user-appendage
-as that blob string.  A value of t is equivalent to using the function 
+as that blob string.  A value of t is equivalent to using the function
 feedmail-default-x-mailer-generator.
 
 If neither nil nor t, it may be a string, a fiddle-plex, or a function
 of addressees.  If this variable is non-nil, however, feedmail will
 repeatedly call the same buffer-eating function.  Each time, the list of
 addressees will be just one item from the original list.  This only affects
-the message envelope addresses and doesn't affect what appears in the 
+the message envelope addresses and doesn't affect what appears in the
 message headers except as noted.
 
 Spray mode is usually pointless, and if you can't think of a good reason for
-it, you should avoid it since it is inherently less efficient than normal 
+it, you should avoid it since it is inherently less efficient than normal
 multiple delivery.  One reason to use it is to overcome mis-featured mail
 transports which betray your trust by revealing BCC: addressees in the
 headers of a message.  Another use is to do a crude form of mailmerge, for
 May be a function, in which case it is called with no arguments and is
 expected to return nil, t, a string, another function, or a fiddle-plex.
 The result is used recursively.  The function may alter the value of the
-variable feedmail-spray-this-address, perhaps to embellish it with a 
+variable feedmail-spray-this-address, perhaps to embellish it with a
 human name.  It would be logical in such a case to return as a value a
 string naming a message header like \"TO\" or an appropriately constructed
 fiddle-plex.  For an example, see feedmail-spray-via-bbdb.
 in place of strings which may cause problems in filenames.  By default,
 only alphanumeric and hyphen characters are kept, and all others are
 converted.  In non-ASCII environments, it may be more helpful to
-tweak this regular expression to reflect local or personal language 
+tweak this regular expression to reflect local or personal language
 conventions.  Substitutions are done repeatedly until the regular expression
 no longer matches to transformed string.  Used by function
 feedmail-tidy-up-slug and indirectly by feedmail-queue-subject-slug-maker."
 
 (defcustom feedmail-queue-default-file-slug t
   "*Indicates what to use for subject-less messages when forming a file name.
-When feedmail queues a message, it creates a unique file name.  By default, 
+When feedmail queues a message, it creates a unique file name.  By default,
 the file name is based in part on the subject of the message being queued.
 If there is no subject, consult this variable.  See documentation for the
 function feedmail-queue-subject-slug-maker.
 Normally, feedmail will notice such files when you send a message in
 immediate mode \(i.e., not when you're running the queue\) and will ask if
 you want to delete them.  Since the answer is usually yes, setting this
-variable to non-nil will tell feedmail to skip the prompt and just delete 
+variable to non-nil will tell feedmail to skip the prompt and just delete
 the file without bothering you."
   :group 'feedmail-queue
   :type 'boolean
   "If non-nil, has the value normally expected of 'buffer-file-name'.
 You are not intended to set this to something in your configuration.  Rather,
 you might programmatically set it to something via a hook or function
-advice or whatever.  You might like to do this if you are using a mail 
+advice or whatever.  You might like to do this if you are using a mail
 composition program that eventually uses sendmail.el's 'mail-send'
 function to process the message.  If there is a filename associated
 with the message buffer, 'mail-send' will ask you for confirmation.
-There's no trivial way to avoid it.  It's unwise to just set the value 
+There's no trivial way to avoid it.  It's unwise to just set the value
 of 'buffer-file-name' to nil because that will defeat feedmail's file
 management features.  Instead, arrange for this variable to be set to
-the value of 'buffer-file-name' before setting that to nil.  An easy way 
+the value of 'buffer-file-name' before setting that to nil.  An easy way
 to do that would be with defadvice on 'mail-send' \(undoing the
 assignments in a later advice\).
 
 feedmail will pretend that 'buffer-file-name', if nil, has the value
-assigned of 'feedmail-queue-buffer-file-name' and carry out its normal 
+assigned of 'feedmail-queue-buffer-file-name' and carry out its normal
 activities.  feedmail does not restore the non-nil value of
-'buffer-file-name'.  For safe bookkeeping, the user should insure that 
+'buffer-file-name'.  For safe bookkeeping, the user should insure that
 feedmail-queue-buffer-file-name is restored to nil.
 
 Example 'defadvice' for mail-send:
    \(defadvice mail-send \(before feedmail-mail-send-before-advice activate\)
      \(setq feedmail-queue-buffer-file-name buffer-file-name\)
      \(setq buffer-file-name nil\)\)
-   
+
    \(defadvice mail-send \(after feedmail-mail-send-after-advice activate\)
      \(if feedmail-queue-buffer-file-name
-         \(setq buffer-file-name feedmail-queue-buffer-file-name\)\)
+	 \(setq buffer-file-name feedmail-queue-buffer-file-name\)\)
      \(setq feedmail-queue-buffer-file-name nil\)\)
 ")
 
 Called for each message read back out of the queue directory with a
 single argument, the optional argument used in the call to
 feedmail-run-the-queue or feedmail-run-the-queue-no-prompts.
-Interactively, that argument will be the prefix argument.  
+Interactively, that argument will be the prefix argument.
 Most people want mail-send \(bound to C-c C-s in mail-mode\), but here's
 your chance to have something different.  The default value is just a
 wrapper function which discards the optional argument and calls
 
 
 (defconst feedmail-binmail-linuxish-template
-  (concat 
+  (concat
    "(echo From "
    (if (fboundp #'user-login-name) (user-login-name) "feedmail")
    " ; cat -) | /usr/bin/rmail %s")
   'create       Insert this one only if no like field exists.
 
   'combine      Combine aggregate values of like fields with this one.
-                In this case, VALUE has a special form.  It is a list
-                of three items: VAL-PRE, VAL-LIKE, and VAL-POST.
-                VAL-PRE and VAL-POST are strings or nil.  VAL-LIKE may
-                be either a string or a function \(it may also be nil,
-                but there's not much point to that\).
-
-                Values of like header fields are aggregated, leading and
-                trailing whitespace is removed, and embedded
-                whitespace is left as-is.  If there are no like
-                fields, or the aggregate value is an empty string,
-                VAL-LIKE is not used.  Else, if VAL-LIKE is a function,
-                it is called with two arguments: NAME and the
-                aggregate like values.  Else, if VAL-LIKE is a string, it is 
-                used as a format string where a single \%s will be
-                replaced by the aggregate values of like fields.
-
-                VAL-PRE, the results of using VAL-LIKE, and VAL-POST
-                are concatenated, and the result, if not nil and not
-                an empty string, is used as the new value for the
-                field.  Although this description sounds a bit
-                complicated, the idea is to provide a mechanism for
-                combining the old value with a new value in a flexible
-                way.  For example, if you wanted to add a new value to
-                an existing header field by adding a semi-colon and
-                then starting the new value on a continuation line,
-                you might specify this:
-
-                 \(nil \"%s;\\n\\t\" \"This is my new value\"\)
+		In this case, VALUE has a special form.  It is a list
+		of three items: VAL-PRE, VAL-LIKE, and VAL-POST.
+		VAL-PRE and VAL-POST are strings or nil.  VAL-LIKE may
+		be either a string or a function \(it may also be nil,
+		but there's not much point to that\).
+
+		Values of like header fields are aggregated, leading and
+		trailing whitespace is removed, and embedded
+		whitespace is left as-is.  If there are no like
+		fields, or the aggregate value is an empty string,
+		VAL-LIKE is not used.  Else, if VAL-LIKE is a function,
+		it is called with two arguments: NAME and the
+		aggregate like values.  Else, if VAL-LIKE is a string, it is
+		used as a format string where a single \%s will be
+		replaced by the aggregate values of like fields.
+
+		VAL-PRE, the results of using VAL-LIKE, and VAL-POST
+		are concatenated, and the result, if not nil and not
+		an empty string, is used as the new value for the
+		field.  Although this description sounds a bit
+		complicated, the idea is to provide a mechanism for
+		combining the old value with a new value in a flexible
+		way.  For example, if you wanted to add a new value to
+		an existing header field by adding a semi-colon and
+		then starting the new value on a continuation line,
+		you might specify this:
+
+		 \(nil \"%s;\\n\\t\" \"This is my new value\"\)
 
 FOLDING can be nil, in which case VALUE is used as-is.  If FOLDING is
 non-nil, feedmail \"smart filling\" is done on VALUE just before
 (defun feedmail-vm-mail-mode (&optional arg)
   "Make something like a buffer that has been created via vm-mail.
 The optional argument is ignored and is just for argument compatibility with
-feedmail-queue-runner-mode-setter.  This function is suitable for being 
+feedmail-queue-runner-mode-setter.  This function is suitable for being
 applied to a file after you've just read it from disk: for example, a
 feedmail FQM message file from a queue.  You could use something like
 this:
 ;;;###autoload
 (defun feedmail-run-the-queue-global-prompt (&optional arg)
   "Like feedmail-run-the-queue, but with a global confirmation prompt.
-This is generally most useful if run non-interactively, since you can 
+This is generally most useful if run non-interactively, since you can
 bail out with an appropriate answer to the global confirmation prompt."
   (interactive "p")
   (feedmail-say-debug ">in-> feedmail-run-the-queue-global-prompts")
 	 #'(lambda (blobby)
 	     (setq maybe-file (expand-file-name blobby feedmail-queue-directory))
 	     (cond
-	      ((file-directory-p maybe-file) nil) ; don't care about subdirs	
+	      ((file-directory-p maybe-file) nil) ; don't care about subdirs
 	      ((feedmail-fqm-p blobby)
 	       (setq blobby-buffer (generate-new-buffer (concat "FQM " blobby)))
 	       (setq already-buffer
 				    blobby))
 			   (save-buffer))
 		       )))
-			
+
 	       (set-buffer blobby-buffer)
 	       (setq buffer-offer-save nil)
 	       (buffer-disable-undo blobby-buffer)
 		     (replace-match "\n" nil t)))
 ;;			   ;; work around text-vs-binary wierdness
 ;;			   ;; if we don't find the normal M-H-S, try reading the file a different way
-;; 			   (if (not (feedmail-find-eoh t))
+;;			   (if (not (feedmail-find-eoh t))
 ;;				   (let ((file-name-buffer-file-type-alist nil) (default-buffer-file-type nil))
 ;;					 (erase-buffer)
 ;;					 (insert-file-contents maybe-file)))
 	       )))
 	 list-of-possible-fqms)))
     (if feedmail-queue-chatty
-	(progn 
+	(progn
 	  (feedmail-say-chatter "%d sent, %d skipped (%d other files ignored)"
 				messages-sent messages-skipped q-oth)
 	  (feedmail-queue-reminder 'after-run)
 	(if (pos-visible-in-window-p (point-min) fqm-window)
 	    (scroll-up 999999)
 	  (scroll-down))))))
-		
+
 
 (defun feedmail-look-at-queue-directory (queue-directory)
   "Find out some things about a queue directory.
   ;; for tidyness, peel off trailing hyphens
   (if (string-match "-*$" slug) (setq slug (replace-match "" nil nil slug)))
   slug
-  )  
+  )
 
 (defun feedmail-queue-subject-slug-maker (&optional queue-directory)
   "Create a name for storing the message in the queue.
 	  (while (and (re-search-forward "\n\n\n*" eoh-marker t)
 		      (< (point) eoh-marker))
 	    (replace-match "\n"))
-	
+
 	  (let ((case-fold-search t) (addr-regexp))
 	    (goto-char (point-min))
 	    ;; there are some RFC-822 combinations/cases missed here,
 					   also-file)))
 			      (save-excursion
 				;; if we delete the affiliated file, get rid
-				;; of the file name association and make sure we 
+				;; of the file name association and make sure we
 				;; don't annoy people with a prompt on exit
 				(delete-file also-file)
 				(set-buffer feedmail-raw-text-buffer)
 				  (progn (if bcc-holder (insert bcc-holder))
 					 (if resent-bcc-holder
 					     (insert resent-bcc-holder))))
-							  
+
 			      (run-hooks 'feedmail-before-fcc-hook)
 
 			      (if feedmail-nuke-body-in-fcc
 	 #'(lambda (feedmail-spray-this-address)
 	     (let ((spray-buffer
 		    (get-buffer-create " *FQM Outgoing Email Spray*")))
-	       (save-excursion 
+	       (save-excursion
 		 (set-buffer spray-buffer)
 		 (erase-buffer)
 		 ;; not life's most efficient methodology, but spraying isn't
    ;; improvement using user-mail-address suggested by
    ;;   gray@austin.apc.slb.com (Douglas Gray Stephens)
    ((eq t feedmail-from-line)
-    (let ((feedmail-from-line 
+    (let ((feedmail-from-line
 	   (let ((at-stuff
 		  (if user-mail-address
 		      user-mail-address
 feedmail-message-id-suffix is defined, uses user-mail-address, so be
 sure it's set.  If both are nil, creates a quasi-random suffix that is
 probably not appropriate for you."
-  (feedmail-say-debug 
+  (feedmail-say-debug
    ">in-> feedmail-default-message-id-generator %s" maybe-file)
   (let ((date-time)
 	(end-stuff (if feedmail-message-id-suffix
   (feedmail-say-debug ">in-> feedmail-fill-to-cc-function")
   (let ((case-fold-search t)
 	(headers (mapconcat #'regexp-quote
-			    '("FROM:" "REPLY-TO:" "TO:" "CC:" "BCC"
+			    '("FROM:" "REPLY-TO:" "TO:" "CC:" "BCC:"
 			      "RESENT-TO:" "RESENT-CC:" "RESENT-BCC:")
 			    "\\|"))
 	this-line
     (goto-char this-line)
     (while (re-search-forward "\\s-+" (1- this-line-end) t)
       (replace-match " "))
-	
+
     (subst-char-in-region this-line this-line-end ?   2 t) ; blank->C-b
     (subst-char-in-region this-line this-line-end ?, ?  t) ; comma->blank
-	
+
     (fill-region-as-paragraph this-line this-line-end)
-	
+
     (subst-char-in-region this-line this-line-end ?  ?, t) ; comma<-blank
     (subst-char-in-region this-line this-line-end  2 ?  t) ; blank<-C-b
-	
+
     ;; look out for missing commas before continuation lines
     (goto-char this-line)
     (while (re-search-forward "\\([^,]\\)\n\t[ ]*" this-line-end t)