X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus-audio.el;h=d872dc1e06401099f68f9b3c9e2b603e7fd36d61;hb=e81909bba6d3f0df9aad905f2906f4880a935372;hp=ac959e742ad68ec6232041f24b8d2351453bcaca;hpb=a707b63af25b91cb730c12e65156ca364bf49a44;p=elisp%2Fgnus.git- diff --git a/lisp/gnus-audio.el b/lisp/gnus-audio.el index ac959e7..d872dc1 100644 --- a/lisp/gnus-audio.el +++ b/lisp/gnus-audio.el @@ -1,5 +1,7 @@ ;;; gnus-audio.el --- Sound effects for Gnus -;; Copyright (C) 1996, 2000 Free Software Foundation + +;; Copyright (C) 1996, 2000, 2002, 2003, 2004, +;; 2005 Free Software Foundation, Inc. ;; Author: Steven L. Baur ;; Keywords: news, mail, multimedia @@ -18,8 +20,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -30,8 +32,11 @@ (require 'nnheader) +(require 'path-util) + (defgroup gnus-audio nil "Playing sound in Gnus." + :version "21.1" :group 'gnus-visual :group 'multimedia) @@ -46,15 +51,15 @@ :type '(choice directory (const nil)) :group 'gnus-audio) -(defcustom gnus-audio-au-player "/usr/bin/showaudio" +(defcustom gnus-audio-au-player (exec-installed-p "play") "Executable program for playing sun AU format sound files." :group 'gnus-audio - :type 'string) + :type '(choice file (const nil))) -(defcustom gnus-audio-wav-player "/usr/local/bin/play" +(defcustom gnus-audio-wav-player (exec-installed-p "play") "Executable program for playing WAV files." :group 'gnus-audio - :type 'string) + :type '(choice file (const nil))) ;;; The following isn't implemented yet. Wait for Millennium Gnus. ;;(defvar gnus-audio-effects-enabled t @@ -92,18 +97,18 @@ ;;;###autoload (defun gnus-audio-play (file) "Play a sound FILE through the speaker." - (interactive) + (interactive "fSound file name: ") (let ((sound-file (if (file-exists-p file) file (expand-file-name file gnus-audio-directory)))) (when (file-exists-p sound-file) (cond ((and gnus-audio-inline-sound - (condition-case nil - ;; Even if we have audio, we may fail with the - ;; wrong sort of sound file. - (progn (play-sound-file sound-file) - t) - (error nil)))) + (condition-case nil + ;; Even if we have audio, we may fail with the + ;; wrong sort of sound file. + (progn (play-sound-file sound-file) + t) + (error nil)))) ;; If we don't have built-in sound, or playing it failed, ;; try with external program. ((equal "wav" (file-name-extension sound-file))