X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fearcon.el;h=1fe7d9ef61ee97dbc40735dd25c3699e89ba2c19;hb=82d219ce980dc263c9288225f901635336101fb4;hp=02ac3a5aeeb0b85be2e4f220aa98ebf184f7d78c;hpb=459083190baefc88bde0b06142d7c2727dcaa3c4;p=gnus diff --git a/lisp/earcon.el b/lisp/earcon.el index 02ac3a5ae..1fe7d9ef6 100644 --- a/lisp/earcon.el +++ b/lisp/earcon.el @@ -2,10 +2,6 @@ ;; Copyright (C) 1996 Free Software Foundation ;; Author: Steven L. Baur -;; Keywords: news fun sound - -;; This file is part of GNU Emacs. - ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) @@ -26,23 +22,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) -(eval-when-compile (require 'cl)) +(require 'gnus-art) -(defvar earcon-auto-play nil - "When True, automatially 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-auto-play nil + "*When True, automatically play sounds as well as buttonize them." + :type 'boolean + :group 'earcon) -(defvar earcon-suffix "**" - "The end of an earcon") +(defcustom earcon-prefix "**" + "*String denoting the start of an earcon." + :type 'string + :group 'earcon) -(defvar earcon-regexp-alist +(defcustom earcon-suffix "**" + "String denoting the end of an earcon." + :type 'string + :group 'earcon) + +(defcustom earcon-regexp-alist '(("boring" 1 "Boring.au") ("evil[ \t]+laugh" 1 "Evil_Laugh.au") ("gag\\|puke" 1 "Puke.au") @@ -59,13 +63,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. @@ -127,7 +132,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)) @@ -146,7 +151,6 @@ If N is negative, move backward instead." (setq entry nil))) entry)) - (defun earcon-button-push (marker) ;; Push button starting at MARKER. (save-excursion @@ -193,10 +197,10 @@ If N is negative, move backward instead." (setq beg (point)) (while (setq entry (pop alist)) (setq regexp (concat (regexp-quote earcon-prefix) - ".*\\(" - (car entry) - "\\).*" - (regexp-quote earcon-suffix))) + ".*\\(" + (car entry) + "\\).*" + (regexp-quote earcon-suffix))) (goto-char beg) (while (re-search-forward regexp nil t) (let* ((start (and entry (match-beginning 1)))