;;; emms-report.el --- Report bugs in EMMS ;; Copyright (C) 2005 Yoni Rabkin ;; Author: Yoni Rabkin ;; This file 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. ;; ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; 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. ;;; Commentary: ;;; This is supposed to help people create nice bug reports so that ;;; the EMMS developers have an easier time making EMMS better. ;;; History: ;; ;;; Code: (defconst emms-report-buffer-name "*emms-report*" "Name of the buffer 'emms-report' will create when run.") (defconst emms-report-header-str "This bug report is for the EMMS maintainers. Please write in English if possible, because the EMMS maintainers usually do not have translators to read other languages for them. Please describe exactly what actions triggered the bug and the precise symptoms of the bug:" "Default header string for an EMMS bug report generated by 'emms-report'.") ;; EMMS developer! If you have a variable which you want included in ;; the output of 'emms-report' add that variable to this list. Note: ;; Unlike with the feature list, we will not dynamically list all the ;; variables in EMMS but only those deemed interesting. (defconst emms-report-interesting-var-list (list ;; vars from emms.el 'emms-source-list 'emms-player-list 'emms-show-format 'emms-track-description-function 'emms-playlist-changed-hook 'emms-track-initialize-functions 'emms-player-started-hook 'emms-player-stopped-hook 'emms-player-finished-hook 'emms-playlist-current)) (defun emms-report-dir () "Generate a list of files in the current directory which start with 'emms-'." (file-name-all-completions"emms-" default-directory)) ;; This uses the file name to load the feature name. File which ;; provide features but do not follow the Emacs naming conventions ;; will be eternally marked as unloaded features by this function. (defun emms-report-feature-list () "Return a list of features and if they are loaded." (mapcar (lambda (e) (cons e (if (featurep (intern (file-name-sans-extension (file-name-nondirectory e)))) "loaded" "not loaded"))) (emms-report-dir))) ;; Single entry point (defun emms-report (&optional buffername) "Generate a template bug report for EMMS. If BUFFERNAME is non-nil, output the report to that buffer." (interactive) (let ((buff (if (stringp buffername) buffername emms-report-buffer-name))) (switch-to-buffer buff) (goto-char 1) (insert emms-report-header-str) (newline 4) (insert "The rest is automatically generated, no need to edit below this line.") (newline 2) (insert "EMMS features (provided by the following files)") (newline) (insert "-----------------------------------------------") (newline) (mapc (lambda (e) (insert (format "%s is %s" (car e) (cdr e))) (newline)) (emms-report-feature-list)) (newline) (insert "Interesting EMMS variables") (newline) (insert "--------------------------") (newline) (mapc (lambda (e) (when (boundp e) (insert (format "%s: %s" (symbol-name e) (symbol-value e))) (newline))) emms-report-interesting-var-list))) (provide 'emms-report) ;;; emms-report.el ends here