update.
[elisp/semi.git] / mime-mac.el
1 ;;; mime-mac.el --- Playback processing module for Mac OS X
2
3 ;; Copyright (C) 2010 Free Software Foundation, Inc.
4
5 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
6 ;; Keywords: MIME, multimedia, mail, news
7
8 ;; This file is part of SEMI (Secretariat of Emacs MIME Interfaces).
9
10 ;; This program is free software; you can redistribute it and/or
11 ;; modify it under the terms of the GNU General Public License as
12 ;; published by the Free Software Foundation; either version 2, or (at
13 ;; your option) any later version.
14
15 ;; This program is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 ;; General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
24
25 ;;; Code:
26
27 (require 'mime-play)
28
29 (defun mime-mac-save-and-play-with-open (entity situation)
30   (let ((filename
31          (mime-save-content entity situation)))
32     (call-process "open" nil nil nil filename)))
33
34 (defun mime-mac-save-and-play-with-preview (entity situation)
35   (let ((filename
36          (mime-save-content entity situation)))
37     (call-process "open" nil nil nil
38                   "-a" "/Applications/Preview.app"
39                   filename)))
40
41 ;; (mime-add-condition
42 ;;  'action
43 ;;  '((type . application)
44 ;;    (method . mime-mac-save-and-play-with-open))
45 ;;  'strict)
46
47 ;; (mime-add-condition
48 ;;  'action
49 ;;  '((type . application)(subtype . pdf)
50 ;;    (method . mime-mac-save-and-play-with-preview))
51 ;;  'strict)
52
53
54 ;;; @ end
55 ;;;
56
57 (provide 'mime-mac)
58
59 ;;; mime-mac.el ends here