comparison lisp/mail/feedmail.el @ 105829:328150f0cf76

* url-util.el (url-insert-entities-in-string): * url-nfs.el (url-nfs-unescape): * url-ldap.el (url-ldap): * url-imap.el (url-imap): * url-cid.el (url-cid-gnus, url-cid): Use with-current-buffer. * erc.el (erc-display-line-1, erc-process-away): * erc-truncate.el (erc-truncate-buffer-to-size): Use with-current-buffer. * term/ns-win.el (ns-scroll-bar-move, ns-face-at-pos): * play/mpuz.el (mpuz-create-buffer): * play/landmark.el (lm-prompt-for-move, lm-print-wts, lm-print-smell) (lm-print-y,s,noise, lm-print-w0, lm-init): * play/gomoku.el (gomoku-prompt-for-move): * play/fortune.el (fortune-in-buffer): * play/dissociate.el (dissociated-press): * play/decipher.el (decipher-adjacency-list, decipher-display-regexp) (decipher-analyze-buffer, decipher-stats-buffer,decipher-stats-buffer): * mail/supercite.el (sc-eref-show): * mail/smtpmail.el (smtpmail-send-it): * mail/rmailsum.el (rmail-summary-next-labeled-message) (rmail-summary-previous-labeled-message, rmail-summary-wipe) (rmail-summary-undelete-many, rmail-summary-rmail-update) (rmail-summary-goto-msg, rmail-summary-expunge) (rmail-summary-get-new-mail, rmail-summary-search-backward) (rmail-summary-add-label, rmail-summary-output-menu) (rmail-summary-output-body): * mail/rfc822.el (rfc822-addresses): * mail/reporter.el (reporter-dump-variable, reporter-dump-state): * mail/mailpost.el (post-mail-send-it): * mail/hashcash.el (hashcash-generate-payment): * mail/feedmail.el (feedmail-run-the-queue) (feedmail-queue-send-edit-prompt-help-first) (feedmail-send-it-immediately, feedmail-give-it-to-buffer-eater) (feedmail-deduce-address-list): * eshell/esh-ext.el (eshell-remote-command): * eshell/em-unix.el (eshell-occur-mode-mouse-goto): * emulation/viper-util.el (viper-glob-unix-files, viper-save-setting) (viper-wildcard-to-regexp, viper-glob-mswindows-files) (viper-save-string-in-file, viper-valid-marker): * emulation/viper-keym.el (viper-toggle-key): * emulation/viper-ex.el (ex-expand-filsyms, viper-get-ex-file) (ex-edit, ex-global, ex-mark, ex-next-related-buffer, ex-quit) (ex-get-inline-cmd-args, ex-tag, ex-command, ex-compile): * emulation/viper-cmd.el (viper-exec-form-in-vi) (viper-exec-form-in-emacs, viper-brac-function): * emulation/viper.el (viper-delocalize-var): * emulation/vip.el (vip-mode, vip-get-ex-token, vip-ex, vip-get-ex-pat) (vip-get-ex-command, vip-get-ex-opt-gc, vip-get-ex-buffer) (vip-get-ex-count, vip-get-ex-file, ex-edit, ex-global, ex-mark) (ex-map, ex-unmap, ex-quit, ex-read, ex-tag, ex-command): * emulation/vi.el (vi-switch-mode, vi-ex-cmd): * emulation/edt.el (edt-electric-helpify): * emulation/cua-rect.el (cua--rectangle-aux-replace): * emulation/cua-gmrk.el (cua--insert-at-global-mark) (cua--delete-at-global-mark, cua--copy-rectangle-to-global-mark) (cua-indent-to-global-mark-column): * calendar/diary-lib.el (calendar-mark-1): * calendar/cal-hebrew.el (calendar-hebrew-mark-date-pattern): Use with-current-buffer. * emulation/viper.el (viper-delocalize-var): Use dolist.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 03 Nov 2009 02:04:29 +0000
parents 21469025a673
children c22556bde650
comparison
equal deleted inserted replaced
105828:3d8945f5688d 105829:328150f0cf76
1626 (setq messages-sent (1+ messages-sent)) 1626 (setq messages-sent (1+ messages-sent))
1627 (funcall feedmail-queue-runner-cleaner-upper maybe-file arg) 1627 (funcall feedmail-queue-runner-cleaner-upper maybe-file arg)
1628 (if (and already-buffer (not (file-exists-p maybe-file))) 1628 (if (and already-buffer (not (file-exists-p maybe-file)))
1629 ;; we have gotten rid of the file associated with the 1629 ;; we have gotten rid of the file associated with the
1630 ;; buffer, so update the buffer's notion of that 1630 ;; buffer, so update the buffer's notion of that
1631 (save-excursion 1631 (with-current-buffer already-buffer
1632 (set-buffer already-buffer)
1633 (setq buffer-file-name nil))))) 1632 (setq buffer-file-name nil)))))
1634 (error (setq messages-skipped (1+ messages-skipped)))) 1633 (error (setq messages-skipped (1+ messages-skipped))))
1635 (kill-buffer blobby-buffer) 1634 (kill-buffer blobby-buffer)
1636 (if feedmail-queue-chatty 1635 (if feedmail-queue-chatty
1637 (progn 1636 (progn
1799 (princ "\". For other possibilities, 1798 (princ "\". For other possibilities,
1800 see the variable feedmail-prompt-before-queue-user-alist. 1799 see the variable feedmail-prompt-before-queue-user-alist.
1801 ") 1800 ")
1802 (and (stringp feedmail-prompt-before-queue-help-supplement) 1801 (and (stringp feedmail-prompt-before-queue-help-supplement)
1803 (princ feedmail-prompt-before-queue-help-supplement)) 1802 (princ feedmail-prompt-before-queue-help-supplement))
1804 (save-excursion (set-buffer standard-output) (if (fboundp 'help-mode) (help-mode))))) 1803 (with-current-buffer standard-output
1804 (if (fboundp 'help-mode) (help-mode)))))
1805 1805
1806 (defun feedmail-look-at-queue-directory (queue-directory) 1806 (defun feedmail-look-at-queue-directory (queue-directory)
1807 "Find out some things about a queue directory. 1807 "Find out some things about a queue directory.
1808 Result is a list containing a count of queued messages in the 1808 Result is a list containing a count of queued messages in the
1809 directory, a count of other files in the directory, and a high water 1809 directory, a count of other files in the directory, and a high water
1968 (a-re-db "^Bcc:") 1968 (a-re-db "^Bcc:")
1969 ;; to get a temporary changable copy 1969 ;; to get a temporary changable copy
1970 (mail-header-separator mail-header-separator) 1970 (mail-header-separator mail-header-separator)
1971 ) 1971 )
1972 (unwind-protect 1972 (unwind-protect
1973 (save-excursion 1973 (save-current-buffer
1974 (set-buffer feedmail-error-buffer) (erase-buffer) 1974 (set-buffer feedmail-error-buffer) (erase-buffer)
1975 (set-buffer feedmail-prepped-text-buffer) (erase-buffer) 1975 (set-buffer feedmail-prepped-text-buffer) (erase-buffer)
1976 1976
1977 ;; jam contents of user-supplied mail buffer into our scratch buffer 1977 ;; jam contents of user-supplied mail buffer into our scratch buffer
1978 (insert-buffer-substring feedmail-raw-text-buffer) 1978 (insert-buffer-substring feedmail-raw-text-buffer)
2073 (let ((user-mail-address (feedmail-envelope-deducer eoh-marker))) 2073 (let ((user-mail-address (feedmail-envelope-deducer eoh-marker)))
2074 (feedmail-give-it-to-buffer-eater) 2074 (feedmail-give-it-to-buffer-eater)
2075 (if (and (not feedmail-queue-runner-is-active) (setq also-file (buffer-file-name feedmail-raw-text-buffer))) 2075 (if (and (not feedmail-queue-runner-is-active) (setq also-file (buffer-file-name feedmail-raw-text-buffer)))
2076 (progn ; if a file but not running the queue, offer to delete it 2076 (progn ; if a file but not running the queue, offer to delete it
2077 (setq also-file (expand-file-name also-file)) 2077 (setq also-file (expand-file-name also-file))
2078 (if (or feedmail-queue-auto-file-nuke 2078 (when (or feedmail-queue-auto-file-nuke
2079 (y-or-n-p (format "FQM: Delete message file %s? " also-file))) 2079 (y-or-n-p
2080 (save-excursion 2080 (format "FQM: Delete message file %s? "
2081 ;; if we delete the affiliated file, get rid 2081 also-file)))
2082 ;; of the file name association and make sure we 2082 ;; if we delete the affiliated file, get rid
2083 ;; don't annoy people with a prompt on exit 2083 ;; of the file name association and make sure we
2084 (delete-file also-file) 2084 ;; don't annoy people with a prompt on exit
2085 (set-buffer feedmail-raw-text-buffer) 2085 (delete-file also-file)
2086 (setq buffer-offer-save nil) 2086 (with-current-buffer feedmail-raw-text-buffer
2087 (setq buffer-file-name nil) 2087 (setq buffer-offer-save nil)
2088 ) 2088 (setq buffer-file-name nil)))))
2089 )))
2090 (goto-char (point-min)) 2089 (goto-char (point-min))
2091 ;; re-insert and handle any Fcc fields (and, optionally, any Bcc). 2090 ;; re-insert and handle any Fcc fields (and, optionally, any Bcc).
2092 (if fcc (letf (((default-value 'buffer-file-type) 2091 (if fcc (letf (((default-value 'buffer-file-type)
2093 feedmail-force-binary-write)) 2092 feedmail-force-binary-write))
2094 (insert fcc) 2093 (insert fcc)
2195 (save-excursion 2194 (save-excursion
2196 (if feedmail-enable-spray 2195 (if feedmail-enable-spray
2197 (mapcar 2196 (mapcar
2198 '(lambda (feedmail-spray-this-address) 2197 '(lambda (feedmail-spray-this-address)
2199 (let ((spray-buffer (get-buffer-create " *FQM Outgoing Email Spray*"))) 2198 (let ((spray-buffer (get-buffer-create " *FQM Outgoing Email Spray*")))
2200 (save-excursion 2199 (with-current-buffer spray-buffer
2201 (set-buffer spray-buffer)
2202 (erase-buffer) 2200 (erase-buffer)
2203 ;; not life's most efficient methodology, but spraying isn't 2201 ;; not life's most efficient methodology, but spraying isn't
2204 ;; an every-5-minutes event either 2202 ;; an every-5-minutes event either
2205 (insert-buffer-substring feedmail-prepped-text-buffer) 2203 (insert-buffer-substring feedmail-prepped-text-buffer)
2206 ;; There's a good case to me made that each separate transmission of 2204 ;; There's a good case to me made that each separate
2207 ;; a message in the spray should have a distinct Message-Id:. There 2205 ;; transmission of a message in the spray should
2208 ;; is also a less compelling argument in the other direction. I think 2206 ;; have a distinct Message-Id:. There is also a less
2209 ;; they technically should have distinct Message-Id:s, but I doubt that 2207 ;; compelling argument in the other direction.
2210 ;; anyone cares, practically. If someone complains about it, I'll add 2208 ;; I think they technically should have distinct
2211 ;; it. 2209 ;; Message-Id:s, but I doubt that anyone cares,
2210 ;; practically. If someone complains about it, I'll
2211 ;; add it.
2212 (feedmail-fiddle-list-of-spray-fiddle-plexes feedmail-spray-address-fiddle-plex-list) 2212 (feedmail-fiddle-list-of-spray-fiddle-plexes feedmail-spray-address-fiddle-plex-list)
2213 ;; this (let ) is just in case some buffer eater 2213 ;; this (let ) is just in case some buffer eater
2214 ;; is cheating and using the global variable name instead 2214 ;; is cheating and using the global variable name instead
2215 ;; of its argument to find the buffer 2215 ;; of its argument to find the buffer
2216 (let ((feedmail-prepped-text-buffer spray-buffer)) 2216 (let ((feedmail-prepped-text-buffer spray-buffer))
2591 (let ((simple-address) 2591 (let ((simple-address)
2592 (address-blob) 2592 (address-blob)
2593 (this-line) 2593 (this-line)
2594 (this-line-end)) 2594 (this-line-end))
2595 (unwind-protect 2595 (unwind-protect
2596 (save-excursion 2596 (with-current-buffer (get-buffer-create " *FQM scratch*")
2597 (set-buffer (get-buffer-create " *FQM scratch*")) (erase-buffer) 2597 (erase-buffer)
2598 (insert-buffer-substring message-buffer header-start header-end) 2598 (insert-buffer-substring message-buffer header-start header-end)
2599 (goto-char (point-min)) 2599 (goto-char (point-min))
2600 (let ((case-fold-search t)) 2600 (let ((case-fold-search t))
2601 (while (re-search-forward addr-regexp (point-max) t) 2601 (while (re-search-forward addr-regexp (point-max) t)
2602 (replace-match "") 2602 (replace-match "")