From: yamaoka Date: Tue, 4 Aug 1998 08:11:04 +0000 (+0000) Subject: Update. X-Git-Tag: wemi-1_8_5~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c35a068cdfa693e53ca7195a8fc4ab6a992552ce;p=elisp%2Fsemi.git Update. --- diff --git a/ChangeLog b/ChangeLog index 58fa1d0..bc9e1aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +1998-07-21 MORIOKA Tomohiko + + * NEWS (Don't use "file" command to detect content of entity): New + section. + + * mime-play.el (mime-magic-type-alist): New variable; abolish + `mime-file-content-type-alist'. + (mime-detect-content): New implementation (don't use "file" + command). + + 1998-07-16 Katsumi Yamaoka * WEMI: Version 1.8.4 (Hara) released. diff --git a/NEWS b/NEWS index ab7b381..febedc3 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,20 @@ Copyright (C) 1998 Free Software Foundation, Inc. * Changes in SEMI 1.8 +** Don't use "file" command to detect content of entity + + Acting-method to detect content of entity was modified not to use +"file" command. + + Variable `mime-file-content-type-alist' was abolished. Instead of +it, new variable `mime-magic-type-alist' is available to customize. +It is an alist of regexp about magic-number vs. corresponding +media-types. Each element looks like (REGEXP TYPE SUBTYPE). REGEXP +is a regular expression to match against the beginning of the content +of entity. TYPE is symbol to indicate primary type of media-type. +SUBTYPE is symbol to indicate subtype of media-type. + + ** Abolish external X-Face viewer diff --git a/VERSION b/VERSION index dfe6c68..c86d2cd 100644 --- a/VERSION +++ b/VERSION @@ -61,9 +61,14 @@ 1.8.0 Toyama $(BIY;3(B ; = JR $(B9b;3K\@~!"IY;39A@~(B 1.8.1 Kureha $(B8b1)(B 1.8.2 Kosugi $(B>.?y(B -1.8.3 Ecch-Dþ-Daimon-A $(B1[CfBgLg(B +1.8.3 Ecch-Dþ-Daimon $(B1[CfBgLg(B-A 1.8.4 Takaoka $(B9b2,(B ; = JR $(BI98+@~!">kC<@~(B -: : : +1.8.5 Nishi-Takaoka $(B@>9b2,(B +----- Fukuoka $(BJ!2,(B +----- Isurugi $(B@PF0(B +----- Kurikara $(B6fMx2@Me(B +----- Tsubata $(BDEH((B +----- Morimoto $(B?9K\(B ------- Higashi-Kanazawa $(BEl6bBt(B ------- Kanazawa $(B6bBt(B ; <=> $(BKLN&E4F;(B $(BKLE46bBt(B ------- Nishi-Kanazawa $(B@>6bBt(B ; <=> $(BKLN&E4F;(B $(B?7@>6bBt(B @@ -87,44 +92,44 @@ ;;------------------------------------------------------------------------- ;; East Japan Railway $(BElF|K\N95RE4F;(B http://www.jreast.co.jp/ -;; T-Dòkaidò-A Line $(BEl3$F;K\@~(B +;; T-Dòkaidò Line $(BEl3$F;K\@~(B-A ;;------------------------------------------------------------------------- -1.2.0 T-Dòkyò-A $(BEl5~(B +1.2.0 T-Dòkyò $(BEl5~(B-A 1.2.1 Shinbashi $(B?766(B ; = JR $(B;3 $(B>.ED5^EEE4(B $(B9>%NEg@~!"9>%NEgEEE4(B -1.4.1 Tsujid-Dò-A $(@DT$(BF2(B ; $(B!J!V$(@DT$(B!W(B= J90@B-4454:128b$(B!K(B +1.4.1 Tsujid-Dò $(@DT$(BF2(B ; $(B!J!V$(@DT$(B!W(B= J90@B-4454:128b$(B!K(B-A 1.4.2 Chigasaki $(B3}%v:j(B ; = JR $(BAjLO@~(B 1.4.3 Hiratsuka $(BJ?DM(B -1.4.4 -DÒiso-A $(BBg0k(B -1.4.5 Ninomiya $BFs5\(B -1.4.6 K-Dòzu-A $(B9qI\DE(B ; = JR $(B8fEB>l@~(B -1.5.0 Kamonomiya $B3{5\(B -1.5.1 Odawara $B>.ED86(B ; <=> $B>.ED5^!"H":,EP;3E4F;!"(B - ; $B0KF&H":,E4F;(B -1.5.2 Hayakawa $BAa@n(B -1.5.3 Nebukawa $B:,I\@n(B -1.5.4 Manazuru $B??Da(B -1.6.0 Yugawara $BEr2O86(B +1.4.4 -DÒiso $(BBg0k(B-A +1.4.5 Ninomiya $(BFs5\(B +1.4.6 K-Dòzu $(B9qI\DE(B ; = JR $(B8fEB>l@~(B-A +1.5.0 Kamonomiya $(B3{5\(B +1.5.1 Odawara $(B>.ED86(B ; <=> $(B>.ED5^!"H":,EP;3E4F;!"(B + ; $(B0KF&H":,E4F;(B +1.5.2 Hayakawa $(BAa@n(B +1.5.3 Nebukawa $(B:,I\@n(B +1.5.4 Manazuru $(B??Da(B +1.6.0 Yugawara $(BEr2O86(B 1.7.0 Atami $(BG.3$(B ; = JR $(B0KEl@~(B ;;------------------------------------------------------------------------- ;; Central Japan Railway $(BEl3$N95RE4F;(B ;;------------------------------------------------------------------------- 1.7.1 Kan'nami $(BH!Fn(B -1.8.0 Mishima $B;0Eg(B ; = $B0KF&H":,E4F;(B -1.8.1 Numazu $B>BDE(B ; = JR $(B8fEB>l@~(B -1.8.2 Katahama $BJRIM(B -1.8.4 Hara $B86(B ------ Higashi-Tagonoura $BElED;R%N1:(B ------ Yoshiwara $B5H86(B ; = $B3YFnE4F;(B ------ Fuji $BIY;N(B ; = JR $B?H1d@~(B +1.8.0 Mishima $(B;0Eg(B ; = $(B0KF&H":,E4F;(B +1.8.1 Numazu $(B>BDE(B ; = JR $(B8fEB>l@~(B +1.8.2 Katahama $(BJRIM(B +1.8.4 Hara $(B86(B +1.8.5 Higashi-Tagonoura $(BElED;R%N1:(B +----- Yoshiwara $(B5H86(B ; = $(B3YFnE4F;(B +----- Fuji $(BIY;N(B ; = JR $(B?H1d@~(B : : : ----- Kanayama $(B6b;3(B ; =$(B!J(BJR $(BCf1{K\@~!K(B ------ Ot-Dòbashi $(BHxF,66(B-A +----- Ot-Dòbashi $(BHxF,66(B-A ----- Nagoya $(BL>8E20(B ; = JR $(B4X@>K\@~!J!&Cf1{K\@~!K(B : : : ----- Gifu $(B4tIl(B ; = JR $(B9b;3K\@~(B @@ -157,9 +162,9 @@ 1.5.0 Shimao $(BEgHx(B 1.6.0 Amaharashi $(B1+@2(B 1.8.0 Ecch-Dþ-Kokubu $(B1[Cf9qJ,(B-A -1.8.1 Fushiki $(BIzLZ(B ; <=> $B%&%i%8%*%9%C%H%C%/9RO)(B -1.8.2 N-Dòmachi-A $(BG=D.(B -1.8.3 Ecch-Dþ-Nakagawa-A $(B1[CfCf@n(B +1.8.1 Fushiki $(BIzLZ(B ; <=> $(B%&%i%8%*%9%C%H%C%/9RO)(B +1.8.2 N-Dòmachi $(BG=D.(B-A +1.8.3 Ecch-Dþ-Nakagawa $(B1[CfCf@n(B-A 1.8.4 Takaoka $(B9b2,(B ; = JR $(BKLN&K\@~!">kC<@~(B diff --git a/ftp.in b/ftp.in index 7cb4860..8408dbb 100644 --- a/ftp.in +++ b/ftp.in @@ -8,10 +8,10 @@ access-type=anon-ftp; site="ftp.jaist.ac.jp"; directory="/pub/GNU/elisp/semi"; - name="semi-VERSION.tar.gz"; + name="PACKAGE-VERSION.tar.gz"; mode=image]] Content-Type: application/octet-stream; - name="semi-VERSION.tar.gz"; + name="PACKAGE-VERSION.tar.gz"; type=tar; conversions=gzip --}-<> diff --git a/mime-play.el b/mime-play.el index bb5870b..25610c0 100644 --- a/mime-play.el +++ b/mime-play.el @@ -455,57 +455,54 @@ window.") ;;; @ file detection ;;; -(defvar mime-file-content-type-alist - '(("JPEG" image jpeg) - ("GIF" image gif) - ("Standard MIDI" audio midi) +(defvar mime-magic-type-alist + '(("^\377\330\377[\340\356]..JFIF" image jpeg) + ("^\211PNG" image png) + ("^GIF8[79]" image gif) + ("^II\\*\000" image tiff) + ("^MM\000\\*" image tiff) + ("^MThd" audio midi) + ("^\000\000\001\263" video mpeg) ) - "*Alist of \"file\" output patterns vs. corresponding media-types. + "*Alist of regexp about magic-number vs. corresponding media-types. Each element looks like (REGEXP TYPE SUBTYPE). -REGEXP is pattern for \"file\" command output. +REGEXP is a regular expression to match against the beginning of the +content of entity. TYPE is symbol to indicate primary type of media-type. SUBTYPE is symbol to indicate subtype of media-type.") (defun mime-detect-content (entity situation) - (let ((beg (mime-entity-point-min entity)) - (end (mime-entity-point-max entity))) - (goto-char beg) - (let* ((name (save-restriction - (narrow-to-region beg end) - (mime-entity-safe-filename entity) - )) - (encoding (or (cdr (assq 'encoding situation)) "7bit")) - (filename (if (and name (not (string-equal name ""))) - (expand-file-name name mime-temp-directory) - (make-temp-name - (expand-file-name "EMI" mime-temp-directory))))) - (mime-write-decoded-region (mime-entity-body-start entity) end - filename encoding) - (let (type subtype) - (with-temp-buffer - (call-process "file" nil t nil filename) - (goto-char (point-min)) - (if (search-forward (concat filename ": ") nil t) - (let ((rest mime-file-content-type-alist)) - (while (not (let ((cell (car rest))) - (if cell - (if (looking-at (car cell)) - (setq type (nth 1 cell) - subtype (nth 2 cell)) - ) - t))) - (setq rest (cdr rest)))))) - (if type - (mime-raw-play-entity - entity nil - (put-alist 'type type - (put-alist 'subtype subtype - (del-alist 'method - (copy-alist situation)))) - (cdr (assq 'ignore-examples situation)) - 'mime-detect-content) - )) - ))) + (let (type subtype) + (let ((mdata (save-excursion + ;;(set-buffer (mime-entity-buffer entity)) + (let* ((start (mime-entity-body-start entity)) + (end (progn + (goto-char start) + (end-of-line) + (point)))) + (mime-decode-string (buffer-substring start end) + (mime-entity-encoding entity)) + ))) + (rest mime-magic-type-alist)) + (while (not (let ((cell (car rest))) + (if cell + (if (string-match (car cell) mdata) + (setq type (nth 1 cell) + subtype (nth 2 cell)) + ) + t))) + (setq rest (cdr rest)))) + (if type + (mime-raw-play-entity + entity nil + (put-alist 'type type + (put-alist 'subtype subtype + (del-alist 'method + (copy-alist situation)))) + (cdr (assq 'ignore-examples situation)) + 'mime-detect-content) + )) + ) ;;; @ mail/news message diff --git a/semi-def.el b/semi-def.el index 35862c2..deb6ca4 100644 --- a/semi-def.el +++ b/semi-def.el @@ -29,7 +29,7 @@ (eval-when-compile (require 'cl)) -(defconst mime-user-interface-version '("WEMI" "Hara" 1 8 4) +(defconst mime-user-interface-version '("WEMI" "Higashi-Tagonoura" 1 8 5) "Implementation name, version name and numbers of MIME-kernel package.") (autoload 'mule-caesar-region "mule-caesar"