;;; Code:
(require 'custom)
+(require 'mel) ; binary-funcall
(defgroup qmtp nil
"QMTP protocol for sending mail."
:type 'integer
:group 'qmtp)
-(autoload 'binary-open-network-stream "raw-io")
;;;###autoload
-(defvar qmtp-open-connection-function (function binary-open-network-stream))
+(defvar qmtp-open-connection-function (function open-network-stream))
(defvar qmtp-error-response-alist
'((?Z "Temporary failure")
(unwind-protect
(progn
(setq process
- (funcall qmtp-open-connection-function
- "QMTP" (current-buffer) qmtp-server qmtp-service))
+ (binary-funcall qmtp-open-connection-function
+ "QMTP" (current-buffer)
+ qmtp-server qmtp-service))
(qmtp-send-package process sender recipients buffer))
(when (and process
(memq (process-status process) '(open run)))
;;; smtp.el --- basic functions to send mail with SMTP server
-;; Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
;; Simon Leinen <simon@switch.ch> (ESMTP support)
(require 'mail-utils) ; mail-strip-quoted-names
(require 'sasl)
(require 'luna)
+(require 'mel) ; binary-funcall
(defgroup smtp nil
"SMTP protocol for sending mail."
(defvar sasl-mechanisms)
-(autoload 'binary-open-network-stream "raw-io")
;;;###autoload
-(defvar smtp-open-connection-function #'binary-open-network-stream)
+(defvar smtp-open-connection-function #'open-network-stream)
(defvar smtp-read-point nil)
BUFFER is the buffer to associate with the connection. SERVER is name
of the host to connect to. SERVICE is name of the service desired."
(let ((process
- (funcall smtp-open-connection-function
- "SMTP" buffer server service))
+ (binary-funcall smtp-open-connection-function
+ "SMTP" buffer server service))
connection)
(when process
(setq connection (smtp-make-connection process server service))
(require 'smtp)
(require 'sendmail)
(require 'time-stamp)
-(require 'raw-io)
+(require 'mel) ; binary-write-decoded-region, binary-find-file-noselect
(eval-when-compile (require 'static))
(insert-buffer tembuf)
(or (file-directory-p smtpmail-queue-dir)
(make-directory smtpmail-queue-dir t))
- (binary-write-region (point-min) (point-max) file-data)
+ (binary-write-decoded-region (point-min) (point-max) file-data)
(set-buffer buffer-elisp)
(erase-buffer)
(insert (concat
;;; @ version
;;;
-(defconst emh-version "1.14.0")
+(defconst emh-version "1.14.1")
;;; @ variable
(progn
(set-buffer abuf)
(setq buffer-read-only nil)
- (erase-buffer)
- )
+ (erase-buffer))
(setq abuf (get-buffer-create aname))
(set-buffer abuf)
- (set-buffer-multibyte nil)
- )
- (raw-text-insert-file-contents msg-filename)
+ (set-buffer-multibyte nil))
+ (8bit-insert-encoded-file msg-filename)
(set-buffer-modified-p nil)
(setq buffer-read-only t)
(setq buffer-file-name msg-filename)
(mh-show-mode)
(mime-display-message (mime-open-entity 'buffer aname)
(concat "show-" folder))
- (goto-char (point-min))
- )
+ (goto-char (point-min)))
(let ((clean-message-header mh-clean-message-header)
(invisible-headers mh-invisible-headers)
(visible-headers mh-visible-headers))
;;; mail-mime-setup.el --- setup file for mail-mode.
-;; Copyright (C) 1994,1995,1996,1997,1998 Free Software Foundation, Inc.
+;; Copyright (C) 1994,1995,1996,1997,1998,2000 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Keywords: mail-mode, MIME, multimedia, multilingual, encoded-word
(autoload 'turn-on-mime-edit "mime-edit"
"Unconditionally turn on MIME-Edit minor mode." t)
-(autoload 'eword-decode-header "eword-decode"
- "Decode MIME encoded-words in header fields." t)
+;; (autoload 'eword-decode-header "eword-decode"
+;; "Decode MIME encoded-words in header fields." t)
;;; @ for mail-mode, RMAIL and VM
;;;
-(add-hook 'mail-setup-hook 'eword-decode-header)
+;; (add-hook 'mail-setup-hook 'eword-decode-header)
(add-hook 'mail-setup-hook 'turn-on-mime-edit 'append)
(add-hook 'mail-send-hook 'mime-edit-maybe-translate)
(set-alist 'mime-edit-split-message-sender-alist
;;; mel.el --- A MIME encoding/decoding library.
-;; Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <tomo@m17n.org>
;; Created: 1995/6/25
;;; Code:
(require 'mime-def)
-(require 'raw-io)
(require 'alist)
(defcustom mime-encoding-list
;;; @ setting for modules
;;;
-(mel-define-backend "7bit")
-(mel-define-method-function (mime-encode-string string (nil "7bit"))
+(defun 8bit-insert-encoded-file (filename)
+ "Insert file FILENAME encoded by \"7bit\" format."
+ (let ((coding-system-for-read 'raw-text)
+ format-alist)
+ ;; Returns list of absolute file name and length of data inserted.
+ (insert-file-contents filename)))
+
+(defun 8bit-write-decoded-region (start end filename)
+ "Decode and write current region encoded by \"8bit\" into FILENAME."
+ (let ((coding-system-for-write 'raw-text)
+ format-alist)
+ (write-region start end filename)))
+
+(mel-define-backend "8bit")
+(mel-define-method-function (mime-encode-string string (nil "8bit"))
'identity)
-(mel-define-method-function (mime-decode-string string (nil "7bit"))
+(mel-define-method-function (mime-decode-string string (nil "8bit"))
'identity)
-(mel-define-method mime-encode-region (start end (nil "7bit")))
-(mel-define-method mime-decode-region (start end (nil "7bit")))
-(mel-define-method-function (mime-insert-encoded-file filename (nil "7bit"))
- 'binary-insert-file-contents)
+(mel-define-method mime-encode-region (start end (nil "8bit")))
+(mel-define-method mime-decode-region (start end (nil "8bit")))
+(mel-define-method-function (mime-insert-encoded-file filename (nil "8bit"))
+ '8bit-insert-encoded-file)
(mel-define-method-function (mime-write-decoded-region
- start end filename (nil "7bit"))
- 'binary-write-region)
+ start end filename (nil "8bit"))
+ '8bit-write-decoded-region)
-(mel-define-backend "8bit" ("7bit"))
-(mel-define-backend "binary" ("8bit"))
+(defalias '7bit-insert-encoded-file '8bit-insert-encoded-file)
+(defalias '7bit-write-decoded-region '8bit-write-decoded-region)
+
+(mel-define-backend "7bit" ("8bit"))
+
+
+(defun binary-write-decoded-region (start end filename)
+ "Decode and write current region encoded by \"binary\" into FILENAME."
+ (let ((coding-system-for-write 'binary)
+ jka-compr-compression-info-list jam-zcat-filename-list)
+ (write-region start end filename)))
+
+(defalias 'binary-insert-encoded-file 'insert-file-contents-literally)
+
+(defun binary-find-file-noselect (filename &optional nowarn rawfile)
+ "Like `find-file-noselect', q.v., but don't code and format conversion."
+ (let ((coding-system-for-read 'binary)
+ format-alist)
+ (find-file-noselect filename nowarn rawfile)))
+
+(defun binary-funcall (name &rest args)
+ "Like `funcall', q.v., but read and write as binary."
+ (let ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary))
+ (apply name args)))
+
+(defun binary-to-text-funcall (coding-system name &rest args)
+ "Like `funcall', q.v., but write as binary and read as text.
+Read text is decoded as CODING-SYSTEM."
+ (let ((coding-system-for-read coding-system)
+ (coding-system-for-write 'binary))
+ (apply name args)))
+
+(mel-define-backend "binary")
+(mel-define-method-function (mime-encode-string string (nil "binary"))
+ 'identity)
+(mel-define-method-function (mime-decode-string string (nil "binary"))
+ 'identity)
+(mel-define-method mime-encode-region (start end (nil "binary")))
+(mel-define-method mime-decode-region (start end (nil "binary")))
+(mel-define-method-function (mime-insert-encoded-file filename (nil "binary"))
+ 'binary-insert-encoded-file)
+(mel-define-method-function (mime-write-decoded-region
+ start end filename (nil "binary"))
+ 'binary-write-decoded-region)
(defvar mel-b-builtin
(and (fboundp 'base64-encode-string)
(insert (base64-encode-string
(with-temp-buffer
(set-buffer-multibyte nil)
- (binary-insert-file-contents filename)
+ (binary-insert-encoded-file filename)
(buffer-string))))
(or (bolp) (insert ?\n)))
)
(eval-and-compile
- (defconst mime-library-product ["FLIM" (1 14 1) "Yagi"]
+ (defconst mime-library-product ["FLIM" (1 14 2) "Yagi-Nishiguchi"]
"Product name, version number and code name of MIME-library package."))
(defmacro mime-product-name (product)
(save-window-excursion
(set-buffer full-buf)
(erase-buffer)
- (binary-insert-file-contents file)
+ (binary-insert-encoded-file file)
(setq major-mode 'mime-show-message-mode)
(mime-view-buffer (current-buffer) nil mother)
(setq pbuf (current-buffer))
(or (file-exists-p file)
(throw 'tag nil)
)
- (binary-insert-file-contents file)
+ (binary-insert-encoded-file file)
(goto-char (point-max))
- (setq i (1+ i))
- ))
- (binary-write-region (point-min)(point-max)
- (expand-file-name "FULL" root-dir))
+ (setq i (1+ i))))
+ (binary-write-decoded-region
+ (point-min)(point-max)
+ (expand-file-name "FULL" root-dir))
(let ((i 1))
(while (<= i total)
(let ((file (format "%s/%d" root-dir i)))
(and (file-exists-p file)
- (delete-file file)
- ))
- (setq i (1+ i))
- ))
+ (delete-file file)))
+ (setq i (1+ i))))
(let ((file (expand-file-name "CT" root-dir)))
(and (file-exists-p file)
- (delete-file file)
- ))
+ (delete-file file)))
(let ((buf (current-buffer))
(pwin (or (get-buffer-window mother)
(get-largest-window)))
(defun mime-view-define-keymap (&optional default)
(let ((mime-view-mode-map (if (keymapp default)
(copy-keymap default)
- (make-sparse-keymap)
- )))
+ (make-sparse-keymap))))
(define-key mime-view-mode-map
"u" (function mime-preview-move-to-upper))
(define-key mime-view-mode-map
(lambda (item)
(define-key mime-view-mode-map
(vector 'menu-bar 'mime-view (car item))
- (cons (nth 1 item)(nth 2 item))
- )
+ (cons (nth 1 item)(nth 2 item)))
))
- (reverse mime-view-menu-list)
- )
+ (reverse mime-view-menu-list))
))
- (use-local-map mime-view-mode-map)
- (run-hooks 'mime-view-define-keymap-hook)
- ))
+ ;; (run-hooks 'mime-view-define-keymap-hook)
+ mime-view-mode-map))
+
+(defvar mime-view-mode-default-map (mime-view-define-keymap))
+
(defsubst mime-maybe-hide-echo-buffer ()
"Clear mime-echo buffer and delete window for it."
;;;###autoload
(defun mime-display-message (message &optional preview-buffer
mother default-keymap-or-function
- original-major-mode)
+ original-major-mode keymap)
"View MESSAGE in MIME-View mode.
Optional argument PREVIEW-BUFFER specifies the buffer of the
Optional argument DEFAULT-KEYMAP-OR-FUNCTION is nil, keymap or
function. If it is a keymap, keymap of MIME-View mode will be added
to it. If it is a function, it will be bound as default binding of
-keymap of MIME-View mode."
+keymap of MIME-View mode.
+
+Optional argument ORIGINAL-MAJOR-MODE is major-mode of representation
+buffer of MESSAGE. If it is nil, current `major-mode' is used.
+
+Optional argument KEYMAP is keymap of MIME-View mode. If it is
+non-nil, DEFAULT-KEYMAP-OR-FUNCTION is ignored. If it is nil,
+`mime-view-mode-default-map' is used."
(mime-maybe-hide-echo-buffer)
(let ((win-conf (current-window-configuration)))
(or preview-buffer
(widen)
(erase-buffer)
(if mother
- (setq mime-mother-buffer mother)
- )
+ (setq mime-mother-buffer mother))
(setq mime-preview-original-window-configuration win-conf)
(setq major-mode 'mime-view-mode)
(setq mode-name "MIME-View")
(header . visible)
(major-mode . ,original-major-mode))
preview-buffer)
- (mime-view-define-keymap default-keymap-or-function)
+ (use-local-map
+ (or keymap
+ (if default-keymap-or-function
+ (mime-view-define-keymap default-keymap-or-function)
+ mime-view-mode-default-map)))
(let ((point
(next-single-property-change (point-min) 'mime-view-entity)))
(if point
(goto-char point)
(goto-char (point-min))
- (search-forward "\n\n" nil t)
- ))
+ (search-forward "\n\n" nil t)))
(run-hooks 'mime-view-mode-hook)
(set-buffer-modified-p nil)
(setq buffer-read-only t)
filename)
(save-excursion
(set-buffer (mime-buffer-entity-buffer-internal entity))
- (binary-write-region (mime-buffer-entity-body-start-internal entity)
- (mime-buffer-entity-body-end-internal entity)
- filename)))
+ (binary-write-decoded-region
+ (mime-buffer-entity-body-start-internal entity)
+ (mime-buffer-entity-body-end-internal entity)
+ filename)))
;;; @ entity content
(concat " *Body of "
(mime-entity-name entity)
"*"))
- (binary-insert-file-contents
+ (binary-insert-encoded-file
(mime-external-entity-body-file-internal entity))
(current-buffer))))
(error (message "Can't get external-body.")))))
filename)
(mmexternal-require-buffer entity)
(with-current-buffer (mime-external-entity-body-buffer-internal entity)
- (binary-write-region (point-min) (point-max) filename)))
+ (binary-write-decoded-region (point-min) (point-max) filename)))
;;; @ entity content
;;; Code:
+(require 'mel) ; binary-to-text-funcall
(eval-when-compile (require 'pgg))
(defgroup pgg-gpg ()
(progn
(set-default-file-modes 448)
(setq process
- (apply #'binary-start-process "*GnuPG*" errors-buffer
+ (apply #'binary-to-text-funcall
+ pgg-gpg-messages-coding-system
+ #'start-process "*GnuPG*" errors-buffer
program args))
- (if (fboundp 'set-process-coding-system)
- (set-process-coding-system process
- pgg-gpg-messages-coding-system))
(set-process-sentinel process #'ignore)
(when passphrase
(process-send-string process (concat passphrase "\n")))
;;; Code:
+(require 'mel) ; binary-to-text-funcall, binary-write-decoded-region
(eval-when-compile (require 'pgg))
(defgroup pgg-pgp ()
(defvar pgg-pgp-user-id nil
"PGP ID of your default identity.")
+(defvar pgg-pgp-messages-coding-system pgg-messages-coding-system
+ "Coding system used when reading from a PGP external process.")
+
(defvar pgg-scheme-pgp-instance nil)
;;;###autoload
(unwind-protect
(progn
(setq process
- (apply #'binary-start-process-shell-command "*PGP*"
- output-buffer
+ (apply #'binary-to-text-funcall
+ pgg-pgp-messages-coding-system
+ #'start-process-shell-command "*PGP*" output-buffer
program args))
(set-process-sentinel process #'ignore)
(when passphrase
(unwind-protect
(progn
(set-default-file-modes 448)
- (binary-write-region start end orig-file))
+ (binary-write-decoded-region start end orig-file))
(set-default-file-modes orig-mode))
(when (stringp signature)
(copy-file signature (setq signature (concat orig-file ".asc")))
;;; Code:
+(require 'mel) ; binary-to-text-funcall, binary-write-decoded-region
(eval-when-compile (require 'pgg))
(defgroup pgg-pgp5 ()
(defvar pgg-pgp5-user-id nil
"PGP 5.* ID of your default identity.")
+(defvar pgg-pgp5-messages-coding-system pgg-messages-coding-system
+ "Coding system used when reading from a PGP5 external process.")
+
(defvar pgg-scheme-pgp5-instance nil)
;;;###autoload
(unwind-protect
(progn
(setq process
- (apply #'binary-start-process-shell-command "*PGP*"
- output-buffer
+ (apply #'binary-to-text-funcall
+ pgg-pgp5-messages-coding-system
+ #'start-process-shell-command "*PGP*" output-buffer
program args))
(set-process-sentinel process #'ignore)
(when passphrase
(unwind-protect
(progn
(set-default-file-modes 448)
- (binary-write-region start end orig-file))
+ (binary-write-decoded-region start end orig-file))
(set-default-file-modes orig-mode))
(when (stringp signature)
(copy-file signature (setq signature (concat orig-file ".asc")))
(require 'custom)
-(defconst mime-user-interface-product ["SEMI" (1 14 1) "Kaga-Onsen"]
+(defconst mime-user-interface-product ["SEMI" (1 14 2) "Daishòji"]
"Product name, version number and code name of MIME-kernel package.")
(autoload 'mule-caesar-region "mule-caesar"
;;; Code:
(require 'path-util)
-(require 'raw-io)
+(require 'mel)
+;; binary-funcall, binary-write-decoded-region, binary-insert-encoded-file
(eval-when-compile (require 'static))
(defgroup smime ()
(buffer-disable-undo)
(erase-buffer))
(setq process
- (apply #'binary-start-process-shell-command "*S/MIME*"
- smime-output-buffer program args))
+ (apply #'binary-funcall #'start-process-shell-command
+ "*S/MIME*" smime-output-buffer
+ program args))
(set-process-sentinel process 'ignore)
(process-send-region process start end)
(process-send-eof process)
(unwind-protect
(progn
(set-default-file-modes 448)
- (binary-write-region start end orig-file))
+ (binary-write-decoded-region start end orig-file))
(set-default-file-modes orig-mode))
(with-temp-buffer
- (binary-insert-file-contents signature)
+ (binary-insert-encoded-file signature)
(goto-char (point-max))
- (binary-insert-file-contents
+ (binary-insert-encoded-file
(or (smime-find-certificate
(smime-query-signer (point-min)(point-max)))
(expand-file-name