X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fearcon.el;h=e9691e1aad76fe52970b68679699ccf9144910c2;hb=d698c48c20923ad743537c09b38e8895faa7c8a9;hp=2147eca5c98c32e6acb605ee25b5180650d79c81;hpb=f36138eb780b0c59634957f8dc838ccac3cf038f;p=gnus diff --git a/lisp/earcon.el b/lisp/earcon.el index 2147eca5c..e9691e1aa 100644 --- a/lisp/earcon.el +++ b/lisp/earcon.el @@ -1,8 +1,8 @@ ;;; earcon.el --- Sound effects for messages -;; Copyright (C) 1996 Free Software Foundation + +;; Copyright (C) 1996, 2000, 2001, 2003 Free Software Foundation ;; Author: Steven L. Baur -;; Keywords: news fun sound ;; This file is part of GNU Emacs. @@ -26,29 +26,31 @@ ;;; Code: -(if (null (boundp 'running-xemacs)) - (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))) - +(eval-when-compile (require 'cl)) (require 'gnus) (require 'gnus-audio) (require 'gnus-art) -(eval-when-compile (require 'cl)) -(defvar earcon-auto-play nil - "When True, automatically play sounds as well as buttonize them.") +(defgroup earcon nil + "Turn ** sounds ** into noise." + :group 'gnus-visual) -(defvar earcon-prefix "**" - "The start of an earcon") +(defcustom earcon-prefix "**" + "*String denoting the start of an earcon." + :type 'string + :group 'earcon) -(defvar earcon-suffix "**" - "The end of an earcon") +(defcustom earcon-suffix "**" + "String denoting the end of an earcon." + :type 'string + :group 'earcon) -(defvar earcon-regexp-alist +(defcustom earcon-regexp-alist '(("boring" 1 "Boring.au") ("evil[ \t]+laugh" 1 "Evil_Laugh.au") ("gag\\|puke" 1 "Puke.au") ("snicker" 1 "Snicker.au") - ("meow" 1 "catmeow.au") + ("meow" 1 "catmeow.wav") ("sob\\|boohoo" 1 "cry.wav") ("drum[ \t]*roll" 1 "drumroll.au") ("blast" 1 "explosion.au") @@ -60,13 +62,14 @@ ("cackle" 1 "witch.au") ("yell\\|roar" 1 "yell2.au") ("whoop-de-doo" 1 "whistle.au")) - "A list of regexps to map earcons to real sounds.") - + "*A list of regexps to map earcons to real sounds." + :type '(repeat (list regexp + (integer :tag "Match") + (string :tag "Sound"))) + :group 'earcon) (defvar earcon-button-marker-list nil) (make-variable-buffer-local 'earcon-button-marker-list) - - ;;; FIXME!! clone of code from gnus-vis.el FIXME!! (defun earcon-article-push-button (event) "Check text under the mouse pointer for a callback function. @@ -75,7 +78,7 @@ call it with the value of the `earcon-data' text property." (interactive "e") (set-buffer (window-buffer (posn-window (event-start event)))) (let* ((pos (posn-point (event-start event))) - (data (get-text-property pos 'earcon-data)) + (data (get-text-property pos 'earcon-data)) (fun (get-text-property pos 'earcon-callback))) (if fun (funcall fun data)))) @@ -128,7 +131,7 @@ If N is negative, move backward instead." gnus-article-button-face (gnus-overlay-put (gnus-make-overlay from to) 'face gnus-article-button-face)) - (gnus-add-text-properties + (gnus-add-text-properties from to (nconc (and gnus-article-mouse-face (list gnus-mouse-face-prop gnus-article-mouse-face)) @@ -147,7 +150,6 @@ If N is negative, move backward instead." (setq entry nil))) entry)) - (defun earcon-button-push (marker) ;; Push button starting at MARKER. (save-excursion