]> code.delx.au - gnu-emacs-elpa/blob - packages/debbugs/debbugs-gnu.el
4c108cc46a6ab35d465b1ab007c6043f14bea53c
[gnu-emacs-elpa] / packages / debbugs / debbugs-gnu.el
1 ;;; debbugs-gnu.el --- interface for the GNU bug tracker -*- lexical-binding:t -*-
2
3 ;; Copyright (C) 2011-2016 Free Software Foundation, Inc.
4
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Michael Albinus <michael.albinus@gmx.org>
7 ;; Keywords: comm, hypermedia, maint
8 ;; Package: debbugs
9
10 ;; This file is not part of GNU Emacs.
11
12 ;; This program is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
16
17 ;; This program is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25 ;;; Commentary:
26
27 ;; This package provides an interface to bug reports which are located
28 ;; on the GNU bug tracker debbugs.gnu.org. Its main purpose is to
29 ;; show and manipulate bug reports from Emacs, but it could be used
30 ;; also for other GNU projects which use the same bug tracker.
31
32 ;; If you have `debbugs-gnu.el' in your load-path, you could enable
33 ;; the bug tracker commands by the following lines in your ~/.emacs
34 ;;
35 ;; (autoload 'debbugs-gnu "debbugs-gnu" "" 'interactive)
36 ;; (autoload 'debbugs-gnu-search "debbugs-gnu" "" 'interactive)
37 ;; (autoload 'debbugs-gnu-usertags "debbugs-gnu" "" 'interactive)
38 ;; (autoload 'debbugs-gnu-bugs "debbugs-gnu" "" 'interactive)
39
40 ;; The bug tracker is called interactively by
41 ;;
42 ;; M-x debbugs-gnu
43
44 ;; It asks for the severities, for which bugs shall be shown. This can
45 ;; be either just one severity, or a list of severities, separated by
46 ;; comma. Valid severities are "serious", "important", "normal",
47 ;; "minor" or "wishlist". Severities "critical" and "grave" are not
48 ;; used, although configured on the GNU bug tracker. If no severity
49 ;; is given, all bugs are selected.
50
51 ;; There is also the pseudo severity "tagged". When it is used, the
52 ;; function will ask for user tags (a comma separated list), and shows
53 ;; just the bugs which are tagged with them. In general, user tags
54 ;; shall be strings denoting to subprojects of the package, like
55 ;; "cedet" or "tramp" of the package "emacs". If no user tag is
56 ;; given, locally tagged bugs are shown.
57
58 ;; If a prefix is given to the command, more search parameters are
59 ;; asked for, like packages (also a comma separated list, "emacs" is
60 ;; the default), whether archived bugs shall be shown, and whether
61 ;; closed bugs shall be suppressed from being retrieved.
62
63 ;; Another command is
64 ;;
65 ;; M-x debbugs-gnu-search
66
67 ;; It behaves like `debbugs-gnu', but asks at the beginning for a
68 ;; search phrase to be used for full text search. Additionally, it
69 ;; asks for key-value pairs to filter bugs. Keys are as described in
70 ;; `debbugs-get-status', the corresponding value must be a regular
71 ;; expression to match for. The other parameters are as described in
72 ;; `debbugs-gnu'. Usually, there is just one value except for the
73 ;; attribute "date", which needs two arguments specifying a period in
74 ;; which the bug has been submitted or modified.
75
76 ;; The bug reports are downloaded from the bug tracker. In order to
77 ;; not generate too much load of the server, up to 500 bugs will be
78 ;; downloaded at once. If there are more hits, several downloads will
79 ;; be performed, until all bugs are retrieved.
80
81 ;; These default values could be changed also by customer options
82 ;; `debbugs-gnu-default-severities', `debbugs-gnu-default-packages'
83 ;; and `debbugs-gnu-default-suppress-bugs'.
84
85 ;; The commands create a page of bug lists. Every bug is shown in one
86 ;; line, including the bug number, the status (combining merged bug
87 ;; numbers, keywords and severities), the name of the submitter, and
88 ;; the title of the bug. On every bug line you could apply the
89 ;; following actions by the following keystrokes:
90
91 ;; RET: Show corresponding messages in Gnus/Rmail
92 ;; "C": Send a control message
93 ;; "t": Mark the bug locally as tagged
94 ;; "b": Show bugs this bug is blocked by
95 ;; "B": Show bugs this bug is blocking
96 ;; "d": Show bug attributes
97
98 ;; Furthermore, you could apply the global actions
99
100 ;; "g": Rescan bugs
101 ;; "q": Quit the buffer
102 ;; "s": Toggle bug sorting for age or for state
103 ;; "x": Toggle suppressing of bugs
104 ;; "/": Display only bugs matching a string
105 ;; "R": Display only bugs blocking the current release
106 ;; "w": Display all the currently selected bug reports
107
108 ;; When you visit the related bug messages in Gnus or Rmail, you could
109 ;; also send control messages by keystroke "C".
110
111 ;; In the header line of every bug list page, you can toggle sorting
112 ;; per column by selecting a column with the mouse. The sorting
113 ;; happens as expected for the respective column; sorting in the Title
114 ;; column is depending on whether you are the owner of a bug.
115
116 ;; Another approach for listing bugs is calling the command
117 ;;
118 ;; M-x debbugs-gnu-usertags
119
120 ;; This command shows you all existing user tags for the packages
121 ;; defined in `debbugs-gnu-default-packages'. A prefix for the
122 ;; command allows you to use other package names, or an arbitrary
123 ;; string for a user who has tagged bugs. The command returns the
124 ;; list of existing user tags for the given user(s) or package
125 ;; name(s), respectively. Applying RET on a user tag, all bugs tagged
126 ;; with this user tag are shown.
127
128 ;; Unfortunately, it is not possible with the SOAP interface to show
129 ;; all users who have tagged bugs. This list can be retrieved via
130 ;; <http://debbugs.gnu.org/cgi/pkgindex.cgi?indexon=users>.
131
132 ;; Finally, if you simply want to list some bugs with known bug
133 ;; numbers, call the command
134 ;;
135 ;; M-x debbugs-gnu-bugs
136
137 ;; The bug numbers to be shown shall be entered as comma separated list.
138
139 ;;; Code:
140
141 (require 'debbugs)
142 (require 'tabulated-list)
143 (require 'add-log)
144 (eval-when-compile (require 'subr-x))
145 (eval-when-compile (require 'cl-lib))
146
147 (autoload 'article-decode-charset "gnus-art")
148 (autoload 'diff-goto-source "diff-mode")
149 (autoload 'diff-hunk-file-names "diff-mode")
150 (autoload 'gnus-article-mime-handles "gnus-art")
151 (autoload 'gnus-fetch-field "gnus-util")
152 (autoload 'gnus-read-ephemeral-emacs-bug-group "gnus-group")
153 (autoload 'gnus-summary-article-header "gnus-sum")
154 (autoload 'gnus-summary-select-article "gnus-sum")
155 (autoload 'gnus-summary-show-article "gnus-sum")
156 (autoload 'gnus-with-article-buffer "gnus-art")
157 (autoload 'log-edit-insert-changelog "log-edit")
158 (autoload 'mail-header-subject "nnheader")
159 (autoload 'message-goto-body "message")
160 (autoload 'message-make-from "message")
161 (autoload 'rmail-get-new-mail "rmail")
162 (autoload 'rmail-show-message "rmail")
163 (autoload 'rmail-summary "rmailsum")
164 (autoload 'vc-dir-hide-up-to-date "vc-dir")
165 (autoload 'vc-dir-mark "vc-dir")
166
167 (defvar compilation-in-progress)
168 (defvar diff-file-header-re)
169 (defvar gnus-article-buffer)
170 (defvar gnus-posting-styles)
171 (defvar gnus-save-duplicate-list)
172 (defvar gnus-suppress-duplicates)
173 (defvar rmail-current-message)
174 (defvar rmail-mode-map)
175 (defvar rmail-summary-mode-map)
176 (defvar rmail-total-messages)
177
178 ;; Buffer-local variables.
179 (defvar debbugs-gnu-local-query)
180 (defvar debbugs-gnu-local-filter)
181 (defvar debbugs-gnu-local-suppress)
182 (defvar debbugs-gnu-sort-state)
183 (defvar debbugs-gnu-limit)
184
185 (defgroup debbugs-gnu ()
186 "UI for the debbugs.gnu.org bug tracker."
187 :group 'debbugs
188 :version "24.1")
189
190 (defvar debbugs-gnu-blocking-report 19759
191 "The ID of the current release report used to track blocking bug reports.")
192
193 (defcustom debbugs-gnu-default-severities '("serious" "important" "normal")
194 "*The list severities bugs are searched for.
195 \"tagged\" is not a severity but marks locally tagged bugs."
196 ;; <http://debbugs.gnu.org/Developer.html#severities>
197 ;; /ssh:debbugs:/etc/debbugs/config @gSeverityList
198 ;; We don't use "critical" and "grave".
199 :group 'debbugs-gnu
200 :type '(set (const "serious")
201 (const "important")
202 (const "normal")
203 (const "minor")
204 (const "wishlist")
205 (const "tagged"))
206 :version "24.1")
207
208 (defcustom debbugs-gnu-suppress-closed t
209 "If non-nil, don't show closed bugs."
210 :group 'debbugs-gnu
211 :type 'boolean
212 :version "25.2")
213
214 (defconst debbugs-gnu-all-severities
215 (mapcar 'cadr (cdr (get 'debbugs-gnu-default-severities 'custom-type)))
216 "*List of all possible severities.")
217
218 (defcustom debbugs-gnu-default-packages '("emacs")
219 "*The list of packages to be searched for."
220 ;; <http://debbugs.gnu.org/Packages.html>
221 ;; <http://debbugs.gnu.org/cgi/pkgindex.cgi>
222 :group 'debbugs-gnu
223 :type '(set (const "adns")
224 (const "auctex")
225 (const "automake")
226 (const "cc-mode")
227 (const "coreutils")
228 (const "cppi")
229 (const "debbugs.gnu.org")
230 (const "diffutils")
231 (const "emacs")
232 (const "emacs-xwidgets")
233 (const "fm")
234 (const "gnus")
235 (const "grep")
236 (const "guile")
237 (const "guix")
238 (const "gzip")
239 (const "idutils")
240 (const "libtool")
241 (const "mh-e")
242 (const "org-mode")
243 (const "parted")
244 (const "sed")
245 (const "vc-dwim")
246 (const "woodchuck"))
247 :version "25.1")
248
249 (defconst debbugs-gnu-all-packages
250 (mapcar 'cadr (cdr (get 'debbugs-gnu-default-packages 'custom-type)))
251 "*List of all possible package names.")
252
253 (defcustom debbugs-gnu-default-suppress-bugs
254 '((pending . "done"))
255 "*A list of specs for bugs to be suppressed.
256 An element of this list is a cons cell \(KEY . REGEXP\), with key
257 being returned by `debbugs-get-status', and REGEXP a regular
258 expression matching the corresponding value, a string. Showing
259 suppressed bugs is toggled by `debbugs-gnu-toggle-suppress'."
260 :group 'debbugs-gnu
261 :type '(alist :key-type symbol :value-type regexp)
262 :version "24.1")
263
264 (defcustom debbugs-gnu-mail-backend 'gnus
265 "*The email backend to use for reading bug report email exchange.
266 If this is 'gnus, the default, use Gnus.
267 If this is 'rmail, use Rmail instead."
268 :group 'debbugs-gnu
269 :type '(choice (const :tag "Use Gnus" 'gnus)
270 (const :tag "Use Rmail" 'rmail))
271 :version "25.1")
272
273 (defface debbugs-gnu-archived '((t (:inverse-video t)))
274 "Face for archived bug reports.")
275
276 (defface debbugs-gnu-new '((t (:foreground "red")))
277 "Face for new reports that nobody has answered.")
278
279 (defface debbugs-gnu-handled '((t (:foreground "ForestGreen")))
280 "Face for reports that have been modified recently.")
281
282 (defface debbugs-gnu-pending '((t (:foreground "MidnightBlue")))
283 "Face for reports that are pending.")
284
285 (defface debbugs-gnu-stale '((t (:foreground "orange")))
286 "Face for reports that have not been touched for two weeks.")
287
288 (defface debbugs-gnu-done '((t (:foreground "DarkGrey")))
289 "Face for closed bug reports.")
290
291 (defface debbugs-gnu-tagged '((t (:foreground "red")))
292 "Face for reports that have been tagged locally.")
293
294 (defvar debbugs-gnu-local-tags nil
295 "List of bug numbers tagged locally, and kept persistent.")
296
297 (defvar debbugs-gnu-persistency-file
298 (expand-file-name (locate-user-emacs-file "debbugs"))
299 "File name of a persistency store for debbugs variables")
300
301 (defun debbugs-gnu-dump-persistency-file ()
302 "Function to store debbugs variables persistently."
303 (with-temp-file debbugs-gnu-persistency-file
304 (insert
305 ";; -*- emacs-lisp -*-\n"
306 ";; Debbugs tags connection history. Don't change this file.\n\n"
307 (format "(setq debbugs-gnu-local-tags '%S)"
308 (sort (copy-sequence debbugs-gnu-local-tags) '>)))))
309
310 (defvar debbugs-gnu-current-query nil
311 "The query object of the current search.
312 It will be applied server-side, when calling `debbugs-get-bugs'.
313 It has the same format as `debbugs-gnu-default-suppress-bugs'.")
314
315 (defvar debbugs-gnu-current-filter nil
316 "The filter object for the current search.
317 It will be applied client-side, when parsing the results of
318 `debbugs-get-status'. It has a similar format as
319 `debbugs-gnu-default-suppress-bugs'. In case of keys representing
320 a date, value is the cons cell \(BEFORE . AFTER\).")
321
322 (defvar debbugs-gnu-current-suppress nil
323 "Whether bugs shall be suppressed.
324 The specification which bugs shall be suppressed is taken from
325 `debbugs-gnu-default-suppress-bugs'.")
326
327 (defun debbugs-gnu-calendar-read (prompt acceptable &optional initial-contents)
328 "Return a string read from the minibuffer.
329 Derived from `calendar-read'."
330 (let ((value (read-string prompt initial-contents)))
331 (while (not (funcall acceptable value))
332 (setq value (read-string prompt initial-contents)))
333 value))
334
335 (defconst debbugs-gnu-phrase-prompt
336 (propertize
337 "Enter search phrase: "
338 'help-echo "\
339 The search phrase contains words to be searched for, combined by
340 operators like AND, ANDNOT and OR. If there is no operator
341 between the words, AND is used by default. The phrase can also
342 be empty, in this case only the following attributes are used for
343 search."))
344
345 ;;;###autoload
346 (defun debbugs-gnu-patches ()
347 "List the bug reports that have been marked as containing a patch."
348 (interactive)
349 (debbugs-gnu nil '("emacs") nil nil "patch"))
350
351 ;;;###autoload
352 (defun debbugs-gnu-search ()
353 "Search for Emacs bugs interactively.
354 Search arguments are requested interactively. The \"search
355 phrase\" is used for full text search in the bugs database.
356 Further key-value pairs are requested until an empty key is
357 returned. If a key cannot be queried by a SOAP request, it is
358 marked as \"client-side filter\"."
359 (interactive)
360
361 (unwind-protect
362 (let ((date-format "\\([[:digit:]]\\{4\\}\\)-\\([[:digit:]]\\{1,2\\}\\)-\\([[:digit:]]\\{1,2\\}\\)")
363 key val1 val2 phrase severities packages archivedp)
364
365 ;; Check for the phrase.
366 (setq phrase (read-string debbugs-gnu-phrase-prompt))
367 (if (zerop (length phrase))
368 (setq phrase nil)
369 (add-to-list 'debbugs-gnu-current-query (cons 'phrase phrase)))
370 ;; We suppress closed bugs if there is no phrase.
371 (setq debbugs-gnu-current-suppress
372 (if (not debbugs-gnu-suppress-closed)
373 nil
374 (null phrase)))
375
376 ;; The other queries.
377 (catch :finished
378 (while t
379 (setq key (completing-read
380 "Enter attribute: "
381 (if phrase
382 '("severity" "package" "tags" "submitter" "date"
383 "subject" "status")
384 '("severity" "package" "archive" "src" "tag"
385 "owner" "submitter" "maint" "correspondent"
386 "date" "log_modified" "last_modified"
387 "found_date" "fixed_date" "unarchived"
388 "subject" "done" "forwarded" "msgid" "summary"))
389 nil t))
390 (cond
391 ;; Server-side queries.
392 ((equal key "severity")
393 (setq
394 severities
395 (completing-read-multiple
396 "Enter severities: " debbugs-gnu-all-severities nil t
397 (mapconcat 'identity debbugs-gnu-default-severities ","))))
398
399 ((equal key "package")
400 (setq
401 packages
402 (completing-read-multiple
403 "Enter packages: " debbugs-gnu-all-packages nil t
404 (mapconcat 'identity debbugs-gnu-default-packages ","))))
405
406 ((equal key "archive")
407 ;; We simplify, by assuming just archived bugs are requested.
408 (setq archivedp t))
409
410 ((member key '("src" "tag" "tags"))
411 (setq val1 (read-string (format "Enter %s: " key)))
412 (when (not (zerop (length val1)))
413 (add-to-list
414 'debbugs-gnu-current-query (cons (intern key) val1))))
415
416 ((member key '("owner" "submitter" "maint" "correspondent"))
417 (setq val1 (read-string "Enter email address: "))
418 (when (not (zerop (length val1)))
419 (add-to-list
420 'debbugs-gnu-current-query (cons (intern key) val1))))
421
422 ((equal key "status")
423 (setq
424 val1
425 (completing-read "Enter status: " '("done" "forwarded" "open")))
426 (when (not (zerop (length val1)))
427 (add-to-list
428 'debbugs-gnu-current-query (cons (intern key) val1))))
429
430 ;; Client-side filters.
431 ((member key '("date" "log_modified" "last_modified"
432 "found_date" "fixed_date" "unarchived"))
433 (setq val1
434 (debbugs-gnu-calendar-read
435 (format "Enter %s before YYYY-MM-DD%s: "
436 key (if phrase "" " (client-side filter)"))
437 (lambda (x)
438 (string-match (concat "^\\(" date-format "\\|\\)$") x))))
439 (if (string-match date-format val1)
440 (setq val1 (floor
441 (float-time
442 (encode-time
443 0 0 0
444 (string-to-number (match-string 3 val1))
445 (string-to-number (match-string 2 val1))
446 (string-to-number (match-string 1 val1))))))
447 (setq val1 nil))
448 (setq val2
449 (debbugs-gnu-calendar-read
450 (format "Enter %s after YYYY-MM-DD%s: "
451 key (if phrase "" " (client-side filter)"))
452 (lambda (x)
453 (string-match (concat "^\\(" date-format "\\|\\)$") x))))
454 (if (string-match date-format val2)
455 (setq val2 (floor
456 (float-time
457 (encode-time
458 0 0 0
459 (string-to-number (match-string 3 val2))
460 (string-to-number (match-string 2 val2))
461 (string-to-number (match-string 1 val2))))))
462 (setq val2 nil))
463 (when (or val1 val2)
464 (add-to-list
465 (if phrase
466 'debbugs-gnu-current-query 'debbugs-gnu-current-filter)
467 (cons (intern key) (cons val1 val2)))))
468
469 ((not (zerop (length key)))
470 (setq val1
471 (funcall
472 (if phrase 'read-string 'read-regexp)
473 (format "Enter %s%s"
474 key (if phrase ": " " (client-side filter)"))))
475 (when (not (zerop (length val1)))
476 (add-to-list
477 (if phrase
478 'debbugs-gnu-current-query 'debbugs-gnu-current-filter)
479 (cons (intern key) val1))))
480
481 ;; The End.
482 (t (throw :finished nil)))))
483
484 ;; Do the search.
485 (debbugs-gnu severities packages archivedp))))
486
487 ;;;###autoload
488 (defun debbugs-gnu (severities &optional packages archivedp suppress tags)
489 "List all outstanding bugs."
490 (interactive
491 (let (severities archivedp)
492 (list
493 (setq severities
494 (completing-read-multiple
495 "Severities: " debbugs-gnu-all-severities nil t
496 (mapconcat 'identity debbugs-gnu-default-severities ",")))
497 ;; The next parameters are asked only when there is a prefix.
498 (if current-prefix-arg
499 (completing-read-multiple
500 "Packages: " debbugs-gnu-all-packages nil t
501 (mapconcat 'identity debbugs-gnu-default-packages ","))
502 debbugs-gnu-default-packages)
503 (when current-prefix-arg
504 (setq archivedp (y-or-n-p "Show archived bugs?")))
505 (when (and current-prefix-arg (not archivedp))
506 (y-or-n-p "Suppress unwanted bugs?"))
507 ;; This one must be asked for severity "tagged".
508 (when (member "tagged" severities)
509 (split-string (read-string "User tag(s): ") "," t)))))
510
511 ;; Initialize variables.
512 (when (and (file-exists-p debbugs-gnu-persistency-file)
513 (not debbugs-gnu-local-tags))
514 (with-temp-buffer
515 (insert-file-contents debbugs-gnu-persistency-file)
516 (eval (read (current-buffer)))))
517 ;; Per default, we suppress retrieved unwanted bugs.
518 (when (and (called-interactively-p 'any)
519 debbugs-gnu-suppress-closed)
520 (setq debbugs-gnu-current-suppress t))
521
522 ;; Add queries.
523 (dolist (severity (if (consp severities) severities (list severities)))
524 (when (not (zerop (length severity)))
525 (when (string-equal severity "tagged")
526 (setq debbugs-gnu-current-suppress nil))
527 (add-to-list 'debbugs-gnu-current-query (cons 'severity severity))))
528 (dolist (package (if (consp packages) packages (list packages)))
529 (when (not (zerop (length package)))
530 (add-to-list 'debbugs-gnu-current-query (cons 'package package))))
531 (when archivedp
532 (setq debbugs-gnu-current-suppress nil)
533 (add-to-list 'debbugs-gnu-current-query '(archive . "1")))
534 (when suppress
535 (setq debbugs-gnu-current-suppress t)
536 (add-to-list 'debbugs-gnu-current-query '(status . "open"))
537 (add-to-list 'debbugs-gnu-current-query '(status . "forwarded")))
538 (dolist (tag (if (consp tags) tags (list tags)))
539 (when (not (zerop (length tag)))
540 (add-to-list 'debbugs-gnu-current-query (cons 'tag tag))))
541
542 ;; Show result.
543 (debbugs-gnu-show-reports)
544
545 ;; Reset query, filter and suppress.
546 (setq debbugs-gnu-current-query nil
547 debbugs-gnu-current-filter nil
548 debbugs-gnu-current-suppress nil))
549
550 (defun debbugs-gnu-get-bugs (query)
551 "Retrieve bug numbers from debbugs.gnu.org according search criteria."
552 (let* ((debbugs-port "gnu.org")
553 (bugs (assoc 'bugs query))
554 (tags (assoc 'tag query))
555 (local-tags (and (member '(severity . "tagged") query) (not tags)))
556 (phrase (assoc 'phrase query))
557 args)
558 ;; Compile query arguments.
559 (unless (or query tags)
560 (dolist (elt debbugs-gnu-default-packages)
561 (setq args (append args (list :package elt)))))
562 (dolist (elt query)
563 (unless (equal elt '(severity . "tagged"))
564 (setq args
565 (append
566 args
567 (if phrase
568 (cond
569 ((eq (car elt) 'phrase)
570 (list (list :phrase (cdr elt))))
571 ((eq (car elt) 'date)
572 (list (list :date (cddr elt) (cadr elt)
573 :operator "NUMBT")))
574 (t
575 (list (list (intern (concat ":" (symbol-name (car elt))))
576 (cdr elt) :operator "ISTRINC"))))
577 (list (intern (concat ":" (symbol-name (car elt))))
578 (cdr elt)))))))
579
580 (cond
581 ;; If the query is just a list of bug numbers, we return them.
582 (bugs (cdr bugs))
583 ;; If the query contains the pseudo-severity "tagged", we return
584 ;; just the local tagged bugs.
585 (local-tags (copy-sequence debbugs-gnu-local-tags))
586 ;; A full text query.
587 (phrase
588 (mapcar
589 (lambda (x) (cdr (assoc "id" x)))
590 (apply 'debbugs-search-est args)))
591 ;; Otherwise, we retrieve the bugs from the server.
592 (t (apply 'debbugs-get-bugs args)))))
593
594 (defun debbugs-gnu-show-reports (&optional offline)
595 "Show bug reports.
596 If OFFLINE is non-nil, the query is not sent to the server. Bugs
597 are taken from the cache instead."
598 (let ((inhibit-read-only t)
599 (buffer-name "*Emacs Bugs*"))
600 ;; The tabulated mode sets several local variables. We must get
601 ;; rid of them.
602 (when (get-buffer buffer-name)
603 (kill-buffer buffer-name))
604 (switch-to-buffer (get-buffer-create buffer-name))
605 (debbugs-gnu-mode)
606
607 ;; Print bug reports.
608 (dolist (status
609 (let ((debbugs-cache-expiry (if offline nil debbugs-cache-expiry))
610 ids)
611 (apply 'debbugs-get-status
612 (if offline
613 (progn
614 (maphash (lambda (key _elem)
615 (push key ids))
616 debbugs-cache-data)
617 (sort ids '<))
618 (debbugs-gnu-get-bugs debbugs-gnu-local-query)))))
619 (let* ((id (cdr (assq 'id status)))
620 (words
621 (mapconcat
622 'identity
623 (cons (cdr (assq 'severity status))
624 (cdr (assq 'keywords status)))
625 ","))
626 (address (if (cdr (assq 'originator status))
627 (mail-header-parse-address
628 (decode-coding-string (cdr (assq 'originator status))
629 'utf-8))))
630 (owner (if (cdr (assq 'owner status))
631 (car (mail-header-parse-address
632 (decode-coding-string (cdr (assq 'owner status))
633 'utf-8)))))
634 (subject (if (cdr (assq 'subject status))
635 (decode-coding-string (cdr (assq 'subject status))
636 'utf-8)))
637 merged)
638 (unless (equal (cdr (assq 'pending status)) "pending")
639 (setq words (concat words "," (cdr (assq 'pending status)))))
640 (let ((packages (delete "emacs" (cdr (assq 'package status)))))
641 (when packages
642 (setq words (concat words "," (mapconcat 'identity packages ",")))))
643 (when (setq merged (cdr (assq 'mergedwith status)))
644 (setq words (format "%s,%s"
645 (if (numberp merged)
646 merged
647 (mapconcat 'number-to-string merged ","))
648 words)))
649 (when (or (not merged)
650 (not (let ((found nil))
651 (dolist (id (if (listp merged)
652 merged
653 (list merged)))
654 (dolist (entry tabulated-list-entries)
655 (when (equal id (cdr (assq 'id (car entry))))
656 (setq found t))))
657 found)))
658 (add-to-list
659 'tabulated-list-entries
660 (list
661 status
662 (vector
663 (propertize
664 (format "%5d" id)
665 'face
666 ;; Mark tagged bugs.
667 (if (memq id debbugs-gnu-local-tags)
668 'debbugs-gnu-tagged
669 'default))
670 (propertize
671 ;; Mark status and age.
672 (or words "")
673 'face
674 (cond
675 ((cdr (assq 'archived status))
676 'debbugs-gnu-archived)
677 ((equal (cdr (assq 'pending status)) "done")
678 'debbugs-gnu-done)
679 ((member "pending" (cdr (assq 'keywords status)))
680 'debbugs-gnu-pending)
681 ((= (cdr (assq 'date status))
682 (cdr (assq 'log_modified status)))
683 'debbugs-gnu-new)
684 ((< (- (float-time)
685 (cdr (assq 'log_modified status)))
686 (* 60 60 24 7 2))
687 'debbugs-gnu-handled)
688 (t
689 'debbugs-gnu-stale)))
690 (propertize
691 ;; Prefer the name over the address.
692 (or (cdr address)
693 (car address)
694 "")
695 'face
696 ;; Mark own submitted bugs.
697 (if (and (stringp (car address))
698 (string-equal (car address) user-mail-address))
699 'debbugs-gnu-tagged
700 'default))
701 (propertize
702 (or subject "")
703 'face
704 ;; Mark owned bugs.
705 (if (and (stringp owner)
706 (string-equal owner user-mail-address))
707 'debbugs-gnu-tagged
708 'default))))
709 'append))))
710
711 (tabulated-list-init-header)
712 (tabulated-list-print)
713
714 (set-buffer-modified-p nil)
715 (goto-char (point-min))))
716
717 (defun debbugs-gnu-print-entry (list-id cols)
718 "Insert a debbugs entry at point.
719 Used instead of `tabulated-list-print-entry'."
720 (let ((beg (point))
721 (pos 0)
722 (case-fold-search t)
723 (id (aref cols 0))
724 (id-length (nth 1 (aref tabulated-list-format 0)))
725 (state (aref cols 1))
726 (state-length (nth 1 (aref tabulated-list-format 1)))
727 (submitter (aref cols 2))
728 (submitter-length (nth 1 (aref tabulated-list-format 2)))
729 (title (aref cols 3))
730 ;; (title-length (nth 1 (aref tabulated-list-format 3)))
731 )
732 (when (and
733 ;; We may have a narrowing in effect.
734 (or (not debbugs-gnu-limit)
735 (memq (cdr (assq 'id list-id)) debbugs-gnu-limit))
736 ;; Filter suppressed bugs.
737 (or (not debbugs-gnu-local-suppress)
738 (not (catch :suppress
739 (dolist (check debbugs-gnu-default-suppress-bugs)
740 (when
741 (string-match
742 (cdr check)
743 (or (cdr (assq (car check) list-id)) ""))
744 (throw :suppress t))))))
745 ;; Filter search list.
746 (not (catch :suppress
747 (dolist (check debbugs-gnu-local-filter)
748 (let ((val (cdr (assq (car check) list-id))))
749 (if (stringp (cdr check))
750 ;; Regular expression.
751 (when (not (string-match (cdr check) (or val "")))
752 (throw :suppress t))
753 ;; Time value.
754 (when (or (and (numberp (cadr check))
755 (< (cadr check) val))
756 (and (numberp (cddr check))
757 (> (cddr check) val)))
758 (throw :suppress t))))))))
759
760 ;; Insert id.
761 (indent-to (- id-length (length id)))
762 (insert id)
763 ;; Insert state.
764 (indent-to (setq pos (+ pos id-length 1)) 1)
765 (insert (if (> (length state) state-length)
766 (propertize (substring state 0 state-length)
767 'help-echo state)
768 state))
769 ;; Insert submitter.
770 (indent-to (setq pos (+ pos state-length 1)) 1)
771 (insert "[" (if (> (length submitter) (- submitter-length 2))
772 (propertize (substring submitter 0 (- submitter-length 2))
773 'help-echo submitter)
774 submitter))
775 (indent-to (+ pos (1- submitter-length)))
776 (insert "]")
777 ;; Insert title.
778 (indent-to (setq pos (+ pos submitter-length 1)) 1)
779 (insert (propertize title 'help-echo title))
780 ;; Add properties.
781 (add-text-properties
782 beg (point)
783 `(tabulated-list-id ,list-id mouse-face highlight))
784 (insert ?\n))))
785
786 (defun debbugs-gnu-menu-map-emacs-enabled ()
787 "Whether \"Show Release Blocking Bugs\" is enabled in the menu."
788 (or ;; No package discriminator has been used.
789 (not (assq 'package debbugs-gnu-local-query))
790 ;; Package "emacs" has been selected.
791 (member '(package . "emacs") debbugs-gnu-local-query)))
792
793 (defconst debbugs-gnu-bug-triage-file
794 (expand-file-name "../admin/notes/bug-triage" data-directory)
795 "The \"bug-triage\" file.")
796
797 (defun debbugs-gnu-menu-map-bug-triage-enabled ()
798 "Whether \"Describe Bug Triage Procedure\" is enabled in the menu."
799 (and (debbugs-gnu-menu-map-emacs-enabled)
800 (stringp debbugs-gnu-bug-triage-file)
801 (file-readable-p debbugs-gnu-bug-triage-file)))
802
803 (defun debbugs-gnu-view-bug-triage ()
804 "Show \"bug-triage\" file."
805 (interactive)
806 (view-file debbugs-gnu-bug-triage-file))
807
808 (defvar debbugs-gnu-mode-map
809 (let ((map (make-sparse-keymap))
810 (menu-map (make-sparse-keymap)))
811 (set-keymap-parent map tabulated-list-mode-map)
812 (define-key map "\r" 'debbugs-gnu-select-report)
813 (define-key map [mouse-1] 'debbugs-gnu-select-report)
814 (define-key map [mouse-2] 'debbugs-gnu-select-report)
815 (define-key map "g" 'debbugs-gnu-rescan)
816 (define-key map "R" 'debbugs-gnu-show-all-blocking-reports)
817 (define-key map "C" 'debbugs-gnu-send-control-message)
818
819 (define-key map "s" 'debbugs-gnu-toggle-sort)
820 (define-key map "t" 'debbugs-gnu-toggle-tag)
821 (define-key map "x" 'debbugs-gnu-toggle-suppress)
822 (define-key map "/" 'debbugs-gnu-narrow-to-status)
823 (define-key map "w" 'debbugs-gnu-widen)
824
825 (define-key map "b" 'debbugs-gnu-show-blocked-by-reports)
826 (define-key map "B" 'debbugs-gnu-show-blocking-reports)
827 (define-key map "d" 'debbugs-gnu-display-status)
828
829 (define-key map [menu-bar debbugs] (cons "Debbugs" menu-map))
830 (define-key menu-map [debbugs-gnu-select-report]
831 '(menu-item "Show Reports" debbugs-gnu-select-report
832 :help "Show all reports belonging to this bug"))
833 (define-key-after menu-map [debbugs-gnu-rescan]
834 '(menu-item "Refresh Bugs" debbugs-gnu-rescan
835 :help "Refresh bug list")
836 'debbugs-gnu-select-report)
837 (define-key-after menu-map [debbugs-gnu-show-all-blocking-reports]
838 '(menu-item "Show Release Blocking Bugs"
839 debbugs-gnu-show-all-blocking-reports
840 :enable (debbugs-gnu-menu-map-emacs-enabled)
841 :help "Show all bugs blocking next Emacs release")
842 'debbugs-gnu-rescan)
843 (define-key-after menu-map [debbugs-gnu-send-control-message]
844 '(menu-item "Send Control Message"
845 debbugs-gnu-send-control-message
846 :help "Send control message to debbugs.gnu.org")
847 'debbugs-gnu-show-all-blocking-reports)
848
849 (define-key-after menu-map [debbugs-gnu-separator1]
850 '(menu-item "--") 'debbugs-gnu-send-control-message)
851 (define-key-after menu-map [debbugs-gnu-search]
852 '(menu-item "Search Bugs" debbugs-gnu-search
853 :help "Search bugs on debbugs.gnu.org")
854 'debbugs-gnu-separator1)
855 (define-key-after menu-map [debbugs-gnu]
856 '(menu-item "Retrieve Bugs" debbugs-gnu
857 :help "Retrieve bugs from debbugs.gnu.org")
858 'debbugs-gnu-search)
859 (define-key-after menu-map [debbugs-gnu-bugs]
860 '(menu-item "Retrieve Bugs by Number" debbugs-gnu-bugs
861 :help "Retrieve selected bugs from debbugs.gnu.org")
862 'debbugs-gnu)
863
864 (define-key-after menu-map [debbugs-gnu-separator2]
865 '(menu-item "--") 'debbugs-gnu-bugs)
866 (define-key-after menu-map [debbugs-gnu-view-bug-triage]
867 '(menu-item "Describe Bug Triage Procedure"
868 debbugs-gnu-view-bug-triage
869 :enable (debbugs-gnu-menu-map-bug-triage-enabled)
870 :help "Show procedure of triaging bugs")
871 'debbugs-gnu-separator2)
872 map))
873
874 (defun debbugs-gnu-rescan ()
875 "Rescan the current set of bug reports."
876 (interactive)
877 (let ((id (debbugs-gnu-current-id))
878 (debbugs-gnu-current-query debbugs-gnu-local-query)
879 (debbugs-gnu-current-filter debbugs-gnu-local-filter)
880 (debbugs-gnu-current-suppress debbugs-gnu-local-suppress)
881 (debbugs-cache-expiry (if current-prefix-arg t debbugs-cache-expiry)))
882 (debbugs-gnu-show-reports)
883 (when id
884 (debbugs-gnu-goto id))))
885
886 (define-derived-mode debbugs-gnu-mode tabulated-list-mode "Debbugs"
887 "Major mode for listing bug reports.
888
889 All normal editing commands are switched off.
890 \\<debbugs-gnu-mode-map>
891
892 The following commands are available:
893
894 \\{debbugs-gnu-mode-map}"
895 (set (make-local-variable 'debbugs-gnu-sort-state) 'number)
896 (set (make-local-variable 'debbugs-gnu-limit) nil)
897 (set (make-local-variable 'debbugs-gnu-local-query)
898 debbugs-gnu-current-query)
899 (set (make-local-variable 'debbugs-gnu-local-filter)
900 debbugs-gnu-current-filter)
901 (set (make-local-variable 'debbugs-gnu-local-suppress)
902 debbugs-gnu-current-suppress)
903 (setq tabulated-list-format [("Id" 5 debbugs-gnu-sort-id)
904 ("State" 20 debbugs-gnu-sort-state)
905 ("Submitter" 25 t)
906 ("Title" 10 debbugs-gnu-sort-title)])
907 (setq tabulated-list-sort-key (cons "Id" nil))
908 (setq tabulated-list-printer 'debbugs-gnu-print-entry)
909 (buffer-disable-undo)
910 (setq truncate-lines t)
911 (setq buffer-read-only t))
912
913 (defun debbugs-gnu-sort-id (s1 s2)
914 (> (cdr (assq 'id (car s1)))
915 (cdr (assq 'id (car s2)))))
916
917 (defconst debbugs-gnu-state-preference
918 '((debbugs-gnu-new . 1)
919 (debbugs-gnu-stale . 2)
920 (debbugs-gnu-handled . 3)
921 (debbugs-gnu-done . 4)
922 (debbugs-gnu-pending . 5)))
923
924 (defun debbugs-gnu-get-state-preference (face-string)
925 (or (cdr (assq (get-text-property 0 'face face-string)
926 debbugs-gnu-state-preference))
927 10))
928
929 (defconst debbugs-gnu-severity-preference
930 '(("serious" . 1)
931 ("important" . 2)
932 ("normal" . 3)
933 ("minor" . 4)
934 ("wishlist" . 5)))
935
936 (defun debbugs-gnu-get-severity-preference (state)
937 (or (cdr (assoc (cdr (assq 'severity state))
938 debbugs-gnu-severity-preference))
939 10))
940
941 (defun debbugs-gnu-sort-state (s1 s2)
942 (let ((id1 (cdr (assq 'id (car s1))))
943 (age1 (debbugs-gnu-get-state-preference (aref (nth 1 s1) 1)))
944 (id2 (cdr (assq 'id (car s2))))
945 (age2 (debbugs-gnu-get-state-preference (aref (nth 1 s2) 1))))
946 (cond
947 ;; Tagged bugs go to the end.
948 ((and (not (memq id1 debbugs-gnu-local-tags))
949 (memq id2 debbugs-gnu-local-tags))
950 t)
951 ((and (memq id1 debbugs-gnu-local-tags)
952 (not (memq id2 debbugs-gnu-local-tags)))
953 nil)
954 ;; Then, we check the age of the bugs.
955 ((< age1 age2)
956 t)
957 ((> age1 age2)
958 nil)
959 ;; If they have the same age, we check for severity.
960 ((< (debbugs-gnu-get-severity-preference (car s1))
961 (debbugs-gnu-get-severity-preference (car s2)))
962 t)
963 (t nil))))
964
965 (defun debbugs-gnu-sort-title (s1 _s2)
966 (let ((owner (if (cdr (assq 'owner (car s1)))
967 (car (mail-header-parse-address
968 (decode-coding-string (cdr (assq 'owner (car s1)))
969 'utf-8))))))
970 (and (stringp owner)
971 (string-equal owner user-mail-address))))
972
973 (defun debbugs-gnu-toggle-sort ()
974 "Toggle sorting by age and by state."
975 (interactive)
976 (if (eq debbugs-gnu-sort-state 'number)
977 (progn
978 (setq debbugs-gnu-sort-state 'state)
979 (setq tabulated-list-sort-key (cons "Id" nil)))
980 (setq debbugs-gnu-sort-state 'number)
981 (setq tabulated-list-sort-key (cons "State" nil)))
982 (tabulated-list-init-header)
983 (tabulated-list-print))
984
985 (defun debbugs-gnu-widen ()
986 "Display all the currently selected bug reports."
987 (interactive)
988 (let ((id (debbugs-gnu-current-id t))
989 (inhibit-read-only t))
990 (setq debbugs-gnu-limit nil)
991 (tabulated-list-init-header)
992 (tabulated-list-print)
993 (when id
994 (debbugs-gnu-goto id))))
995
996 (defun debbugs-gnu-show-blocked-by-reports ()
997 "Display all bug reports this report is blocked by."
998 (interactive)
999 (let ((id (debbugs-gnu-current-id))
1000 (status (debbugs-gnu-current-status)))
1001 (if (null (cdr (assq 'blockedby status)))
1002 (message "Bug %d is not blocked by any other bug" id)
1003 (apply 'debbugs-gnu-bugs (cdr (assq 'blockedby status))))))
1004
1005 (defun debbugs-gnu-show-blocking-reports ()
1006 "Display all bug reports this report is blocking."
1007 (interactive)
1008 (let ((id (debbugs-gnu-current-id))
1009 (status (debbugs-gnu-current-status)))
1010 (if (null (cdr (assq 'blocks status)))
1011 (message "Bug %d is not blocking any other bug" id)
1012 (apply 'debbugs-gnu-bugs (cdr (assq 'blocks status))))))
1013
1014 (defun debbugs-gnu-show-all-blocking-reports ()
1015 "Narrow the display to just the reports that are blocking a release."
1016 (interactive)
1017 (let ((blockers (cdr (assq 'blockedby
1018 (car (debbugs-get-status
1019 debbugs-gnu-blocking-report)))))
1020 (id (debbugs-gnu-current-id t))
1021 (inhibit-read-only t)
1022 status)
1023 (setq debbugs-gnu-limit nil)
1024 (goto-char (point-min))
1025 (while (not (eobp))
1026 (setq status (debbugs-gnu-current-status))
1027 (if (not (memq (cdr (assq 'id status)) blockers))
1028 (delete-region (point) (progn (forward-line 1) (point)))
1029 (push (cdr (assq 'id status)) debbugs-gnu-limit)
1030 (forward-line 1)))
1031 (when id
1032 (debbugs-gnu-goto id))))
1033
1034 (defun debbugs-gnu-narrow-to-status (string &optional status-only)
1035 "Only display the bugs matching STRING.
1036 If STATUS-ONLY (the prefix), ignore matches in the From and
1037 Subject fields."
1038 (interactive "sNarrow to: \nP")
1039 (let ((id (debbugs-gnu-current-id t))
1040 (inhibit-read-only t)
1041 status)
1042 (setq debbugs-gnu-limit nil)
1043 (if (equal string "")
1044 (debbugs-gnu-toggle-suppress)
1045 (goto-char (point-min))
1046 (while (not (eobp))
1047 (setq status (debbugs-gnu-current-status))
1048 (if (and (not (member string (assq 'keywords status)))
1049 (not (equal string (cdr (assq 'severity status))))
1050 (or status-only
1051 (not (string-match
1052 string (cdr (assq 'originator status)))))
1053 (or status-only
1054 (not (string-match string (cdr (assq 'subject status))))))
1055 (delete-region (point) (progn (forward-line 1) (point)))
1056 (push (cdr (assq 'id status)) debbugs-gnu-limit)
1057 (forward-line 1)))
1058 (when id
1059 (debbugs-gnu-goto id)))))
1060
1061 (defun debbugs-gnu-goto (id)
1062 "Go to the line displaying bug ID."
1063 (goto-char (point-min))
1064 (while (and (not (eobp))
1065 (not (equal (debbugs-gnu-current-id t) id)))
1066 (forward-line 1)))
1067
1068 (defun debbugs-gnu-toggle-tag ()
1069 "Toggle the local tag of the report in the current line.
1070 If a report is tagged locally, it is presumed to be of little
1071 interest to you."
1072 (interactive)
1073 (save-excursion
1074 (beginning-of-line)
1075 (let ((inhibit-read-only t)
1076 (id (debbugs-gnu-current-id)))
1077 (if (memq id debbugs-gnu-local-tags)
1078 (progn
1079 (setq debbugs-gnu-local-tags (delq id debbugs-gnu-local-tags))
1080 (put-text-property (point) (+ (point) 5) 'face 'default))
1081 (add-to-list 'debbugs-gnu-local-tags id)
1082 (put-text-property
1083 (+ (point) (- 5 (length (number-to-string id)))) (+ (point) 5)
1084 'face 'debbugs-gnu-tagged))
1085 (debbugs-gnu--update-tag-face id)))
1086 (debbugs-gnu-dump-persistency-file))
1087
1088 (defun debbugs-gnu--update-tag-face (id)
1089 (dolist (entry tabulated-list-entries)
1090 (when (equal (cdr (assq 'id (car entry))) id)
1091 (aset (cadr entry) 0
1092 (propertize
1093 (format "%5d" id)
1094 'face
1095 ;; Mark tagged bugs.
1096 (if (memq id debbugs-gnu-local-tags)
1097 'debbugs-gnu-tagged
1098 'default))))))
1099
1100 (defun debbugs-gnu-toggle-suppress ()
1101 "Suppress bugs marked in `debbugs-gnu-suppress-bugs'."
1102 (interactive)
1103 (setq debbugs-gnu-local-suppress (not debbugs-gnu-local-suppress))
1104 (tabulated-list-init-header)
1105 (tabulated-list-print))
1106
1107 (defvar debbugs-gnu-bug-number nil)
1108 (defvar debbugs-gnu-subject nil)
1109
1110 (defun debbugs-gnu-current-id (&optional noerror)
1111 (or (cdr (assq 'id (debbugs-gnu-current-status)))
1112 (and (not noerror)
1113 (error "No bug on the current line"))))
1114
1115 (defun debbugs-gnu-current-status ()
1116 (get-text-property (line-beginning-position) 'tabulated-list-id))
1117
1118 (defun debbugs-gnu-display-status (query filter status)
1119 "Display the query, filter and status of the report on the current line."
1120 (interactive (list debbugs-gnu-local-query
1121 debbugs-gnu-local-filter
1122 (debbugs-gnu-current-status)))
1123 (switch-to-buffer "*Bug Status*")
1124 (let ((inhibit-read-only t))
1125 (erase-buffer)
1126 (when query
1127 (insert ";; Query\n")
1128 (pp query (current-buffer))
1129 (insert "\n"))
1130 (when filter
1131 (insert ";; Filter\n")
1132 (pp filter (current-buffer))
1133 (insert "\n"))
1134 (when status
1135 (insert ";; Status\n")
1136 (pp status (current-buffer)))
1137 (goto-char (point-min)))
1138 (set-buffer-modified-p nil)
1139 (special-mode))
1140
1141 (defun debbugs-read-emacs-bug-with-rmail (id status merged)
1142 "Read email exchange for debbugs bug ID.
1143 STATUS is the bug's status list.
1144 MERGED is the list of bugs merged with this one."
1145 (let* ((mbox-dir (make-temp-file "debbugs" t))
1146 (mbox-fname (format "%s/bug_%d.mbox" mbox-dir id)))
1147 (debbugs-get-mbox id 'mboxmaint mbox-fname)
1148 (rmail mbox-fname)
1149 ;; Download messages of all the merged bug reports and append them
1150 ;; to the mailbox of the requested bug.
1151 (when merged
1152 (dolist (bugno merged)
1153 (let ((fn (make-temp-file "url")))
1154 (debbugs-get-mbox bugno 'mboxmaint fn)
1155 (rmail-get-new-mail fn)
1156 (delete-file fn)
1157 ;; Remove the 'unseen' attribute from all the messages we've
1158 ;; just read, so that all of them appear in the summary with
1159 ;; the same face.
1160 (while (< rmail-current-message rmail-total-messages)
1161 (rmail-show-message (1+ rmail-current-message))))))
1162 (set (make-local-variable 'debbugs-gnu-bug-number) id)
1163 (set (make-local-variable 'debbugs-gnu-subject)
1164 (format "Re: bug#%d: %s" id (cdr (assq 'subject status))))
1165 (rmail-summary)
1166 (define-key rmail-summary-mode-map "C" 'debbugs-gnu-send-control-message)
1167 (set-window-text-height nil 10)
1168 (other-window 1)
1169 (define-key rmail-mode-map "C" 'debbugs-gnu-send-control-message)
1170 (rmail-show-message 1)))
1171
1172 (defun debbugs-read-emacs-bug-with-gnus (id status merged)
1173 "Read email exchange for debbugs bug ID.
1174 STATUS is the bug's status list.
1175 MERGED is the list of bugs merged with this one."
1176 (require 'gnus-dup)
1177 (setq gnus-suppress-duplicates t
1178 gnus-save-duplicate-list t)
1179 ;; Use Gnus.
1180 (gnus-read-ephemeral-emacs-bug-group
1181 (cons id (if (listp merged) merged (list merged)))
1182 (cons (current-buffer)
1183 (current-window-configuration)))
1184 (with-current-buffer (window-buffer (selected-window))
1185 (set (make-local-variable 'debbugs-gnu-bug-number) id)
1186 (set (make-local-variable 'debbugs-gnu-subject)
1187 (format "Re: bug#%d: %s" id (cdr (assq 'subject status))))
1188 (debbugs-gnu-summary-mode 1)))
1189
1190 (defun debbugs-gnu-select-report ()
1191 "Select the report on the current line."
1192 (interactive)
1193 ;; We open the report messages.
1194 (let* ((status (debbugs-gnu-current-status))
1195 (id (cdr (assq 'id status)))
1196 (merged (cdr (assq 'mergedwith status))))
1197 (setq merged (if (listp merged) merged (list merged)))
1198 (cond
1199 ((not id)
1200 (message "No bug report on the current line"))
1201 ((eq debbugs-gnu-mail-backend 'rmail)
1202 (debbugs-read-emacs-bug-with-rmail id status merged))
1203 ((eq debbugs-gnu-mail-backend 'gnus)
1204 (debbugs-read-emacs-bug-with-gnus id status merged))
1205 (t (error "No valid mail backend specified")))))
1206
1207 (defvar debbugs-gnu-summary-mode-map
1208 (let ((map (make-sparse-keymap)))
1209 (define-key map "C" 'debbugs-gnu-send-control-message)
1210 (define-key map [(meta m)] 'debbugs-gnu-apply-patch)
1211 map))
1212
1213 (define-minor-mode debbugs-gnu-summary-mode
1214 "Minor mode for providing a debbugs interface in Gnus summary buffers.
1215
1216 \\{debbugs-gnu-summary-mode-map}"
1217 :lighter " Debbugs" :keymap debbugs-gnu-summary-mode-map
1218 (set (make-local-variable 'gnus-posting-styles)
1219 `((".*"
1220 (eval
1221 (when (buffer-live-p gnus-article-copy)
1222 (with-current-buffer gnus-article-copy
1223 (set (make-local-variable 'message-prune-recipient-rules)
1224 '((".*@debbugs.*" "emacs-pretest-bug")
1225 (".*@debbugs.*" "bug-gnu-emacs")
1226 ("[0-9]+@debbugs.*" "submit@debbugs.gnu.org")
1227 ("[0-9]+@debbugs.*" "quiet@debbugs.gnu.org")))
1228 (set (make-local-variable 'message-alter-recipients-function)
1229 (lambda (address)
1230 (if (string-match "\\([0-9]+\\)@donarmstrong"
1231 (car address))
1232 (let ((new (format "%s@debbugs.gnu.org"
1233 (match-string 1 (car address)))))
1234 (cons new new))
1235 address)))
1236 ;; `gnus-posting-styles' is eval'ed after
1237 ;; `message-simplify-subject'. So we cannot use m-s-s.
1238 (setq subject ,debbugs-gnu-subject))))))))
1239
1240 (defun debbugs-gnu-guess-current-id ()
1241 "Guess the ID based on \"#23\"."
1242 (save-excursion
1243 (beginning-of-line)
1244 (and
1245 (or (re-search-forward "#\\([0-9]+\\)" (line-end-position) t)
1246 (progn
1247 (goto-char (point-min))
1248 (re-search-forward "#\\([0-9]+\\)" nil t)))
1249 (string-to-number (match-string 1)))))
1250
1251 (defvar debbugs-gnu-send-mail-function nil
1252 "A function to send control messages from debbugs.")
1253
1254 (defun debbugs-gnu-send-control-message (message &optional reverse)
1255 "Send a control message for the current bug report.
1256 You can set the severity or add a tag, or close the report. If
1257 you use the special \"done\" MESSAGE, the report will be marked as
1258 fixed, and then closed.
1259
1260 If given a prefix, and given a tag to set, the tag will be
1261 removed instead."
1262 (interactive
1263 (list (completing-read
1264 "Control message: "
1265 '("serious" "important" "normal" "minor" "wishlist"
1266 "done" "donenotabug" "donewontfix" "doneunreproducible"
1267 "unarchive" "unmerge" "reopen" "close"
1268 "merge" "forcemerge"
1269 "block" "unblock"
1270 "owner" "noowner"
1271 "invalid"
1272 "reassign"
1273 "retitle"
1274 "patch" "wontfix" "moreinfo" "unreproducible" "fixed" "notabug"
1275 "pending" "help" "security" "confirmed"
1276 "usertag")
1277 nil t)
1278 current-prefix-arg))
1279 (let* ((id (or (debbugs-gnu-current-id t)
1280 debbugs-gnu-bug-number ; Set on group entry.
1281 (debbugs-gnu-guess-current-id)))
1282 (version
1283 (when (member message '("close" "done"))
1284 (read-string
1285 "Version: "
1286 (cond
1287 ;; Emacs development versions.
1288 ((string-match
1289 "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)\\." emacs-version)
1290 (format "%s.%d"
1291 (match-string 1 emacs-version)
1292 (1+ (string-to-number (match-string 2 emacs-version)))))
1293 ;; Emacs release versions.
1294 ((string-match
1295 "^\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)$" emacs-version)
1296 (format "%s.%s"
1297 (match-string 1 emacs-version)
1298 (match-string 2 emacs-version)))
1299 (t emacs-version)))))
1300 (status (debbugs-gnu-current-status)))
1301 (with-temp-buffer
1302 (insert "To: control@debbugs.gnu.org\n"
1303 "From: " (message-make-from) "\n"
1304 (format "Subject: control message for bug #%d\n" id)
1305 mail-header-separator
1306 "\n"
1307 (cond
1308 ((member message '("unarchive" "unmerge" "reopen" "noowner"))
1309 (format "%s %d\n" message id))
1310 ((member message '("merge" "forcemerge"))
1311 (format "%s %d %s\n" message id
1312 (read-string "Merge with bug #: ")))
1313 ((member message '("block" "unblock"))
1314 (format
1315 "%s %d by %s\n" message id
1316 (mapconcat
1317 'identity
1318 (completing-read-multiple
1319 (format "%s with bug(s) #: " (capitalize message))
1320 (if (equal message "unblock")
1321 (mapcar 'number-to-string
1322 (cdr (assq 'blockedby status))))
1323 nil (and (equal message "unblock") status))
1324 " ")))
1325 ((equal message "owner")
1326 (format "owner %d !\n" id))
1327 ((equal message "retitle")
1328 (format "retitle %d %s\n" id (read-string "New title: ")))
1329 ((equal message "reassign")
1330 (format "reassign %d %s\n" id (read-string "Package(s): ")))
1331 ((equal message "close")
1332 (format "close %d %s\n" id version))
1333 ((equal message "done")
1334 (format "tags %d fixed\nclose %d %s\n" id id version))
1335 ((member message '("donenotabug" "donewontfix"
1336 "doneunreproducible"))
1337 (format "tags %d %s\nclose %d\n" id (substring message 4) id))
1338 ((member message '("serious" "important" "normal"
1339 "minor" "wishlist"))
1340 (format "severity %d %s\n" id message))
1341 ((equal message "invalid")
1342 (format "tags %d notabug\ntags %d wontfix\nclose %d\n"
1343 id id id))
1344 ((equal message "usertag")
1345 (format "user %s\nusertag %d %s\n"
1346 (completing-read
1347 "Package name or email address: "
1348 (append
1349 debbugs-gnu-all-packages (list user-mail-address))
1350 nil nil (car debbugs-gnu-default-packages))
1351 id (read-string "User tag: ")))
1352 (t
1353 (format "tags %d%s %s\n"
1354 id (if reverse " -" "")
1355 message))))
1356 (funcall (or debbugs-gnu-send-mail-function send-mail-function))
1357 (remhash id debbugs-cache-data)
1358 (message-goto-body)
1359 (message "Control message sent:\n%s"
1360 (buffer-substring-no-properties (point) (1- (point-max)))))))
1361
1362 (defvar debbugs-gnu-usertags-mode-map
1363 (let ((map (make-sparse-keymap)))
1364 (set-keymap-parent map tabulated-list-mode-map)
1365 (define-key map "\r" 'debbugs-gnu-select-usertag)
1366 (define-key map [mouse-1] 'debbugs-gnu-select-usertag)
1367 (define-key map [mouse-2] 'debbugs-gnu-select-usertag)
1368 map))
1369
1370 (define-derived-mode debbugs-gnu-usertags-mode tabulated-list-mode "Usertags"
1371 "Major mode for listing user tags.
1372
1373 All normal editing commands are switched off.
1374 \\<debbugs-gnu-usertags-mode-map>
1375
1376 The following commands are available:
1377
1378 \\{debbugs-gnu-usertags-mode-map}"
1379 (buffer-disable-undo)
1380 (setq truncate-lines t)
1381 (setq buffer-read-only t))
1382
1383 ;;;###autoload
1384 (defun debbugs-gnu-usertags (&rest users)
1385 "List all user tags for USERS, which is \(\"emacs\"\) by default."
1386 (interactive
1387 (if current-prefix-arg
1388 (completing-read-multiple
1389 "Package name(s) or email address: "
1390 (append debbugs-gnu-all-packages (list user-mail-address)) nil nil
1391 (mapconcat 'identity debbugs-gnu-default-packages ","))
1392 debbugs-gnu-default-packages))
1393
1394 (unwind-protect
1395 (let ((inhibit-read-only t)
1396 (debbugs-port "gnu.org")
1397 (buffer-name "*Emacs User Tags*")
1398 (user-tab-length
1399 (1+ (apply 'max (length "User") (mapcar 'length users)))))
1400
1401 ;; Initialize variables.
1402 (when (and (file-exists-p debbugs-gnu-persistency-file)
1403 (not debbugs-gnu-local-tags))
1404 (with-temp-buffer
1405 (insert-file-contents debbugs-gnu-persistency-file)
1406 (eval (read (current-buffer)))))
1407
1408 ;; Create buffer.
1409 (when (get-buffer buffer-name)
1410 (kill-buffer buffer-name))
1411 (switch-to-buffer (get-buffer-create buffer-name))
1412 (debbugs-gnu-usertags-mode)
1413 (setq tabulated-list-format `[("User" ,user-tab-length t)
1414 ("Tag" 10 t)])
1415 (setq tabulated-list-sort-key (cons "User" nil))
1416 ;(setq tabulated-list-printer 'debbugs-gnu-print-entry)
1417
1418 ;; Retrieve user tags.
1419 (dolist (user users)
1420 (dolist (tag (sort (debbugs-get-usertag :user user) 'string<))
1421 (add-to-list
1422 'tabulated-list-entries
1423 ;; `tabulated-list-id' is the parameter list for `debbugs-gnu'.
1424 `((("tagged") (,user) nil nil (,tag))
1425 ,(vector (propertize user 'mouse-face 'highlight)
1426 (propertize tag 'mouse-face 'highlight)))
1427 'append)))
1428
1429 ;; Add local tags.
1430 (when debbugs-gnu-local-tags
1431 (add-to-list
1432 'tabulated-list-entries
1433 `((("tagged"))
1434 ,(vector
1435 "" (propertize "(local tags)" 'mouse-face 'highlight)))))
1436
1437 ;; Show them.
1438 (tabulated-list-init-header)
1439 (tabulated-list-print)
1440
1441 (set-buffer-modified-p nil)
1442 (goto-char (point-min)))))
1443
1444 (defun debbugs-gnu-select-usertag ()
1445 "Select the user tag on the current line."
1446 (interactive)
1447 ;; We open the bug reports.
1448 (let ((args (get-text-property (line-beginning-position) 'tabulated-list-id)))
1449 (when args (apply 'debbugs-gnu args))))
1450
1451 ;;;###autoload
1452 (defun debbugs-gnu-bugs (&rest bugs)
1453 "List all BUGS, a list of bug numbers."
1454 (interactive
1455 (mapcar 'string-to-number
1456 (completing-read-multiple "Bug numbers: " nil 'natnump)))
1457 (dolist (elt bugs)
1458 (unless (natnump elt) (signal 'wrong-type-argument (list 'natnump elt))))
1459 (add-to-list 'debbugs-gnu-current-query (cons 'bugs bugs))
1460 ;; We do not suppress bugs requested explicitely.
1461 (setq debbugs-gnu-current-suppress nil)
1462 (debbugs-gnu nil))
1463
1464 (defvar debbugs-gnu-trunk-directory "~/src/emacs/trunk/"
1465 "The directory where the main source tree lives.")
1466
1467 (defvar debbugs-gnu-branch-directory "~/src/emacs/emacs-25/"
1468 "The directory where the previous source tree lives.")
1469
1470 (defun debbugs-gnu-apply-patch (&optional branch)
1471 "Apply the patch from the current message.
1472 If given a prefix, patch in the branch directory instead."
1473 (interactive "P")
1474 (add-hook 'emacs-lisp-mode-hook 'debbugs-gnu-lisp-mode)
1475 (add-hook 'diff-mode-hook 'debbugs-gnu-diff-mode)
1476 (add-hook 'change-log-mode-hook 'debbugs-gnu-change-mode)
1477 (let ((rej "/tmp/debbugs-gnu.rej")
1478 (output-buffer (get-buffer-create "*debbugs patch*"))
1479 (dir (if branch
1480 debbugs-gnu-branch-directory
1481 debbugs-gnu-trunk-directory))
1482 (patch-buffers nil))
1483 (when (file-exists-p rej)
1484 (delete-file rej))
1485 (with-current-buffer output-buffer
1486 (erase-buffer))
1487 (gnus-summary-select-article nil t)
1488 ;; The patches are either in MIME attachements or the main article
1489 ;; buffer. Determine which.
1490 (gnus-with-article-buffer
1491 (dolist (handle (mapcar 'cdr (gnus-article-mime-handles)))
1492 (when (string-match "diff\\|patch\\|plain" (mm-handle-media-type handle))
1493 (push (cons (mm-handle-encoding handle)
1494 (mm-handle-buffer handle))
1495 patch-buffers))))
1496 (unless patch-buffers
1497 (gnus-summary-show-article 'raw)
1498 (article-decode-charset)
1499 (push (cons nil gnus-article-buffer) patch-buffers))
1500 (dolist (elem patch-buffers)
1501 (with-current-buffer (generate-new-buffer "*debbugs input patch*")
1502 (insert-buffer-substring (cdr elem))
1503 (cond ((eq (car elem) 'base64)
1504 (base64-decode-region (point-min) (point-max)))
1505 ((eq (car elem) 'quoted-printable)
1506 (quoted-printable-decode-region (point-min) (point-max))))
1507 (debbugs-gnu-fix-patch dir)
1508 (call-process-region (point-min) (point-max)
1509 "patch" nil output-buffer nil
1510 "-r" rej "--no-backup-if-mismatch"
1511 "-l" "-f"
1512 "-d" (expand-file-name dir)
1513 "-p1")))
1514 (set-buffer output-buffer)
1515 (when (file-exists-p rej)
1516 (goto-char (point-max))
1517 (insert-file-contents-literally rej))
1518 (goto-char (point-max))
1519 (save-some-buffers t)
1520 (require 'compile)
1521 (mapc 'kill-process compilation-in-progress)
1522 (compile (format "cd %s; make -k" (expand-file-name "lisp" dir)))
1523 (vc-dir dir)
1524 (vc-dir-hide-up-to-date)
1525 (goto-char (point-min))
1526 (sit-for 1)
1527 (vc-diff)
1528 ;; All these commands are asynchronous, so just wait a bit. This
1529 ;; should be done properly a different way.
1530 (sit-for 2)
1531 ;; We've now done everything, so arrange the windows we need to see.
1532 (delete-other-windows)
1533 (switch-to-buffer output-buffer)
1534 (split-window)
1535 (split-window)
1536 (other-window 1)
1537 (switch-to-buffer "*compilation*")
1538 (goto-char (point-max))
1539 (other-window 1)
1540 (switch-to-buffer "*vc-diff*")
1541 (goto-char (point-min))))
1542
1543 (defun debbugs-gnu-fix-patch (dir)
1544 (setq dir (directory-file-name (expand-file-name dir)))
1545 (goto-char (point-min))
1546 (while (re-search-forward diff-file-header-re nil t)
1547 (goto-char (match-beginning 0))
1548 (let ((target-name (car (diff-hunk-file-names))))
1549 (when (and target-name
1550 (or (not (string-match "/" target-name))
1551 (and (string-match "^[ab]/" target-name)
1552 (not (file-exists-p
1553 (expand-file-name (substring target-name 2)
1554 dir))))
1555 (file-exists-p (expand-file-name target-name dir))))
1556 ;; We have a simple patch that refers to a file somewhere in the
1557 ;; tree. Find it.
1558 (when-let ((files (directory-files-recursively
1559 dir
1560 (concat "^" (regexp-quote
1561 (file-name-nondirectory target-name))
1562 "$"))))
1563 (when (re-search-forward (concat "^[+]+ "
1564 (regexp-quote target-name)
1565 "\\([ \t\n]\\)")
1566 nil t)
1567 (replace-match (concat "+++ a"
1568 (substring (car files) (length dir))
1569 (match-string 1))
1570 nil t)))))
1571 (forward-line 2)))
1572
1573 (defun debbugs-gnu-find-contributor (string)
1574 "Search through ChangeLogs to find contributors."
1575 (interactive "sContributor match: ")
1576 (let ((found 0)
1577 (match (concat "^[0-9].*" string)))
1578 (dolist (file (directory-files-recursively
1579 debbugs-gnu-trunk-directory "ChangeLog\\(.[0-9]+\\)?$"))
1580 (with-temp-buffer
1581 (when (file-exists-p file)
1582 (insert-file-contents file))
1583 (goto-char (point-min))
1584 (while (and (re-search-forward match nil t)
1585 (not (looking-at ".*tiny change")))
1586 (cl-incf found))))
1587 (message "%s is a contributor %d times" string found)
1588 found))
1589
1590 (defvar debbugs-gnu-patch-subject nil)
1591
1592 (defun debbugs-gnu-insert-changelog ()
1593 "Add a ChangeLog from a recently applied patch from a third party."
1594 (interactive)
1595 (let (from subject patch-subject changelog)
1596 (gnus-with-article-buffer
1597 (widen)
1598 (goto-char (point-min))
1599 (setq from (mail-extract-address-components (gnus-fetch-field "from"))
1600 subject (gnus-fetch-field "subject"))
1601 ;; If it's a patch formatted the right way, extract that data.
1602 (dolist (handle (mapcar 'cdr (gnus-article-mime-handles)))
1603 (when (string-match "diff\\|patch\\|plain"
1604 (mm-handle-media-type handle))
1605 (with-temp-buffer
1606 (insert-buffer-substring (mm-handle-buffer handle))
1607 (cond ((eq (mm-handle-encoding handle) 'base64)
1608 (base64-decode-region (point-min) (point-max)))
1609 ((eq (mm-handle-encoding handle) 'quoted-printable)
1610 (quoted-printable-decode-region (point-min) (point-max))))
1611 (setq patch-subject
1612 (or (gnus-fetch-field "subject") patch-subject))
1613 (goto-char (point-min))
1614 (when (re-search-forward "^[*] " nil t)
1615 (let ((start (match-beginning 0)))
1616 (while (and (not (eobp))
1617 (not (looking-at "---")))
1618 (forward-line 1))
1619 (setq changelog (buffer-substring
1620 start (line-end-position 0)))))))))
1621 (let ((add-log-full-name (car from))
1622 (add-log-mailing-address (cadr from)))
1623 (add-change-log-entry-other-window)
1624 (when patch-subject
1625 (setq-local debbugs-gnu-patch-subject patch-subject))
1626 (when changelog
1627 (delete-region (line-beginning-position) (point-max))
1628 (save-restriction
1629 (narrow-to-region (point) (point))
1630 (insert changelog)
1631 (indent-region (point-min) (point-max))))
1632 (let ((point (point)))
1633 (when (string-match "\\(bug#[0-9]+\\)" subject)
1634 (insert " (" (match-string 1 subject) ")."))
1635 (when (zerop (debbugs-gnu-find-contributor
1636 (let ((bits (split-string (car from))))
1637 (cond
1638 ((>= (length bits) 2)
1639 (format "%s.*%s" (car bits) (car (last bits))))
1640 ((= (length bits) 1)
1641 (car bits))
1642 ;; Fall back on the email address.
1643 (t
1644 (cadr from))))))
1645 (goto-char (point-max))
1646 (end-of-line)
1647 (when changelog
1648 (insert "\n\n"))
1649 (insert " Copyright-paperwork-exempt: yes"))
1650 (goto-char point)))))
1651
1652 (defvar debbugs-gnu-lisp-mode-map
1653 (let ((map (make-sparse-keymap)))
1654 (define-key map [(meta m)] 'debbugs-gnu-insert-changelog)
1655 map))
1656
1657 (define-minor-mode debbugs-gnu-lisp-mode
1658 "Minor mode for providing a debbugs interface in Lisp buffers.
1659 \\{debbugs-gnu-lisp-mode-map}"
1660 :lighter " Debbugs" :keymap debbugs-gnu-lisp-mode-map)
1661
1662 (defvar debbugs-gnu-diff-mode-map
1663 (let ((map (make-sparse-keymap)))
1664 (define-key map [(meta m)] 'debbugs-gnu-diff-select)
1665 map))
1666
1667 (define-minor-mode debbugs-gnu-diff-mode
1668 "Minor mode for providing a debbugs interface in diff buffers.
1669 \\{debbugs-gnu-diff-mode-map}"
1670 :lighter " Debbugs" :keymap debbugs-gnu-diff-mode-map)
1671
1672 (defun debbugs-gnu-diff-select ()
1673 "Select the diff under point."
1674 (interactive)
1675 (delete-other-windows)
1676 (diff-goto-source))
1677
1678 (defvar debbugs-gnu-change-mode-map
1679 (let ((map (make-sparse-keymap)))
1680 (define-key map [(meta m)] 'debbugs-gnu-change-checkin)
1681 map))
1682
1683 (define-minor-mode debbugs-gnu-change-mode
1684 "Minor mode for providing a debbugs interface in ChangeLog buffers.
1685 \\{debbugs-gnu-change-mode-map}"
1686 :lighter " Debbugs" :keymap debbugs-gnu-change-mode-map)
1687
1688 (defun debbugs-gnu-change-checkin ()
1689 "Prepare checking in the current changes."
1690 (interactive)
1691 (save-some-buffers t)
1692 (when (get-buffer "*vc-dir*")
1693 (kill-buffer (get-buffer "*vc-dir*")))
1694 (let ((patch-subject debbugs-gnu-patch-subject))
1695 (let ((trunk (expand-file-name debbugs-gnu-trunk-directory)))
1696 (if (equal (cl-subseq default-directory 0 (length trunk))
1697 trunk)
1698 (vc-dir debbugs-gnu-trunk-directory)
1699 (vc-dir debbugs-gnu-branch-directory)))
1700 (goto-char (point-min))
1701 (while (not (search-forward "edited" nil t))
1702 (sit-for 0.01))
1703 (beginning-of-line)
1704 (while (search-forward "edited" nil t)
1705 (vc-dir-mark)
1706 (beginning-of-line))
1707 (vc-diff nil)
1708 (vc-next-action nil)
1709 (delete-region (point-min) (point-max))
1710 (log-edit-insert-changelog t)
1711 (delete-other-windows)
1712 (split-window)
1713 (other-window 1)
1714 (switch-to-buffer "*vc-diff*")
1715 (other-window 1)
1716 (when patch-subject
1717 (insert "Summary: "
1718 (replace-regexp-in-string "^ *\\[PATCH\\] *" "" patch-subject)
1719 "\n"))))
1720
1721 (defun debbugs-gnu-save-cache ()
1722 "Save the bugs cache to a file."
1723 (interactive)
1724 (unless debbugs-cache-data
1725 (error "No data to cache"))
1726 (unless (file-exists-p "~/.emacs.d/debbugs-cache")
1727 (make-directory "~/.emacs.d/debbugs-cache" t))
1728 (let ((coding-system-for-write 'utf-8))
1729 (with-temp-file "~/.emacs.d/debbugs-cache/list"
1730 (prin1 debbugs-cache-data (current-buffer)))))
1731
1732 (provide 'debbugs-gnu)
1733
1734 ;;; TODO:
1735
1736 ;; * Another random thought - is it possible to implement some local
1737 ;; cache, so only changed bugs are fetched? Glenn Morris.
1738
1739 ;;; debbugs-gnu.el ends here