Commit 705e5bd9 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* mail/feedmail.el: Use CL macros.

(feedmail-run-the-queue, feedmail-send-it-immediately):
* dos-w32.el (find-buffer-file-type): Replace uses of
default-buffer-file-type with (default-value 'buffer-file-type).
parent 4d985ac2
2009-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
* mail/feedmail.el: Use CL macros.
(feedmail-run-the-queue, feedmail-send-it-immediately):
* dos-w32.el (find-buffer-file-type): Replace uses of
default-buffer-file-type with (default-value 'buffer-file-type).
2009-08-28 Glenn Morris <rgm@gnu.org> 2009-08-28 Glenn Morris <rgm@gnu.org>
* calendar/diary-lib.el (diary-list-entries, diary-goto-entry) * calendar/diary-lib.el (diary-list-entries, diary-goto-entry)
......
...@@ -72,15 +72,12 @@ against the file name, and TYPE is nil for text, t for binary.") ...@@ -72,15 +72,12 @@ against the file name, and TYPE is nil for text, t for binary.")
(setq alist (cdr alist))) (setq alist (cdr alist)))
found))) found)))
;; Silence compiler. Defined in src/buffer.c on DOS_NT.
(defvar default-buffer-file-type)
;; Don't check for untranslated file systems here. ;; Don't check for untranslated file systems here.
(defun find-buffer-file-type (filename) (defun find-buffer-file-type (filename)
(let ((match (find-buffer-file-type-match filename)) (let ((match (find-buffer-file-type-match filename))
(code)) (code))
(if (not match) (if (not match)
default-buffer-file-type (default-value 'buffer-file-type)
(setq code (cdr match)) (setq code (cdr match))
(cond ((memq code '(nil t)) code) (cond ((memq code '(nil t)) code)
((and (symbolp code) (fboundp code)) ((and (symbolp code) (fboundp code))
......
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
(defconst feedmail-patch-level "8") (defconst feedmail-patch-level "8")
(eval-when-compile (require 'smtpmail)) (eval-when-compile (require 'smtpmail) (require 'cl))
(autoload 'mail-do-fcc "sendmail") (autoload 'mail-do-fcc "sendmail")
(defgroup feedmail nil (defgroup feedmail nil
...@@ -481,11 +481,10 @@ header is fiddled after the From: header is fiddled." ...@@ -481,11 +481,10 @@ header is fiddled after the From: header is fiddled."
(defcustom feedmail-force-binary-write t (defcustom feedmail-force-binary-write t
"*If non-nil, force writing file as binary (this applies to queues and Fcc:). "*If non-nil, force writing file as binary (this applies to queues and Fcc:).
On systems where there is a difference between binary and text files, On systems where there is a difference between binary and text files,
feedmail will temporarily manipulate the values of `buffer-file-type' feedmail will temporarily manipulate the value of `buffer-file-type'
and/or `default-buffer-file-type' to make the writing as binary. If to make the writing as binary. If nil, writing will be in text mode.
nil, writing will be in text mode. On systems where there is no On systems where there is no distinction or where it is controlled by other
distinction or where it is controlled by other variables or other variables or other means, this option has no effect."
means, this option has no effect."
:group 'feedmail-misc :group 'feedmail-misc
:type 'boolean :type 'boolean
) )
...@@ -1601,9 +1600,9 @@ backup file names and the like)." ...@@ -1601,9 +1600,9 @@ backup file names and the like)."
(not (not
(let ((mail-header-separator feedmail-queue-alternative-mail-header-separator)) (let ((mail-header-separator feedmail-queue-alternative-mail-header-separator))
(feedmail-find-eoh t))))) (feedmail-find-eoh t)))))
(let ((file-name-buffer-file-type-alist nil) (default-buffer-file-type nil)) (letf ((file-name-buffer-file-type-alist nil)
(erase-buffer) (insert-file-contents maybe-file)) ((default-value 'buffer-file-type) nil))
) (erase-buffer) (insert-file-contents maybe-file)))
;; if M-H-S not found and (a-M-H-S is non-nil and is found) ;; if M-H-S not found and (a-M-H-S is non-nil and is found)
;; temporarily set M-H-S to the value of a-M-H-S ;; temporarily set M-H-S to the value of a-M-H-S
(if (and (not (feedmail-find-eoh t)) (if (and (not (feedmail-find-eoh t))
...@@ -1913,7 +1912,8 @@ mapped to mostly alphanumerics for safety." ...@@ -1913,7 +1912,8 @@ mapped to mostly alphanumerics for safety."
(setq filename buffer-file-name) (setq filename buffer-file-name)
(setq filename (feedmail-create-queue-filename queue-directory))) (setq filename (feedmail-create-queue-filename queue-directory)))
;; make binary file on DOS/Win95/WinNT, etc ;; make binary file on DOS/Win95/WinNT, etc
(let ((buffer-file-type feedmail-force-binary-write)) (write-file filename)) (let ((buffer-file-type feedmail-force-binary-write))
(write-file filename))
;; convenient for moving from draft to q, for example ;; convenient for moving from draft to q, for example
(if (and previous-buffer-file-name (or (not is-fqm) (not is-in-this-dir)) (if (and previous-buffer-file-name (or (not is-fqm) (not is-in-this-dir))
(y-or-n-p (format "FQM: Was previously %s; delete that? " previous-buffer-file-name))) (y-or-n-p (format "FQM: Was previously %s; delete that? " previous-buffer-file-name)))
...@@ -2086,7 +2086,8 @@ mapped to mostly alphanumerics for safety." ...@@ -2086,7 +2086,8 @@ mapped to mostly alphanumerics for safety."
))) )))
(goto-char (point-min)) (goto-char (point-min))
;; re-insert and handle any Fcc fields (and, optionally, any Bcc). ;; re-insert and handle any Fcc fields (and, optionally, any Bcc).
(if fcc (let ((default-buffer-file-type feedmail-force-binary-write)) (if fcc (letf (((default-value 'buffer-file-type)
feedmail-force-binary-write))
(insert fcc) (insert fcc)
(if (not feedmail-nuke-bcc-in-fcc) (if (not feedmail-nuke-bcc-in-fcc)
(progn (if bcc-holder (insert bcc-holder)) (progn (if bcc-holder (insert bcc-holder))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment