From 5ee537af57eda4750d8f2a9a07b001d647b31ded Mon Sep 17 00:00:00 2001 From: ueno Date: Thu, 2 Aug 2001 01:42:25 +0000 Subject: [PATCH] Synch up with semi-1_14_3. --- ChangeLog | 44 +++++++++++++++++ VERSION | 2 +- mime-play.el | 9 +++- mime-view.el | 156 +++++++++++++++++++++++++++++++++++----------------------- pgg-def.el | 3 ++ pgg-pgp.el | 5 +- pgg-pgp5.el | 5 +- 7 files changed, 156 insertions(+), 68 deletions(-) diff --git a/ChangeLog b/ChangeLog index c68da30..fcc0ead 100644 --- a/ChangeLog +++ b/ChangeLog @@ -48,6 +48,50 @@ (pgg-pgp5-process-region): Use `binary-funcall' instead of `binary-to-text-funcall'. + +2000-12-28 MORIOKA Tomohiko + + * SEMI: Version 1.14.3 (Ushinoya) released. + + * 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-25 MORIOKA Tomohiko * SEMI: Version 1.14.2 (Daish-Dòji)-A released. diff --git a/VERSION b/VERSION index 019f250..959d424 100644 --- a/VERSION +++ b/VERSION @@ -84,7 +84,7 @@ 1.14.0 Iburihashi $(BF066(B 1.14.1 Kaga-Onsen $(B2C2l29@t(B 1.14.2 Daish-Dòji-A $(BBg@;;{(B ------- Ushinoya $(B5m%NC+(B +1.14.3 Ushinoya $(B5m%NC+(B ------ Hosorogi $(B:YO$LZ(B ------ Awara-Onsen $(B028629@t(B : : : diff --git a/mime-play.el b/mime-play.el index ff06bbf..519659b 100644 --- a/mime-play.el +++ b/mime-play.el @@ -45,6 +45,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 ;;; @@ -143,8 +146,10 @@ 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)))) diff --git a/mime-view.el b/mime-view.el index 729d74d..aa6624b 100644 --- a/mime-view.el +++ b/mime-view.el @@ -66,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) ;;; @@ -338,6 +347,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) @@ -820,29 +876,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))) - (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))))) +(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 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 @@ -1639,43 +1705,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/pgg-def.el b/pgg-def.el index cb3fff8..7630f95 100644 --- a/pgg-def.el +++ b/pgg-def.el @@ -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-pgp.el b/pgg-pgp.el index a09e60c..679d2f4 100644 --- a/pgg-pgp.el +++ b/pgg-pgp.el @@ -90,8 +90,9 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (unwind-protect (progn (setq process - (apply #'binary-funcall #'start-process-shell-command - "*PGP*" output-buffer program args)) + (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"))) diff --git a/pgg-pgp5.el b/pgg-pgp5.el index cdc0029..e774ae4 100644 --- a/pgg-pgp5.el +++ b/pgg-pgp5.el @@ -105,8 +105,9 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"." (unwind-protect (progn (setq process - (apply #'binary-funcall #'start-process-shell-command - "*PGP*" output-buffer program args)) + (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"))) -- 1.7.10.4