annotate lisp/mail/emacsbug.el @ 112291:d10e4c917525

* fileio.c (make_temp_name): Remove unreachable code.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 16 Jan 2011 23:07:30 -0800
parents 417b1e4d63cd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37671
diff changeset
1 ;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
2
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104022
diff changeset
3 ;; Copyright (C) 1985, 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 110988
diff changeset
4 ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
106802
b92c3979701c Replace emacs-pretest-bug with bug-gnu-emacs mailing list.
Glenn Morris <rgm@gnu.org>
parents: 106570
diff changeset
5 ;; Free Software Foundation, Inc.
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 794
diff changeset
7 ;; Author: K. Shane Hartman
794
2598c08c91c2 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
8 ;; Maintainer: FSF
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
9 ;; Keywords: maint mail
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 109814
diff changeset
10 ;; Package: emacs
794
2598c08c91c2 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
11
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
13
94674
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
94674
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
16 ;; the Free Software Foundation, either version 3 of the License, or
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
17 ;; (at your option) any later version.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
18
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
22 ;; GNU General Public License for more details.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
23
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
94674
ef65fa4dca3b Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92291
diff changeset
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
26
2307
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2247
diff changeset
27 ;;; Commentary:
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2247
diff changeset
28
46564
293b682578b5 Update copyright notice and fix typo in commentary section.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45381
diff changeset
29 ;; `M-x report-emacs-bug' starts an email note to the Emacs maintainers
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
30 ;; describing a problem. You need to be able to send mail from Emacs
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
31 ;; to complete the process. Alternatively, compose the bug report in
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
32 ;; Emacs then paste it into your normal mail client.
2307
10e417efb12a Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2247
diff changeset
33
794
2598c08c91c2 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 662
diff changeset
34 ;;; Code:
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
35
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
36 (defgroup emacsbug nil
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
37 "Sending Emacs bug reports."
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
38 :group 'maint
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
39 :group 'mail)
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
40
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
41 (define-obsolete-variable-alias 'report-emacs-bug-pretest-address
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
42 'report-emacs-bug-address "24.1")
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
43
21360
238c1cd70a27 (report-emacs-bug-hook): Use skip-chars-forward
Richard M. Stallman <rms@gnu.org>
parents: 21353
diff changeset
44 (defcustom report-emacs-bug-address "bug-gnu-emacs@gnu.org"
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
45 "Address of mailing list for GNU Emacs bugs."
20797
5941b5298627 (report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents: 20774
diff changeset
46 :group 'emacsbug
5941b5298627 (report-emacs-bug-address):
Richard M. Stallman <rms@gnu.org>
parents: 20774
diff changeset
47 :type 'string)
14815
4a742f2d5328 (report-emacs-bug): Use a different address for pretest versions.
Richard M. Stallman <rms@gnu.org>
parents: 14280
diff changeset
48
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
49 (defcustom report-emacs-bug-no-confirmation nil
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
50 "If non-nil, suppress the confirmations asked for the sake of novice users."
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
51 :group 'emacsbug
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
52 :type 'boolean)
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
53
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
54 (defcustom report-emacs-bug-no-explanations nil
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
55 "If non-nil, suppress the explanations given for the sake of novice users."
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
56 :group 'emacsbug
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
57 :type 'boolean)
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
58
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
59 ;; User options end here.
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
60
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
61 (defvar report-emacs-bug-tracker-url "http://debbugs.gnu.org/cgi/"
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
62 "Base URL of the GNU bugtracker.
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
63 Used for querying duplicates and linking to existing bugs.")
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
64
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
65 (defvar report-emacs-bug-orig-text nil
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
66 "The automatically-created initial text of the bug report.")
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
67
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
68 (defvar report-emacs-bug-send-command nil
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
69 "Name of the command to send the bug report, as a string.")
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
70 (make-variable-buffer-local 'report-emacs-bug-send-command)
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
71
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
72 (defvar report-emacs-bug-send-hook nil
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
73 "Hook run before sending the bug report.")
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
74 (make-variable-buffer-local 'report-emacs-bug-send-hook)
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
75
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94674
diff changeset
76 (declare-function x-server-vendor "xfns.c" (&optional terminal))
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94674
diff changeset
77 (declare-function x-server-version "xfns.c" (&optional terminal))
106566
18ebc6fe2cc9 (message-sort-headers): Define for compiler.
Glenn Morris <rgm@gnu.org>
parents: 106563
diff changeset
78 (declare-function message-sort-headers "message" ())
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
79 (defvar message-strip-special-text-properties)
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94674
diff changeset
80
109814
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
81 (defun report-emacs-bug-can-use-xdg-email ()
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
82 "Check if xdg-email can be used, i.e. we are on Gnome, KDE or xfce4."
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
83 (and (getenv "DISPLAY")
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
84 (executable-find "xdg-email")
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
85 (or (getenv "GNOME_DESKTOP_SESSION_ID")
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
86 ;; GNOME_DESKTOP_SESSION_ID is deprecated, check on Dbus also.
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
87 (condition-case nil
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
88 (eq 0 (call-process
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
89 "dbus-send" nil nil nil
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
90 "--dest=org.gnome.SessionManager"
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
91 "--print-reply"
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
92 "/org/gnome/SessionManager"
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
93 "org.gnome.SessionManager.CanShutdown"))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
94 (error nil))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
95 (equal (getenv "KDE_FULL_SESSION") "true")
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
96 (condition-case nil
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
97 (eq 0 (call-process
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
98 "/bin/sh" nil nil nil
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
99 "-c"
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
100 "xprop -root _DT_SAVE_MODE|grep xfce4"))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
101 (error nil)))))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
102
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
103 (defun report-emacs-bug-insert-to-mailer ()
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
104 (interactive)
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
105 (save-excursion
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
106 (let* ((to (progn
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
107 (goto-char (point-min))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
108 (forward-line)
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
109 (and (looking-at "^To: \\(.*\\)")
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
110 (match-string-no-properties 1))))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
111 (subject (progn
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
112 (forward-line)
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
113 (and (looking-at "^Subject: \\(.*\\)")
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
114 (match-string-no-properties 1))))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
115 (body (progn
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
116 (forward-line 2)
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
117 (if (> (point-max) (point))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
118 (buffer-substring-no-properties (point) (point-max))))))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
119 (if (and to subject body)
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
120 (start-process "xdg-email" nil "xdg-email"
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
121 "--subject" subject
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
122 "--body" body
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
123 (concat "mailto:" to))
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
124 (error "Subject, To or body not found")))))
95841
b4e36ff621b3 Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents: 94674
diff changeset
125
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
126 ;;;###autoload
16576
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
127 (defun report-emacs-bug (topic &optional recent-keys)
474
c3bbd755b7da *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 201
diff changeset
128 "Report a bug in GNU Emacs.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
129 Prompts for bug subject. Leaves you in a mail buffer."
16576
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
130 ;; This strange form ensures that (recent-keys) is the value before
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
131 ;; the bug subject string is read.
a04c1653a37c (report-emacs-bug): Reorder arguments.
Erik Naggum <erik@naggum.no>
parents: 16572
diff changeset
132 (interactive (reverse (list (recent-keys) (read-string "Bug Subject: "))))
82382
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
133 ;; The syntax `version;' is preferred to `[version]' because the
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
134 ;; latter could be mistakenly stripped by mailing software.
82434
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
135 (if (eq system-type 'ms-dos)
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
136 (setq topic (concat emacs-version "; " topic))
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
137 (when (string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
e460d01bb038 (report-emacs-bug): Make MS-DOS a special case (there's no build number).
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 82429
diff changeset
138 (setq topic (concat (match-string 1 emacs-version) "; " topic))))
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
139 (let ((from-buffer (current-buffer))
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
140 ;; Put these properties on semantically-void text.
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
141 ;; report-emacs-bug-hook deletes these regions before sending.
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
142 (prompt-properties '(field emacsbug-prompt
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
143 intangible but-helpful
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
144 rear-nonsticky t))
109814
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
145 (can-xdg-email (report-emacs-bug-can-use-xdg-email))
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
146 user-point message-end-point)
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
147 (setq message-end-point
39067
781a740a46a0 (report-emacs-bug): Make sure *Messages*
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
148 (with-current-buffer (get-buffer-create "*Messages*")
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
149 (point-max-marker)))
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
150 (compose-mail report-emacs-bug-address topic)
106563
b07b0e49769d (report-emacs-bug): In message-mode, sort manually before storing
Glenn Morris <rgm@gnu.org>
parents: 106530
diff changeset
151 ;; The rest of this does not execute if the user was asked to
b07b0e49769d (report-emacs-bug): In message-mode, sort manually before storing
Glenn Morris <rgm@gnu.org>
parents: 106530
diff changeset
152 ;; confirm and said no.
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
153 (when (eq major-mode 'message-mode)
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
154 ;; Message-mode sorts the headers before sending. We sort now so
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
155 ;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
156 (message-sort-headers)
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
157 ;; Stop message-mode stealing the properties we will add.
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
158 (set (make-local-variable 'message-strip-special-text-properties) nil))
21869
0f8ca1599a5a (report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents: 21498
diff changeset
159 (rfc822-goto-eoh)
0f8ca1599a5a (report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents: 21498
diff changeset
160 (forward-line 1)
0f8ca1599a5a (report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents: 21498
diff changeset
161 (let ((signature (buffer-substring (point) (point-max))))
0f8ca1599a5a (report-emacs-bug): Use rfc822-goto-eoh.
Richard M. Stallman <rms@gnu.org>
parents: 21498
diff changeset
162 (delete-region (point) (point-max))
21974
42b308d86213 (report-emacs-bug): After reinserting
Richard M. Stallman <rms@gnu.org>
parents: 21869
diff changeset
163 (insert signature)
42b308d86213 (report-emacs-bug): After reinserting
Richard M. Stallman <rms@gnu.org>
parents: 21869
diff changeset
164 (backward-char (length signature)))
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
165 (unless report-emacs-bug-no-explanations
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
166 ;; Insert warnings for novice users.
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
167 (when (string-match "@gnu\\.org$" report-emacs-bug-address)
68075
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
168 (insert "This bug report will be sent to the Free Software Foundation,\n")
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
169 (let ((pos (point)))
d16e53a3e227 (report-emacs-bug): Let explanations correctly reflect the address to which
Eli Zaretskii <eliz@gnu.org>
parents: 64754
diff changeset
170 (insert "not to your local site managers!")
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
171 (overlay-put (make-overlay pos (point)) 'face 'highlight)))
82382
5d46134ea7dd (report-emacs-bug): Put `Bug: emacs-version; ' in the mail title.
Michaël Cadilhac <michael.cadilhac@lrde.org>
parents: 78232
diff changeset
172 (insert "\nPlease write in ")
20774
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
173 (let ((pos (point)))
d56dca77717a (emacsbug): Customized.
Richard M. Stallman <rms@gnu.org>
parents: 20052
diff changeset
174 (insert "English")
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
175 (overlay-put (make-overlay pos (point)) 'face 'highlight))
45273
b9f48b248687 (report-emacs-bug): Change the "English please" msg.
Richard M. Stallman <rms@gnu.org>
parents: 45027
diff changeset
176 (insert " if possible, because the Emacs maintainers
b9f48b248687 (report-emacs-bug): Change the "English please" msg.
Richard M. Stallman <rms@gnu.org>
parents: 45027
diff changeset
177 usually do not have translators to read other languages for them.\n\n")
110988
3c6608402b1e * lisp/mail/emacsbug.el (report-emacs-bug): Mention debbugs.gnu.org.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
178 (insert (format "Your report will be posted to the %s mailing list"
107412
dcd02d810e03 Minor simplifications for emacsbug.el.
Glenn Morris <rgm@gnu.org>
parents: 106802
diff changeset
179 report-emacs-bug-address))
110997
b8fde5ef9e14 Merge changes from emacs-23 branch.
Juanma Barranquero <lekktu@gmail.com>
parents: 110015 110988
diff changeset
180 (insert "\nand the gnu.emacs.bug news group, and at http://debbugs.gnu.org.\n\n"))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
181
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
182 (insert "Please describe exactly what actions triggered the bug\n"
105808
548e316508c5 Remove odd/obsolete header comment.
Glenn Morris <rgm@gnu.org>
parents: 105757
diff changeset
183 "and the precise symptoms of the bug. If you can, give\n"
548e316508c5 Remove odd/obsolete header comment.
Glenn Morris <rgm@gnu.org>
parents: 105757
diff changeset
184 "a recipe starting from `emacs -Q':\n\n")
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
185 (add-text-properties (save-excursion
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
186 (rfc822-goto-eoh)
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
187 (line-beginning-position 2))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
188 (point)
68115
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
189 prompt-properties)
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
190 (setq user-point (point))
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
191 (insert "\n\n")
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
192
73738
266042c9bbc6 (report-emacs-bug): Fix typos in output message.
Juanma Barranquero <lekktu@gmail.com>
parents: 68648
diff changeset
193 (insert "If Emacs crashed, and you have the Emacs process in the gdb debugger,\n"
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
194 "please include the output from the following gdb commands:\n"
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
195 " `bt full' and `xbacktrace'.\n")
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
196
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
197 (let ((debug-file (expand-file-name "DEBUG" data-directory)))
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
198 (if (file-readable-p debug-file)
105723
438abba8b301 * mail/emacsbug.el (report-emacs-bug): Tweak the sentence pointing
Chong Yidong <cyd@stupidchicken.com>
parents: 105531
diff changeset
199 (insert "For information about debugging Emacs, please read the file\n"
438abba8b301 * mail/emacsbug.el (report-emacs-bug): Tweak the sentence pointing
Chong Yidong <cyd@stupidchicken.com>
parents: 105531
diff changeset
200 debug-file ".\n")))
68115
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
201 (add-text-properties (1+ user-point) (point) prompt-properties)
64555
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
202
8a35276b0990 (report-emacs-bug): Request that backtraces are
Kim F. Storm <storm@cua.dk>
parents: 64085
diff changeset
203 (insert "\n\nIn " (emacs-version) "\n")
57768
84cd4892a56e * mail/emacsbug.el (report-emacs-bug): Insert x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 52757
diff changeset
204 (if (fboundp 'x-server-vendor)
58462
8d3f889b4462 * mail/emacsbug.el (report-emacs-bug): Catch error that x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 57768
diff changeset
205 (condition-case nil
76450
a3474cbaf397 (report-emacs-bug): Don't hard code the "X" name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
206 ;; This is used not only for X11 but also W32 and others.
a3474cbaf397 (report-emacs-bug): Don't hard code the "X" name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
207 (insert "Windowing system distributor `" (x-server-vendor)
a3474cbaf397 (report-emacs-bug): Don't hard code the "X" name.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
208 "', version "
58462
8d3f889b4462 * mail/emacsbug.el (report-emacs-bug): Catch error that x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 57768
diff changeset
209 (mapconcat 'number-to-string (x-server-version) ".") "\n")
8d3f889b4462 * mail/emacsbug.el (report-emacs-bug): Catch error that x-server-vendor
Jan Djärv <jan.h.d@swipnet.se>
parents: 57768
diff changeset
210 (error t)))
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
211 (if (and system-configuration-options
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
212 (not (equal system-configuration-options "")))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
213 (insert "configured using `configure "
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
214 system-configuration-options "'\n\n"))
35427
21fa311a0352 (report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents: 33153
diff changeset
215 (insert "Important settings:\n")
84912
417443aefcdd (report-emacs-bug): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 82434
diff changeset
216 (mapc
37065
9a4674999109 (report-emacs-bug): Report LC_COLLATE,
Eli Zaretskii <eliz@gnu.org>
parents: 35516
diff changeset
217 '(lambda (var)
9a4674999109 (report-emacs-bug): Report LC_COLLATE,
Eli Zaretskii <eliz@gnu.org>
parents: 35516
diff changeset
218 (insert (format " value of $%s: %s\n" var (getenv var))))
9a4674999109 (report-emacs-bug): Report LC_COLLATE,
Eli Zaretskii <eliz@gnu.org>
parents: 35516
diff changeset
219 '("LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES"
90701
ca120caa5838 (report-emacs-bug): Insert also the value of
Kenichi Handa <handa@m17n.org>
parents: 90650
diff changeset
220 "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG" "XMODIFIERS"))
35427
21fa311a0352 (report-emacs-bug): Report values of
Eli Zaretskii <eliz@gnu.org>
parents: 33153
diff changeset
221 (insert (format " locale-coding-system: %s\n" locale-coding-system))
104823
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104022
diff changeset
222 (insert (format " default enable-multibyte-characters: %s\n"
68150c643e2e Use default-value rather than default-enable-multibyte-characters.
Glenn Morris <rgm@gnu.org>
parents: 104022
diff changeset
223 (default-value 'enable-multibyte-characters)))
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
224 (insert "\n")
52757
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
225 (insert (format "Major mode: %s\n"
87567
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87120
diff changeset
226 (format-mode-line
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87120
diff changeset
227 (buffer-local-value 'mode-name from-buffer)
4c3c683cdff8 * erc-ibuffer.el (erc-channel-modes):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87120
diff changeset
228 nil nil from-buffer)))
52686
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
229 (insert "\n")
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
230 (insert "Minor modes in effect:\n")
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
231 (dolist (mode minor-mode-list)
52757
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
232 (and (boundp mode) (buffer-local-value mode from-buffer)
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
233 (insert (format " %s: %s\n" mode
c546768fdb22 (report-emacs-bug): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 52686
diff changeset
234 (buffer-local-value mode from-buffer)))))
52686
ef1f49172c0b (report-emacs-bug): Mention major and minor modes.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
235 (insert "\n")
45346
abf76eedb517 (report-emacs-bug-text-prompt): New variable.
Markus Rost <rost@math.uni-bielefeld.de>
parents: 45273
diff changeset
236 (insert "Recent input:\n")
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
237 (let ((before-keys (point)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
238 (insert (mapconcat (lambda (key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
239 (if (or (integerp key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
240 (symbolp key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
241 (listp key))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
242 (single-key-description key)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
243 (prin1-to-string key nil)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
244 (or recent-keys (recent-keys))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
245 " "))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
246 (save-restriction
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
247 (narrow-to-region before-keys (point))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
248 (goto-char before-keys)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
249 (while (progn (move-to-column 50) (not (eobp)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
250 (search-forward " " nil t)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
251 (insert "\n"))))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
252 (let ((message-buf (get-buffer "*Messages*")))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
253 (if message-buf
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
254 (let (beg-pos
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
255 (end-pos message-end-point))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
256 (with-current-buffer message-buf
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
257 (goto-char end-pos)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
258 (forward-line -10)
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
259 (setq beg-pos (point)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
260 (insert "\n\nRecent messages:\n")
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
261 (insert-buffer-substring message-buf beg-pos end-pos))))
104022
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
262 ;; After Recent messages, to avoid the messages produced by
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
263 ;; list-load-path-shadows.
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
264 (unless (looking-back "\n")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
265 (insert "\n"))
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
266 (insert "\n")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
267 (insert "Load-path shadows:\n")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
268 (message "Checking for load-path shadows...")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
269 (let ((shadows (list-load-path-shadows t)))
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
270 (message "Checking for load-path shadows...done")
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
271 (insert (if (zerop (length shadows))
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
272 "None found.\n"
27b0fc89d852 (report-emacs-bug): Include any load-path shadows.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
273 shadows)))
105531
ac0c30ffce5c (report-emacs-bug): Also print `features'.
Glenn Morris <rgm@gnu.org>
parents: 104823
diff changeset
274 (insert (format "\nFeatures:\n%s\n" features))
ac0c30ffce5c (report-emacs-bug): Also print `features'.
Glenn Morris <rgm@gnu.org>
parents: 104823
diff changeset
275 (fill-region (line-beginning-position 0) (point))
ac0c30ffce5c (report-emacs-bug): Also print `features'.
Glenn Morris <rgm@gnu.org>
parents: 104823
diff changeset
276 ;; This is so the user has to type something in order to send easily.
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
277 (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
278 (define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info)
109814
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
279 (if can-xdg-email
110015
280c8ae2476d Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents: 109814
diff changeset
280 (define-key (current-local-map) "\C-cm"
109814
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
281 'report-emacs-bug-insert-to-mailer))
111865
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
282 (setq report-emacs-bug-send-command (get mail-user-agent 'sendfunc)
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
283 report-emacs-bug-send-hook (get mail-user-agent 'hookvar))
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
284 (if report-emacs-bug-send-command
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
285 (setq report-emacs-bug-send-command
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
286 (symbol-name report-emacs-bug-send-command)))
21975
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
287 (unless report-emacs-bug-no-explanations
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
288 (with-output-to-temp-buffer "*Bug Help*"
105757
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
289 (princ "While in the mail buffer:\n\n")
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
290 (if report-emacs-bug-send-command
106516
16c633230547 (report-emacs-bug): Use whichever send command is appropriate for the
Glenn Morris <rgm@gnu.org>
parents: 105808
diff changeset
291 (princ (substitute-command-keys
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
292 (format " Type \\[%s] to send the bug report.\n"
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
293 report-emacs-bug-send-command))))
21975
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
294 (princ (substitute-command-keys
105757
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
295 " Type \\[kill-buffer] RET to cancel (don't send it).\n"))
109814
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
296 (if can-xdg-email
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
297 (princ (substitute-command-keys
ea341a06439f Add command C-c m in report-emacs-bug that puts the bug into preferred mailer.
Jan D. <jan.h.d@swipnet.se>
parents: 107412
diff changeset
298 " Type \\[report-emacs-bug-insert-to-mailer] to insert text to you preferred mail program.\n")))
21975
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
299 (terpri)
386e14726b59 (report-emacs-bug): Don't display *Bug Help* if
Richard M. Stallman <rms@gnu.org>
parents: 21974
diff changeset
300 (princ (substitute-command-keys
105757
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
301 " Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
302 about when and how to write a bug report, and what
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
303 information you should include to help fix the bug.")))
56b02500dbd1 * mail/emacsbug.el (report-emacs-bug): Clarify that the
Chong Yidong <cyd@stupidchicken.com>
parents: 105723
diff changeset
304 (shrink-window-if-larger-than-buffer (get-buffer-window "*Bug Help*")))
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
305 ;; Make it less likely people will send empty messages.
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
306 (if report-emacs-bug-send-hook
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
307 (add-hook report-emacs-bug-send-hook 'report-emacs-bug-hook nil t))
106563
b07b0e49769d (report-emacs-bug): In message-mode, sort manually before storing
Glenn Morris <rgm@gnu.org>
parents: 106530
diff changeset
308 (goto-char (point-max))
b07b0e49769d (report-emacs-bug): In message-mode, sort manually before storing
Glenn Morris <rgm@gnu.org>
parents: 106530
diff changeset
309 (skip-chars-backward " \t\n")
b07b0e49769d (report-emacs-bug): In message-mode, sort manually before storing
Glenn Morris <rgm@gnu.org>
parents: 106530
diff changeset
310 (make-local-variable 'report-emacs-bug-orig-text)
b07b0e49769d (report-emacs-bug): In message-mode, sort manually before storing
Glenn Morris <rgm@gnu.org>
parents: 106530
diff changeset
311 (setq report-emacs-bug-orig-text
b07b0e49769d (report-emacs-bug): In message-mode, sort manually before storing
Glenn Morris <rgm@gnu.org>
parents: 106530
diff changeset
312 (buffer-substring-no-properties (point-min) (point)))
20052
38942e2dfffa (report-emacs-bug): Delete the condition-case.
Karl Heuer <kwzh@gnu.org>
parents: 18827
diff changeset
313 (goto-char user-point)))
8130
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
314
12155
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
315 (defun report-emacs-bug-info ()
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
316 "Go to the Info node on reporting Emacs bugs."
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
317 (interactive)
92291
d2de7d81aab9 Update commentary.
Glenn Morris <rgm@gnu.org>
parents: 91327
diff changeset
318 (info "(emacs)Bugs"))
12155
63887def546f (report-emacs-bug-info): New command.
Karl Heuer <kwzh@gnu.org>
parents: 8921
diff changeset
319
8130
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
320 (defun report-emacs-bug-hook ()
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
321 "Do some checking before sending a bug report."
8130
c84ecb24316c (report-emacs-bug-hook): Error if user has added no text.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
322 (save-excursion
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
323 (goto-char (point-max))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
324 (skip-chars-backward " \t\n")
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
325 (and (= (- (point) (point-min))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
326 (length report-emacs-bug-orig-text))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
327 (string-equal (buffer-substring-no-properties (point-min) (point))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
328 report-emacs-bug-orig-text)
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
329 (error "No text entered in bug report"))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
330 ;; Check the buffer contents and reject non-English letters.
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
331 ;; FIXME message-mode probably does this anyway.
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
332 (goto-char (point-min))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
333 (skip-chars-forward "\0-\177")
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
334 (unless (eobp)
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
335 (if (or report-emacs-bug-no-confirmation
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
336 (y-or-n-p "Convert non-ASCII letters to hexadecimal? "))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
337 (while (progn (skip-chars-forward "\0-\177")
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
338 (not (eobp)))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
339 (let ((ch (following-char)))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
340 (delete-char 1)
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
341 (insert (format "=%02x" ch))))))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
342
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
343 ;; The last warning for novice users.
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
344 (unless (or report-emacs-bug-no-confirmation
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
345 (yes-or-no-p
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
346 "Send this bug report to the Emacs maintainers? "))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
347 (goto-char (point-min))
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
348 (if (search-forward "To: ")
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
349 (delete-region (point) (line-end-position)))
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
350 (if report-emacs-bug-send-hook
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
351 (kill-local-variable report-emacs-bug-send-hook))
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
352 (with-output-to-temp-buffer "*Bug Help*"
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
353 (princ (substitute-command-keys
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
354 (format "\
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
355 You invoked the command M-x report-emacs-bug,
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
356 but you decided not to mail the bug report to the Emacs maintainers.
18795
3446ea06d63f (report-emacs-bug-run-tersely): New variable
Kenichi Handa <handa@m17n.org>
parents: 18608
diff changeset
357
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
358 If you want to mail it to someone else instead,
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
359 please insert the proper e-mail address after \"To: \",
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
360 and send the mail again%s."
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
361 (if report-emacs-bug-send-command
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
362 (format " using \\[%s]"
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
363 report-emacs-bug-send-command)
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
364 "")))))
18826
cb22b83e1bf8 Improve text of messages.
Richard M. Stallman <rms@gnu.org>
parents: 18795
diff changeset
365 (error "M-x report-emacs-bug was cancelled, please read *Bug Help* buffer"))
44056
448873845bcc (report-emacs-bug-hook): Remove submitter
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 39067
diff changeset
366
106530
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
367 ;; Delete the uninteresting text that was just to help fill out the report.
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
368 (rfc822-goto-eoh)
e5b7752075ef No longer require sendmail.
Glenn Morris <rgm@gnu.org>
parents: 106516
diff changeset
369 (forward-line 1)
68115
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
370 (let ((pos (1- (point))))
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
371 (while (setq pos (text-property-any pos (point-max)
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
372 'field 'emacsbug-prompt))
09374864b194 (report-emacs-bug-text-prompt): Delete var.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68075
diff changeset
373 (delete-region pos (field-end (1+ pos)))))))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
374
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
375
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
376 ;; Querying the bug database
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
377
111865
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
378 (defvar report-emacs-bug-bug-alist nil)
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
379 (make-variable-buffer-local 'report-emacs-bug-bug-alist)
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
380 (defvar report-emacs-bug-choice-widget nil)
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
381 (make-variable-buffer-local 'report-emacs-bug-choice-widget)
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
382
111653
ee9c4ac3bff4 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs)
Tassilo Horn <tassilo@member.fsf.org>
parents: 111641
diff changeset
383 (defun report-emacs-bug-create-existing-bugs-buffer (bugs keywords)
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
384 (switch-to-buffer (get-buffer-create "*Existing Emacs Bugs*"))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
385 (setq buffer-read-only t)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
386 (let ((inhibit-read-only t))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
387 (erase-buffer)
111865
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
388 (setq report-emacs-bug-bug-alist bugs)
111653
ee9c4ac3bff4 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs)
Tassilo Horn <tassilo@member.fsf.org>
parents: 111641
diff changeset
389 (widget-insert (propertize (concat "Already known bugs ("
ee9c4ac3bff4 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs)
Tassilo Horn <tassilo@member.fsf.org>
parents: 111641
diff changeset
390 keywords "):\n\n")
ee9c4ac3bff4 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs)
Tassilo Horn <tassilo@member.fsf.org>
parents: 111641
diff changeset
391 'face 'bold))
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
392 (if bugs
111865
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
393 (setq report-emacs-bug-choice-widget
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
394 (apply 'widget-create 'radio-button-choice
111738
afde28b09d79 Fix emacsbug.el errors clearly flagged by the byte-compiler.
Glenn Morris <rgm@gnu.org>
parents: 111681
diff changeset
395 :value (caar bugs)
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
396 (let (items)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
397 (dolist (bug bugs)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
398 (push (list
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
399 'url-link
111798
636a2b5cff1d emacsbug.el trivia.
Glenn Morris <rgm@gnu.org>
parents: 111738
diff changeset
400 :format (concat "Bug#" (number-to-string (nth 2 bug))
111738
afde28b09d79 Fix emacsbug.el errors clearly flagged by the byte-compiler.
Glenn Morris <rgm@gnu.org>
parents: 111681
diff changeset
401 ": " (cadr bug) "\n %[%v%]\n")
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
402 ;; FIXME: Why is only the link of the
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
403 ;; active item clickable?
111798
636a2b5cff1d emacsbug.el trivia.
Glenn Morris <rgm@gnu.org>
parents: 111738
diff changeset
404 (car bug))
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
405 items))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
406 (nreverse items))))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
407 (widget-insert "No bugs maching your keywords found.\n"))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
408 (widget-insert "\n")
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
409 (widget-create 'push-button
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
410 :notify (lambda (&rest ignore)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
411 ;; TODO: Do something!
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
412 (message "Reporting new bug!"))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
413 "Report new bug")
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
414 (when bugs
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
415 (widget-insert " ")
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
416 (widget-create 'push-button
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
417 :notify (lambda (&rest ignore)
111865
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
418 (let ((val (widget-value report-emacs-bug-choice-widget)))
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
419 ;; TODO: Do something!
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
420 (message "Appending to bug %s!"
111865
d490c191c26c Small emacsbug.el stuff.
Glenn Morris <rgm@gnu.org>
parents: 111849
diff changeset
421 (nth 2 (assoc val report-emacs-bug-bug-alist)))))
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
422 "Append to chosen bug"))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
423 (widget-insert " ")
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
424 (widget-create 'push-button
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
425 :notify (lambda (&rest ignore)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
426 (kill-buffer))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
427 "Quit reporting bug")
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
428 (widget-insert "\n"))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
429 (use-local-map widget-keymap)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
430 (widget-setup)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
431 (goto-char (point-min)))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
432
111653
ee9c4ac3bff4 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs)
Tassilo Horn <tassilo@member.fsf.org>
parents: 111641
diff changeset
433 (defun report-emacs-bug-parse-query-results (status keywords)
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
434 (goto-char (point-min))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
435 (let (buglist)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
436 (while (re-search-forward "<a href=\"bugreport\\.cgi\\?bug=\\([[:digit:]]+\\)\">\\([^<]+\\)</a>" nil t)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
437 (let ((number (match-string 1))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
438 (subject (match-string 2)))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
439 (when (not (string-match "^#" subject))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
440 (push (list
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
441 ;; first the bug URL
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
442 (concat report-emacs-bug-tracker-url
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
443 "bugreport.cgi?bug=" number)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
444 ;; then the subject and number
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
445 subject (string-to-number number))
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
446 buglist))))
111653
ee9c4ac3bff4 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs)
Tassilo Horn <tassilo@member.fsf.org>
parents: 111641
diff changeset
447 (report-emacs-bug-create-existing-bugs-buffer (nreverse buglist) keywords)))
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
448
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
449 (defun report-emacs-bug-query-existing-bugs (keywords)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
450 "Query for KEYWORDS at `report-emacs-bug-tracker-url', and return the result.
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
451 The result is an alist with items of the form (URL SUBJECT NO)."
111681
1a0c949aa8d5 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Mention
Tassilo Horn <tassilo@member.fsf.org>
parents: 111653
diff changeset
452 (interactive "sBug keywords (comma separated): ")
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
453 (url-retrieve (concat report-emacs-bug-tracker-url
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
454 "pkgreport.cgi?include=subject%3A"
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
455 (replace-regexp-in-string "[[:space:]]+" "+" keywords)
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
456 ";package=emacs")
111653
ee9c4ac3bff4 * mail/emacsbug.el (report-emacs-bug-query-existing-bugs)
Tassilo Horn <tassilo@member.fsf.org>
parents: 111641
diff changeset
457 'report-emacs-bug-parse-query-results (list keywords)))
111641
224cc868d181 * mail/emacsbug.el (report-emacs-bug-tracker-url)
Tassilo Horn <tassilo@member.fsf.org>
parents: 110997
diff changeset
458
2348
581cda633215 Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2307
diff changeset
459 (provide 'emacsbug)
581cda633215 Added a (provide 'emacsbug); lisp-mnt.el needs this.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2307
diff changeset
460
662
8a533acedb77 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 474
diff changeset
461 ;;; emacsbug.el ends here