X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/83821f496144e59633860e288189f943ba958b74..4aea9615e0c5a16b0434f0f811198f34b4f48309:/packages/debbugs/debbugs-gnu.el diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el index 316a654d1..dd1fe3346 100644 --- a/packages/debbugs/debbugs-gnu.el +++ b/packages/debbugs/debbugs-gnu.el @@ -1,4 +1,4 @@ -;;; debbugs-gnu.el --- interface for the GNU bug tracker +;;; debbugs-gnu.el --- interface for the GNU bug tracker -*- lexical-binding:t -*- ;; Copyright (C) 2011-2016 Free Software Foundation, Inc. @@ -141,8 +141,8 @@ (require 'debbugs) (require 'tabulated-list) (require 'add-log) -(require 'subr-x) -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'subr-x)) +(eval-when-compile (require 'cl-lib)) (autoload 'article-decode-charset "gnus-art") (autoload 'diff-goto-source "diff-mode") @@ -205,6 +205,12 @@ (const "tagged")) :version "24.1") +(defcustom debbugs-gnu-suppress-closed t + "If non-nil, don't show closed bugs." + :group 'debbugs-gnu + :type 'boolean + :version "25.2") + (defconst debbugs-gnu-all-severities (mapcar 'cadr (cdr (get 'debbugs-gnu-default-severities 'custom-type))) "*List of all possible severities.") @@ -336,6 +342,12 @@ between the words, AND is used by default. The phrase can also be empty, in this case only the following attributes are used for search.")) +;;;###autoload +(defun debbugs-gnu-patches () + "List the bug reports that have been marked as containing a patch." + (interactive) + (debbugs-gnu nil '("emacs") nil nil "patch")) + ;;;###autoload (defun debbugs-gnu-search () "Search for Emacs bugs interactively. @@ -356,7 +368,10 @@ marked as \"client-side filter\"." (setq phrase nil) (add-to-list 'debbugs-gnu-current-query (cons 'phrase phrase))) ;; We suppress closed bugs if there is no phrase. - (setq debbugs-gnu-current-suppress (null phrase)) + (setq debbugs-gnu-current-suppress + (if (not debbugs-gnu-suppress-closed) + nil + (null phrase))) ;; The other queries. (catch :finished @@ -500,7 +515,8 @@ marked as \"client-side filter\"." (insert-file-contents debbugs-gnu-persistency-file) (eval (read (current-buffer))))) ;; Per default, we suppress retrieved unwanted bugs. - (when (called-interactively-p 'any) + (when (and (called-interactively-p 'any) + debbugs-gnu-suppress-closed) (setq debbugs-gnu-current-suppress t)) ;; Add queries. @@ -572,10 +588,6 @@ marked as \"client-side filter\"." (mapcar (lambda (x) (cdr (assoc "id" x))) (apply 'debbugs-search-est args))) - ;; User tags. - (tags - (setq args (mapcar (lambda (x) (if (eq x :package) :user x)) args)) - (apply 'debbugs-get-usertag args)) ;; Otherwise, we retrieve the bugs from the server. (t (apply 'debbugs-get-bugs args))))) @@ -666,8 +678,11 @@ are taken from the cache instead." 'debbugs-gnu-done) ((member "pending" (cdr (assq 'keywords status))) 'debbugs-gnu-pending) - ((= (cdr (assq 'date status)) - (cdr (assq 'log_modified status))) + ;; For some new bugs `date' and `log_modified' may + ;; differ in 1 second. + ((< (abs (- (cdr (assq 'date status)) + (cdr (assq 'log_modified status)))) + 3) 'debbugs-gnu-new) ((< (- (float-time) (cdr (assq 'log_modified status))) @@ -715,7 +730,8 @@ Used instead of `tabulated-list-print-entry'." (submitter (aref cols 2)) (submitter-length (nth 1 (aref tabulated-list-format 2))) (title (aref cols 3)) - (title-length (nth 1 (aref tabulated-list-format 3)))) + ;; (title-length (nth 1 (aref tabulated-list-format 3))) + ) (when (and ;; We may have a narrowing in effect. (or (not debbugs-gnu-limit) @@ -949,7 +965,7 @@ The following commands are available: t) (t nil)))) -(defun debbugs-gnu-sort-title (s1 s2) +(defun debbugs-gnu-sort-title (s1 _s2) (let ((owner (if (cdr (assq 'owner (car s1))) (car (mail-header-parse-address (decode-coding-string (cdr (assq 'owner (car s1))) @@ -1263,9 +1279,9 @@ removed instead." "usertag") nil t) current-prefix-arg)) - (let* ((id (or debbugs-gnu-bug-number ; Set on group entry. - (debbugs-gnu-guess-current-id) - (debbugs-gnu-current-id))) + (let* ((id (or (debbugs-gnu-current-id t) + debbugs-gnu-bug-number ; Set on group entry. + (debbugs-gnu-guess-current-id))) (version (when (member message '("close" "done")) (read-string