From: morioka Date: Wed, 8 Jul 1998 13:09:03 +0000 (+0000) Subject: (mime-delq-null-situation): Add new optional argument `ignored-value'. X-Git-Tag: remi-1_8_3~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b279759f136cb2bc383ca63148371a9db9b01f11;p=elisp%2Fsemi.git (mime-delq-null-situation): Add new optional argument `ignored-value'. (mime-raw-play-entity): Add new optional argument `ignored-method'; add `ignore-examples' to acting-situation. (mime-detect-content): Specify `ignore-examples' of acting-situation as `ignore-examples' of `mime-raw-play-entity'; specify `mime-detect-content' as `ignored-method' of `mime-raw-play-entity'. --- diff --git a/mime-play.el b/mime-play.el index de83764..625b628 100644 --- a/mime-play.el +++ b/mime-play.el @@ -172,13 +172,16 @@ If MODE is specified, play as it. Default MODE is \"play\"." ))) ) -(defsubst mime-delq-null-situation (situations field) +(defsubst mime-delq-null-situation (situations field + &optional ignored-value) (let (dest) (while situations - (let ((situation (car situations))) - (if (assq field situation) - (setq dest (cons situation dest)) - )) + (let* ((situation (car situations)) + (cell (assq field situation))) + (if cell + (or (eq (cdr cell) ignored-value) + (setq dest (cons situation dest)) + ))) (setq situations (cdr situations))) dest)) @@ -200,7 +203,8 @@ If MODE is specified, play as it. Default MODE is \"play\"." (cons match example) )) -(defun mime-raw-play-entity (entity &optional mode situation ignore-examples) +(defun mime-raw-play-entity (entity &optional mode situation ignore-examples + ignored-method) "Play entity specified by ENTITY. It decodes the entity to call internal or external method. The method is selected from variable `mime-acting-condition'. If MODE is @@ -211,11 +215,16 @@ specified, play as it. Default MODE is \"play\"." (if mode (setq situation (cons (cons 'mode mode) situation)) ) + (if ignore-examples + (or (assq 'ignore-examples situation) + (setq situation + (cons (cons 'ignore-examples ignore-examples) situation))) + ) (setq ret (mime-delq-null-situation (ctree-find-calist mime-acting-condition situation mime-view-find-every-acting-situation) - 'method)) + 'method ignored-method)) (or ignore-examples (if (cdr ret) (let ((rest ret) @@ -488,10 +497,13 @@ SUBTYPE is symbol to indicate subtype of media-type.") (setq rest (cdr rest)))))) (if type (mime-raw-play-entity - entity "play" + entity nil (put-alist 'type type (put-alist 'subtype subtype - (copy-alist situation)))) + (del-alist 'method + (copy-alist situation)))) + (cdr (assq 'ignore-examples situation)) + 'mime-detect-content) )) )))