X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fearcon.el;h=2086f86c4176b08fd6939c0c560f19849c4a76e6;hb=e4263c2b54da574cf1985745470bab486e87b512;hp=4302182733ca3840e30772bcd79ee9c263f0a703;hpb=b3ff1683e7dae3919a69965b9cbf79d9d931420e;p=gnus diff --git a/lisp/earcon.el b/lisp/earcon.el index 430218273..2086f86c4 100644 --- a/lisp/earcon.el +++ b/lisp/earcon.el @@ -1,11 +1,16 @@ ;;; earcon.el --- Sound effects for messages -;; Copyright (C) 1996 Free Software Foundation + +;; Copyright (C) 1996, 2000, 2001, 2002, 2003, 2004, +;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Steven L. Baur -;; GNU Emacs is free software; you can redistribute it and/or modify + +;; 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) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,18 +18,13 @@ ;; GNU General Public License for more details. ;; 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. +;; along with GNU Emacs. If not, see . ;;; Commentary: ;; This file provides access to sound effects in Gnus. ;;; 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) @@ -34,11 +34,6 @@ "Turn ** sounds ** into noise." :group 'gnus-visual) -(defcustom earcon-auto-play nil - "*When True, automatically play sounds as well as buttonize them." - :type 'boolean - :group 'earcon) - (defcustom earcon-prefix "**" "*String denoting the start of an earcon." :type 'string @@ -54,7 +49,7 @@ ("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") @@ -74,8 +69,6 @@ (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. @@ -84,7 +77,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)))) @@ -156,11 +149,9 @@ If N is negative, move backward instead." (setq entry nil))) entry)) - (defun earcon-button-push (marker) ;; Push button starting at MARKER. - (save-excursion - (set-buffer gnus-article-buffer) + (with-current-buffer gnus-article-buffer (goto-char marker) (let* ((entry (earcon-button-entry)) (inhibit-point-motion-hooks t) @@ -222,8 +213,7 @@ If N is negative, move backward instead." (defun gnus-earcon-display () "Play sounds in message buffers." (interactive) - (save-excursion - (set-buffer gnus-article-buffer) + (with-current-buffer gnus-article-buffer (goto-char (point-min)) ;; Skip headers (unless (search-forward "\n\n" nil t)