changeset 32131:3a54b3a6bf40

(substitute-key-definition): Doc fix. (play-sound-file): new command.
author Dave Love <fx@gnu.org>
date Wed, 04 Oct 2000 11:24:51 +0000
parents 281c3dca4833
children 49d0598afab6
files lisp/subr.el
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Wed Oct 04 09:59:43 2000 +0000
+++ b/lisp/subr.el	Wed Oct 04 11:24:51 2000 +0000
@@ -243,7 +243,7 @@
   "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF.
 In other words, OLDDEF is replaced with NEWDEF where ever it appears.
 Alternatively, if optional fourth argument OLDMAP is specified, we redefine
-in KEYMAP as NEWDEF those chars which are defined as OLDDEF in OLDMAP."
+in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP."
   ;; Don't document PREFIX in the doc string because we don't want to
   ;; advertise it.  It's meant for recursive calls only.  Here's its
   ;; meaning
@@ -1568,5 +1568,19 @@
 	    (setq minor-mode-map-alist (cons (cons toggle keymap)
 					     minor-mode-map-alist))))))))
 
+;; XEmacs compatibility/convenience.
+(if (fboundp 'play-sound)
+    (defun play-sound-file (file &optional volume device)
+      "Play sound stored in FILE.
+VOLUME and DEVICE correspond to the keywords of the sound
+specification for `play-sound'."
+      (interactive "fPlay sound file: ")
+      (let ((sound (list :file file)))
+	(if volume
+	    (plist-put sound :volume volume))
+	(if device
+	    (plist-put sound :device device))
+	(push 'sound sound)
+	(play-sound sound))))
 
 ;;; subr.el ends here