From: yamaoka Date: Thu, 28 Dec 2000 07:04:46 +0000 (+0000) Subject: Synch with `semi-1_14'. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=de786f502edb1ae3cfd879ca2e7efdc94c1d2ecd;p=elisp%2Fsemi.git Synch with `semi-1_14'. --- diff --git a/ChangeLog b/ChangeLog index 431b983..93ecd4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,209 @@ +2000-12-28 MORIOKA Tomohiko + + * mime-view.el (mime-view-read-situation-examples-file): Don't try + to read situation-examples-file is it is nil. + (mime-situation-examples-file): Avoid to read + situation-examples-file at compile time. + +2000-12-28 MORIOKA Tomohiko + + * mime-view.el (mime-view-read-situation-examples-file): Display + warning. [cf. ] + +2000-12-27 MORIOKA Tomohiko + + * mime-view.el (mime-view-mailcap-files): New user option. + (mime-view-read-mailcap-files): Renamed from + `mime-view-read-mailcap'; read `mime-view-mailcap-files'. + + * mime-view.el (mime-view-read-situation-examples-file): New + function; don't occur error. + (mime-view-read-mailcap): New function. + +2000-12-27 MORIOKA Tomohiko + + * mime-play.el (mime-play-messages-coding-system): Renamed from + `mime-mailcap-method-messages-coding-system'. + + * pgg-def.el (pgg-messages-coding-system): Change default value to + nil. + +2000-12-27 MORIOKA Tomohiko + + * mime-play.el (mime-activate-mailcap-method): Fix typo. + +2000-12-26 Daiki Ueno + + * mime-play.el (mime-mailcap-method-messages-coding-system): New + variable. + (mime-activate-mailcap-method): Use it. + +2000-12-26 Daiki Ueno + + * pgg-def.el (pgg-messages-coding-system): Use `defvar' to define. + + * pgg-pgp.el (pgg-pgp-messages-coding-system): Abolish. + (pgg-pgp-process-region): Use `binary-funcall' instead of + `binary-to-text-funcall'. + + * pgg-pgp5.el (pgg-pgp5-messages-coding-system): Abolish. + (pgg-pgp5-process-region): Use `binary-funcall' instead of + `binary-to-text-funcall'. + + +2000-12-25 MORIOKA Tomohiko + + * SEMI: Version 1.14.2 (Daish-Dòji)-A released. + + * README.en (Required environment): Update to FLIM 1.14.2. + + * mail-mime-setup.el (mail-setup-hook): Don't add + `eword-decode-header'. + +2000-12-23 MORIOKA Tomohiko + + * mime-view.el (mime-view-define-keymap): Return + `mime-view-mode-map' instead of set up as local keymap; don't call + `mime-view-define-keymap-hook'. + (mime-display-message): Add new optional argument `keymap'. + + * mime-play.el (mime-store-message/partial-piece): Use + `binary-insert-encoded-file' and `binary-write-decoded-region' + instead of `binary-insert-file-contents' and + `binary-write-region'. + +2000-12-23 MORIOKA Tomohiko + + * smime.el (smime-process-region): Use `binary-funcall' instead of + `binary-start-process-shell-command'. + (smime-verify-region): Use `binary-write-decoded-region' and + `binary-insert-encoded-file' instead of `binary-write-region' and + `binary-insert-file-contents'. + + * pgg-pgp5.el (pgg-pgp5-messages-coding-system): New variable. + (pgg-pgp5-process-region): Use `binary-to-text-funcall' instead of + `binary-start-process-shell-command'. + (pgg-scheme-verify-region): Use `binary-write-decoded-region' + instead of `binary-write-region'. + + * pgg-pgp.el (pgg-pgp-messages-coding-system): New variable. + (pgg-pgp-process-region): Use `binary-to-text-funcall' instead of + `binary-start-process-shell-command'. + (pgg-scheme-verify-region): Use `binary-write-decoded-region' + instead of `binary-write-region'. + + * pgg-gpg.el (pgg-gpg-process-region): Use + `binary-to-text-funcall' instead of `binary-start-process'. + + +2000-12-22 MORIOKA Tomohiko + + * README.en (Required environment): Require FLIM 1.14.1 or later; + update required emacsen. + +2000-12-22 MORIOKA Tomohiko + + * pgg-gpg.el (pgg-gpg-process-region): Use + `pgg-gpg-messages-coding-system'. + +2000-12-21 Tadashi Watanabe + + * pgg-gpg.el (pgg-scheme-verify-region): Use a "-" as the name for + the file with the signed material. + +2000-12-21 Daiki Ueno + + * pgg-def.el (pgg-messages-coding-system): New user option. + +2000-12-20 MORIOKA Tomohiko + + * mime-view.el: Don't use `static-cond'. + +2000-12-19 MORIOKA Tomohiko + + * mime-edit.el (mime-edit-mime-version-field-for-message/partial): + Use `mime-encode-field-body' instead of `eword-encode-field-body'. + +2000-12-19 MORIOKA Tomohiko + + * mime-edit.el (mime-edit-translate-header): Use + `mime-encode-header-in-buffer' instead of `eword-encode-header'. + (mime-edit-encrypt-pgp-mime): Likewise. + (mime-edit-translate-single-part-tag): Likewise. + +2000-12-17 MORIOKA Tomohiko + + * postpet.el: Require `mime'. + + * pgg-parse.el (pgg-format-key-identifier): Don't use + `string-to-int-list'. + (pgg-read-bytes): Likewise. + (pgg-read-body): Likewise. + +2000-12-16 MORIOKA Tomohiko + + * smime.el: Require `raw-io'. + (smime-process-region): Use `binary-start-process-shell-command'. + + * pgg-pgp5.el (pgg-pgp5-process-region): Use + `binary-start-process-shell-command'. + + * pgg-pgp.el (pgg-pgp-process-region): Use + `binary-start-process-shell-command'. + + * pgg-gpg.el (pgg-gpg-process-region): Use `binary-start-process'. + +2000-12-15 MORIOKA Tomohiko + + * pgg-def.el: Require `custom' instead of `pcustom'. + +2000-12-15 TAKAHASHI Kaoru + + * Makefile (tar): Use `cvs tag -R' instead of `cvs tag -RF'. + +2000-12-15 MORIOKA Tomohiko + + * smime.el (smime-process-region): Don't use `as-binary-process'. + (smime-verify-region): Use `binary-write-region' instead of + `write-region-as-binary'; use `binary-insert-file-contents' + instead of `insert-file-contents-as-binary'. + + * semi-def.el: Don't require `poe'. + + * pgg-pgp5.el (pgg-pgp5-process-region): Don't use + `as-binary-process'. + (pgg-scheme-verify-region): Use `binary-write-region' instead of + `write-region-as-binary'. + (pgg-scheme-snarf-keys-region): Don't use + `write-region-as-raw-text-CRLF'. + + * pgg-pgp.el (pgg-pgp-process-region): Don't use + `as-binary-process'. + (pgg-scheme-verify-region): Use `binary-write-region' instead of + `write-region-as-binary'. + (pgg-scheme-snarf-keys-region): Don't use + `write-region-as-raw-text-CRLF'. + + * pgg-parse.el: Don't require `poem'; require `custom' instead of + `pcustom'. + + * pgg-gpg.el (pgg-gpg-process-region): Don't use + `as-binary-output-file' and + `insert-file-contents-as-raw-text-CRLF'. + + * mime-view.el: Don't require `emu'. + (mouse-button-3): New variable. + + * mime-play.el (mime-store-message/partial-piece): Use + `binary-insert-file-contents' instead of + `insert-file-contents-as-binary'; don't use + `as-binary-input-file'; use `binary-write-region' instead of + `write-region-as-binary'. + +2000-12-07 MORIOKA Tomohiko + + * mime-w3.el: Avoid error even if `w3' is not found. + 2000-11-26 MORIOKA Tomohiko * mime-view.el: Use `mime-conf' instead of `mailcap'. diff --git a/Makefile b/Makefile index ef7eaea..e053d00 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PACKAGE = wemi API = 1.14 -RELEASE = 0 +RELEASE = 2 FLIM_API= 1.14 @@ -51,7 +51,7 @@ clean: tar: cvs commit - sh -c 'cvs tag -RF $(PACKAGE)-`echo $(VERSION) | tr . _`; \ + sh -c 'cvs tag -R $(PACKAGE)-`echo $(VERSION) | tr . _`; \ cd /tmp; \ cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root \ export -d $(PACKAGE)-$(VERSION) \ diff --git a/README.en b/README.en index 1b5c94d..4548595 100644 --- a/README.en +++ b/README.en @@ -44,7 +44,7 @@ Required environment 19.14. WEMI also does not support Emacs 19.29 to 19.34, XEmacs 19.15 or XEmacs 20.2 without mule, but WEMI may work with them. - SEMI requires APEL (9.22 or later) and FLIM (Chao 1.14.1 or later) + SEMI requires APEL (9.22 or later) and FLIM (1.14.2 or later) package. Please install them before installing it. APEL package is available at: diff --git a/VERSION b/VERSION index 8b8d6ef..fe72e9e 100644 --- a/VERSION +++ b/VERSION @@ -82,9 +82,9 @@ 1.13.6 Komatsu $(B>.>>(B 1.13.7 Awazu $(B0@DE(B 1.14.0 Iburihashi $(BF066(B ------- Kaga-Onsen $(B2C2l29@t(B ------- Daish-Dòji-A $(BBg@;;{(B ------- Ushinoya $(B5m%NC+(B +1.14.1 Kaga-Onsen $(B2C2l29@t(B +1.14.2 Daish-Dòji-A $(BBg@;;{(B +1.14.3 Ushinoya $(B5m%NC+(B ------ Hosorogi $(B:YO$LZ(B ------ Awara-Onsen $(B028629@t(B : : : @@ -156,7 +156,10 @@ 1.13.5 Fijieda $(BF#;^(B 1.13.6 Rokug-Dò-A $(BO;9g(B 1.13.7 Shimada $(BEgED(B -1.14.0 Kanaya $(B6bC+(B ; = $(BBg0f@nE4F;(B +1.14.0 +1.14.1 +1.14.2 +1.14.3 Kanaya $(B6bC+(B ; = $(BBg0f@nE4F;(B ------ Kikugawa $(B5F@n(B ------ Kakegawa $(B3]@n(B ; = $(BE7N5IML>8PE4F;(B ------ Fukuroi $(BB^0f(B diff --git a/mail-mime-setup.el b/mail-mime-setup.el index 710d15b..7b375b7 100644 --- a/mail-mime-setup.el +++ b/mail-mime-setup.el @@ -1,6 +1,6 @@ ;;; 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 ;; Keywords: mail-mode, MIME, multimedia, multilingual, encoded-word @@ -31,14 +31,14 @@ (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 diff --git a/mime-edit.el b/mime-edit.el index d6899a3..56dc680 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -110,7 +110,6 @@ (require 'sendmail) (require 'mail-utils) (require 'mel) -(require 'eword-encode) ; eword-encode-field-body (require 'mime-view) (require 'signature) (require 'alist) @@ -711,7 +710,7 @@ Tspecials means any character that matches with it in header must be quoted.") (defconst mime-edit-mime-version-field-for-message/partial (concat "MIME-Version:" - (eword-encode-field-body + (mime-encode-field-body (concat " 1.0 (split by " mime-edit-version ")\n") "MIME-Version:")) "MIME version field for message/partial.") @@ -1648,9 +1647,8 @@ Parameter must be '(PROMPT CHOICE1 (CHOISE2 ...))." (defun mime-edit-translate-header () "Encode the message header into network representation." - (eword-encode-header 'code-conversion) - (run-hooks 'mime-edit-translate-header-hook) - ) + (mime-encode-header-in-buffer 'code-conversion) + (run-hooks 'mime-edit-translate-header-hook)) (defun mime-edit-translate-buffer () "Encode the tagged MIME message in current buffer in MIME compliant message." @@ -1874,7 +1872,7 @@ Content-Transfer-Encoding: 7bit (insert (format "Content-Transfer-Encoding: %s\n" encoding)) ) (insert "\n") - (eword-encode-header) + (mime-encode-header-in-buffer) (or (let ((pgg-default-user-id (or mime-edit-pgp-user-id (if from @@ -2122,8 +2120,7 @@ Content-Description: S/MIME Encrypted Message][base64]]\n") (insert "Content-Type: " contype "\n") (if encoding (insert "Content-Transfer-Encoding: " encoding "\n")) - (eword-encode-header) - ) + (mime-encode-header-in-buffer)) (cons (and contype (downcase contype)) (and encoding diff --git a/mime-play.el b/mime-play.el index 1b1b869..dad7904 100644 --- a/mime-play.el +++ b/mime-play.el @@ -46,6 +46,9 @@ If t, it means current directory." (defvar mime-play-find-every-situations t "*Find every available situations if non-nil.") +(defvar mime-play-messages-coding-system nil + "Coding system to be used for external MIME playback method.") + ;;; @ content decoder ;;; @@ -142,8 +145,7 @@ specified, play as it. Default MODE is \"play\"." (if (and name (not (string= name ""))) (expand-file-name name temporary-file-directory) (make-temp-name - (expand-file-name "EMI" temporary-file-directory)) - )) + (expand-file-name "EMI" temporary-file-directory)))) (mime-write-entity-content entity name) (message "External method is starting...") (let ((process @@ -151,13 +153,12 @@ specified, play as it. Default MODE is \"play\"." (mime-format-mailcap-command method (cons (cons 'filename name) situation)))) - (start-process command mime-echo-buffer-name - shell-file-name shell-command-switch command) - ))) + (binary-to-text-funcall + mime-play-messages-coding-system + #'start-process command mime-echo-buffer-name + shell-file-name shell-command-switch command)))) (set-alist 'mime-mailcap-method-filename-alist process name) - (set-process-sentinel process 'mime-mailcap-method-sentinel) - ) - )) + (set-process-sentinel process 'mime-mailcap-method-sentinel)))) (defun mime-mailcap-method-sentinel (process event) (let ((file (cdr (assq process mime-mailcap-method-filename-alist)))) @@ -369,7 +370,7 @@ It is registered to variable `mime-preview-quitting-method-alist'." (save-window-excursion (set-buffer full-buf) (erase-buffer) - (insert-file-contents-as-binary file) + (binary-insert-encoded-file file) (setq major-mode 'mime-show-message-mode) (mime-view-buffer (current-buffer) nil mother) (setq pbuf (current-buffer)) @@ -420,24 +421,21 @@ It is registered to variable `mime-preview-quitting-method-alist'." (or (file-exists-p file) (throw 'tag nil) ) - (as-binary-input-file (insert-file-contents file)) + (binary-insert-encoded-file file) (goto-char (point-max)) - (setq i (1+ i)) - )) - (write-region-as-binary (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))) diff --git a/mime-view.el b/mime-view.el index 2050bc9..54fb800 100644 --- a/mime-view.el +++ b/mime-view.el @@ -27,7 +27,6 @@ ;;; Code: -(require 'emu) (require 'mime) (require 'semi-def) (require 'calist) @@ -67,6 +66,15 @@ buttom. Nil means don't scroll at all." (const :tag "On" t) (sexp :tag "Situation" 1))) +(defcustom mime-view-mailcap-files + (let ((files '("/etc/mailcap" "/usr/etc/mailcap" "~/.mailcap"))) + (or (member mime-mailcap-file files) + (setq files (cons mime-mailcap-file files))) + files) + "List of mailcap files." + :group 'mime-view + :type '(repeat file)) + ;;; @ in raw-buffer (representation space) ;;; @@ -361,6 +369,53 @@ mother-buffer." (defvar mime-acting-situation-example-list-max-size 16) (defvar mime-situation-examples-file-coding-system nil) +(defun mime-view-read-situation-examples-file (&optional file) + (or file + (setq file mime-situation-examples-file)) + (if (and file + (file-readable-p file)) + (with-temp-buffer + (insert-file-contents file) + (setq mime-situation-examples-file-coding-system + (and (boundp 'buffer-file-coding-system) + buffer-file-coding-system) + ;; (static-cond + ;; ((boundp 'buffer-file-coding-system) + ;; (symbol-value 'buffer-file-coding-system)) + ;; ((boundp 'file-coding-system) + ;; (symbol-value 'file-coding-system)) + ;; (t nil)) + ) + (condition-case error + (eval-buffer) + (error (message "%s is broken: %s" file (cdr error)))) + ;; format check + (condition-case nil + (let ((i 0)) + (while (and (> (length mime-preview-situation-example-list) + mime-preview-situation-example-list-max-size) + (< i 16)) + (setq mime-preview-situation-example-list + (mime-reduce-situation-examples + mime-preview-situation-example-list)) + (setq i (1+ i)))) + (error (setq mime-preview-situation-example-list nil))) + ;; (let ((rest mime-preview-situation-example-list)) + ;; (while rest + ;; (ctree-set-calist-strictly 'mime-preview-condition + ;; (caar rest)) + ;; (setq rest (cdr rest)))) + (condition-case nil + (let ((i 0)) + (while (and (> (length mime-acting-situation-example-list) + mime-acting-situation-example-list-max-size) + (< i 16)) + (setq mime-acting-situation-example-list + (mime-reduce-situation-examples + mime-acting-situation-example-list)) + (setq i (1+ i)))) + (error (setq mime-acting-situation-example-list nil)))))) + (defun mime-save-situation-examples () (if (or mime-preview-situation-example-list mime-acting-situation-example-list) @@ -381,13 +436,15 @@ mother-buffer." (insert "\n;;; " (file-name-nondirectory file) " ends here.\n") - (static-cond - ((boundp 'buffer-file-coding-system) - (setq buffer-file-coding-system - mime-situation-examples-file-coding-system)) - ((boundp 'file-coding-system) - (setq file-coding-system - mime-situation-examples-file-coding-system))) + (setq buffer-file-coding-system + mime-situation-examples-file-coding-system) + ;; (static-cond + ;; ((boundp 'buffer-file-coding-system) + ;; (setq buffer-file-coding-system + ;; mime-situation-examples-file-coding-system)) + ;; ((boundp 'file-coding-system) + ;; (setq file-coding-system + ;; mime-situation-examples-file-coding-system))) (setq buffer-file-name file) (save-buffer))))) @@ -871,34 +928,39 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (defvar mime-acting-condition nil "Condition-tree about how to process entity.") -(if (file-readable-p mime-mailcap-file) - (let ((entries (mime-parse-mailcap-file))) - (while entries - (let ((entry (car entries)) - view print shared) - (while entry - (let* ((field (car entry)) - (field-type (car field))) - (cond ((eq field-type 'view) (setq view field)) - ((eq field-type 'print) (setq print field)) - ((memq field-type '(compose composetyped edit))) - (t (setq shared (cons field shared)))) - ) - (setq entry (cdr entry)) +(defun mime-view-read-mailcap-files (&optional files) + (or files + (setq files mime-view-mailcap-files)) + (let (entries file) + (while files + (setq file (car files)) + (if (file-readable-p file) + (setq entries (append entries (mime-parse-mailcap-file file)))) + (setq files (cdr files))) + (while entries + (let ((entry (car entries)) + view print shared) + (while entry + (let* ((field (car entry)) + (field-type (car field))) + (cond ((eq field-type 'view) (setq view field)) + ((eq field-type 'print) (setq print field)) + ((memq field-type '(compose composetyped edit))) + (t (setq shared (cons field shared)))) ) - (setq shared (nreverse shared)) - (ctree-set-calist-with-default - 'mime-acting-condition - (append shared (list '(mode . "play")(cons 'method (cdr view))))) - (if print - (ctree-set-calist-with-default - 'mime-acting-condition - (append shared - (list '(mode . "print")(cons 'method (cdr view)))) - )) - ) - (setq entries (cdr entries)) - ))) + (setq entry (cdr entry))) + (setq shared (nreverse shared)) + (ctree-set-calist-with-default + 'mime-acting-condition + (append shared (list '(mode . "play")(cons 'method (cdr view))))) + (if print + (ctree-set-calist-with-default + 'mime-acting-condition + (append shared + (list '(mode . "print")(cons 'method (cdr view))))))) + (setq entries (cdr entries))))) + +(mime-view-read-mailcap-files) (ctree-set-calist-strictly 'mime-acting-condition @@ -1090,6 +1152,7 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (set-buffer (event-buffer event)) (popup-menu 'mime-view-xemacs-popup-menu)) (defvar mouse-button-2 'button2) + (defvar mouse-button-3 'button3) ) (t (defvar mime-view-popup-menu @@ -1111,13 +1174,13 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (commandp func) (funcall func)))) (defvar mouse-button-2 [mouse-2]) + (defvar mouse-button-3 [mouse-3]) )) (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 @@ -1210,15 +1273,15 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (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." @@ -1239,7 +1302,7 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." ;;;###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 @@ -1250,7 +1313,14 @@ Optional argument MOTHER specifies mother-buffer of the preview-buffer. 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 @@ -1263,8 +1333,7 @@ keymap of MIME-View mode." (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") @@ -1273,14 +1342,17 @@ keymap of MIME-View mode." (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) @@ -1788,43 +1860,11 @@ It calls function registered in variable (provide 'mime-view) -(let ((file mime-situation-examples-file)) - (if (file-readable-p file) - (with-temp-buffer - (insert-file-contents file) - (setq mime-situation-examples-file-coding-system - (static-cond - ((boundp 'buffer-file-coding-system) - (symbol-value 'buffer-file-coding-system)) - ((boundp 'file-coding-system) - (symbol-value 'file-coding-system)) - (t nil))) - (eval-buffer) - ;; format check - (condition-case nil - (let ((i 0)) - (while (and (> (length mime-preview-situation-example-list) - mime-preview-situation-example-list-max-size) - (< i 16)) - (setq mime-preview-situation-example-list - (mime-reduce-situation-examples - mime-preview-situation-example-list)) - (setq i (1+ i)))) - (error (setq mime-preview-situation-example-list nil))) - ;; (let ((rest mime-preview-situation-example-list)) - ;; (while rest - ;; (ctree-set-calist-strictly 'mime-preview-condition - ;; (caar rest)) - ;; (setq rest (cdr rest)))) - (condition-case nil - (let ((i 0)) - (while (and (> (length mime-acting-situation-example-list) - mime-acting-situation-example-list-max-size) - (< i 16)) - (setq mime-acting-situation-example-list - (mime-reduce-situation-examples - mime-acting-situation-example-list)) - (setq i (1+ i)))) - (error (setq mime-acting-situation-example-list nil)))))) +(eval-when-compile + (setq mime-situation-examples-file nil) + ;; to avoid to read situation-examples-file at compile time. + ) + +(mime-view-read-situation-examples-file) ;;; mime-view.el ends here diff --git a/mime-w3.el b/mime-w3.el index ff2aecc..9ba2dcb 100644 --- a/mime-w3.el +++ b/mime-w3.el @@ -24,7 +24,9 @@ ;;; Code: -(require 'w3) +(condition-case nil + (require 'w3) + (error nil)) (require 'mime) (defmacro mime-put-keymap-region (start end keymap) diff --git a/pgg-def.el b/pgg-def.el index 1227996..7630f95 100644 --- a/pgg-def.el +++ b/pgg-def.el @@ -1,8 +1,8 @@ ;;; pgg-def.el --- functions/macros for defining PGG functions -;; Copyright (C) 1999 Daiki Ueno +;; Copyright (C) 1999 Free Software Foundation, Inc. -;; Author: Daiki Ueno +;; Author: Daiki Ueno ;; Created: 1999/11/02 ;; Keywords: PGP, OpenPGP, GnuPG @@ -25,7 +25,7 @@ ;;; Code: -(require 'pcustom) +(require 'custom) (defgroup pgg () "Glue for the various PGP implementations." @@ -58,6 +58,9 @@ :group 'pgg :type 'boolean) +(defvar pgg-messages-coding-system nil + "Coding system used when reading from a PGP external process.") + (defvar pgg-status-buffer " *PGG status*") (defvar pgg-errors-buffer " *PGG errors*") (defvar pgg-output-buffer " *PGG output*") diff --git a/pgg-gpg.el b/pgg-gpg.el index 5ac69f6..dc6c5ae 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -1,6 +1,6 @@ ;;; pgg-gpg.el --- GnuPG support for PGG. -;; Copyright (C) 1999,2000 Daiki Ueno +;; Copyright (C) 1999,2000 Free Software Foundation, Inc. ;; Author: Daiki Ueno ;; Created: 1999/10/28 @@ -25,6 +25,7 @@ ;;; Code: +(require 'mel) ; binary-to-text-funcall (eval-when-compile (require 'pgg)) (defgroup pgg-gpg () @@ -47,6 +48,9 @@ (defvar pgg-gpg-user-id nil "GnuPG ID of your default identity.") +(defvar pgg-gpg-messages-coding-system pgg-messages-coding-system + "Coding system used when reading from a GnuPG external process.") + (defvar pgg-scheme-gpg-instance nil) ;;;###autoload @@ -74,9 +78,11 @@ (unwind-protect (progn (set-default-file-modes 448) - (as-binary-output-file - (setq process - (apply #'start-process "*GnuPG*" errors-buffer program args))) + (setq process + (apply #'binary-to-text-funcall + pgg-gpg-messages-coding-system + #'start-process "*GnuPG*" errors-buffer + program args)) (set-process-sentinel process #'ignore) (when passphrase (process-send-string process (concat passphrase "\n"))) @@ -91,7 +97,8 @@ (buffer-disable-undo) (erase-buffer) (if (file-exists-p output-file-name) - (insert-file-contents-as-raw-text-CRLF output-file-name)) + (let ((coding-system-for-read 'raw-text-dos)) + (insert-file-contents output-file-name))) (set-buffer errors-buffer) (if (memq status '(stop signal)) (error "%s exited abnormally: '%s'" program exit-status)) @@ -185,6 +192,7 @@ (let ((args '("--batch" "--verify"))) (when (stringp signature) (setq args (append args (list signature)))) + (setq args (append args '("-"))) (pgg-gpg-process-region start end nil pgg-gpg-program args) (with-current-buffer pgg-errors-buffer (goto-char (point-min)) diff --git a/pgg-parse.el b/pgg-parse.el index 910b0ff..f3aec73 100644 --- a/pgg-parse.el +++ b/pgg-parse.el @@ -39,9 +39,8 @@ (eval-when-compile (require 'static)) -(require 'poem) (require 'pccl) -(require 'pcustom) +(require 'custom) (require 'mel) (defgroup pgg-parse () @@ -105,8 +104,11 @@ "Armor headers.") (defmacro pgg-format-key-identifier (string) - `(upcase (apply #'format "%02x%02x%02x%02x%02x%02x%02x%02x" - (string-to-int-list ,string)))) + `(mapconcat (lambda (c) (format "%02X" (char-int c))) + ,string "") + ;; `(upcase (apply #'format "%02x%02x%02x%02x%02x%02x%02x%02x" + ;; (string-to-int-list ,string))) + ) (defmacro pgg-parse-time-field (bytes) `(list (logior (lsh (car ,bytes) 8) @@ -127,7 +129,9 @@ (forward-char ,nbytes)))) (defmacro pgg-read-bytes (nbytes) - `(string-to-int-list (pgg-read-bytes-string ,nbytes))) + `(mapcar #'char-int (pgg-read-bytes-string ,nbytes)) + ;; `(string-to-int-list (pgg-read-bytes-string ,nbytes)) + ) (defmacro pgg-read-body-string (ptag) `(if (nth 1 ,ptag) @@ -135,7 +139,9 @@ (pgg-read-bytes-string (- (point-max) (point))))) (defmacro pgg-read-body (ptag) - `(string-to-int-list (pgg-read-body-string ,ptag))) + `(mapcar #'char-int (pgg-read-body-string ,ptag)) + ;; `(string-to-int-list (pgg-read-body-string ,ptag)) + ) (defalias 'pgg-skip-bytes 'forward-char) diff --git a/pgg-pgp.el b/pgg-pgp.el index 4f3fbd7..91f6134 100644 --- a/pgg-pgp.el +++ b/pgg-pgp.el @@ -25,6 +25,7 @@ ;;; Code: +(require 'mel) ; binary-to-text-funcall, binary-write-decoded-region (eval-when-compile (require 'pgg)) (defgroup pgg-pgp () @@ -88,10 +89,10 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (setenv "PGPPASSFD" "0")) (unwind-protect (progn - (as-binary-process - (setq process - (apply #'start-process-shell-command "*PGP*" output-buffer - program args))) + (setq process + (apply #'binary-funcall + #'start-process-shell-command "*PGP*" output-buffer + program args)) (set-process-sentinel process #'ignore) (when passphrase (process-send-string process (concat passphrase "\n"))) @@ -198,7 +199,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (unwind-protect (progn (set-default-file-modes 448) - (write-region-as-binary 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"))) @@ -234,7 +235,8 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (args (list "+verbose=1" "+batchmode" "+language=us" "-kaf" key-file))) - (write-region-as-raw-text-CRLF start end key-file) + (let ((coding-system-for-write 'raw-text-dos)) + (write-region start end key-file)) (pgg-pgp-process-region start end nil pgg-pgp-program args) (delete-file key-file) (pgg-process-when-success nil))) diff --git a/pgg-pgp5.el b/pgg-pgp5.el index 83e8187..58c3309 100644 --- a/pgg-pgp5.el +++ b/pgg-pgp5.el @@ -25,6 +25,7 @@ ;;; Code: +(require 'mel) ; binary-to-text-funcall, binary-write-decoded-region (eval-when-compile (require 'pgg)) (defgroup pgg-pgp5 () @@ -103,10 +104,10 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (setenv "PGPPASSFD" "0")) (unwind-protect (progn - (as-binary-process - (setq process - (apply #'start-process-shell-command "*PGP*" output-buffer - program args))) + (setq process + (apply #'binary-funcall + #'start-process-shell-command "*PGP*" output-buffer + program args)) (set-process-sentinel process #'ignore) (when passphrase (process-send-string process (concat passphrase "\n"))) @@ -210,7 +211,7 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (unwind-protect (progn (set-default-file-modes 448) - (write-region-as-binary 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"))) @@ -243,7 +244,8 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (args (list "+verbose=1" "+batchmode=1" "+language=us" "-a" key-file))) - (write-region-as-raw-text-CRLF start end key-file) + (let ((coding-system-for-write 'raw-text-dos)) + (write-region start end key-file)) (pgg-pgp5-process-region start end nil pgg-pgp5-pgpk-program args) (delete-file key-file) (pgg-process-when-success nil))) diff --git a/pgg.el b/pgg.el index 6975eef..1b40d48 100644 --- a/pgg.el +++ b/pgg.el @@ -1,8 +1,8 @@ ;;; pgg.el --- glue for the various PGP implementations. -;; Copyright (C) 1999,2000 Daiki Ueno +;; Copyright (C) 1999,2000 Free Software Foundation, Inc. -;; Author: Daiki Ueno +;; Author: Daiki Ueno ;; Created: 1999/10/28 ;; Keywords: PGP diff --git a/postpet.el b/postpet.el index f8730bb..4284cf6 100644 --- a/postpet.el +++ b/postpet.el @@ -24,6 +24,7 @@ ;;; Code: +(require 'mime) (require 'alist) (put 'unpack 'lisp-indent-function 1) diff --git a/semi-def.el b/semi-def.el index e7169c8..b05bc21 100644 --- a/semi-def.el +++ b/semi-def.el @@ -24,11 +24,10 @@ ;;; Code: -(require 'poe) (eval-when-compile (require 'static)) (require 'custom) -(defconst mime-user-interface-product ["WEMI" (1 14 0) "Kanaya"] +(defconst mime-user-interface-product ["WEMI" (1 14 3) "Kanaya"] "Product name, version number and code name of MIME-kernel package.") (autoload 'mule-caesar-region "mule-caesar" diff --git a/smime.el b/smime.el index d01ee0d..839c715 100644 --- a/smime.el +++ b/smime.el @@ -39,6 +39,8 @@ ;;; Code: (require 'path-util) +(require 'mel) +;; binary-funcall, binary-write-decoded-region, binary-insert-encoded-file (eval-when-compile (require 'static)) (defgroup smime () @@ -202,10 +204,10 @@ (with-current-buffer (get-buffer-create smime-output-buffer) (buffer-disable-undo) (erase-buffer)) - (as-binary-process - (setq process - (apply #'start-process-shell-command "*S/MIME*" - smime-output-buffer program args))) + (setq process + (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) @@ -301,12 +303,12 @@ the detached signature of the current region." (unwind-protect (progn (set-default-file-modes 448) - (write-region-as-binary start end orig-file)) + (binary-write-decoded-region start end orig-file)) (set-default-file-modes orig-mode)) (with-temp-buffer - (insert-file-contents-as-binary signature) + (binary-insert-encoded-file signature) (goto-char (point-max)) - (insert-file-contents-as-binary + (binary-insert-encoded-file (or (smime-find-certificate (smime-query-signer (point-min)(point-max))) (expand-file-name