[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/debbugs 74b2e16 093/311: * Debbugs.wsdl: Add get_userta
From: |
Stefan Monnier |
Subject: |
[elpa] externals/debbugs 74b2e16 093/311: * Debbugs.wsdl: Add get_usertag specification. |
Date: |
Sun, 29 Nov 2020 18:41:47 -0500 (EST) |
branch: externals/debbugs
commit 74b2e16b5a19508abb5588c3c9897185fbf5dcf3
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
* Debbugs.wsdl: Add get_usertag specification.
* debbugs.el (debbugs-get-usertag): New defun.
* debbugs-gnu.el (debbugs-gnu-all-severities)
(debbugs-gnu-all-packages): New defconst.
(debbugs-gnu-search, debbugs-gnu): Use them.
(debbugs-gnu, debbugs-gnu-get-bugs): Handle user tags.
(debbugs-gnu-show-reports): Kill buffer initially, in order to
get rid of old local variables.
(debbugs-gnu-current-query): New defun.
(debbugs-gnu-display-status): Display also the query. Use `special-mode'.
---
Debbugs.wsdl | 45 +++++++++++++++++++--
debbugs-gnu.el | 122 ++++++++++++++++++++++++++++++++++++---------------------
debbugs.el | 45 +++++++++++++++++++--
3 files changed, 161 insertions(+), 51 deletions(-)
diff --git a/Debbugs.wsdl b/Debbugs.wsdl
index 4a99550..aefb427 100644
--- a/Debbugs.wsdl
+++ b/Debbugs.wsdl
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2011 Free Software Foundation, Inc.
+<!-- Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -18,8 +18,8 @@ You should have received a copy of the GNU General Public
License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. -->
<!-- This file describes the bindings of the debbugs SOAP interface
-(see <http://wiki.debian.org/DebbugsSoapInterface>). The operations
-"get_usertag" and "get_versions" are not contained (yet). -->
+(see <http://wiki.debian.org/DebbugsSoapInterface>). The operation
+"get_versions" is not contained (yet). -->
<wsdl:definitions
name="Debbugs/SOAP"
@@ -116,6 +116,14 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. -->
<wsdl:part name="soapenc:Array" type="types:ArrayOfBugNumber"/>
</wsdl:message>
+ <wsdl:message name="get_usertagRequest">
+ <wsdl:part name="user" type="xsd:string"/>
+ <!-- We do not support tags -->
+ </wsdl:message>
+ <wsdl:message name="get_usertagResponse">
+ <wsdl:part name="s-gensym3" type="xsd:anyType"/>
+ </wsdl:message>
+
<wsdl:message name="newest_bugsRequest">
<wsdl:part name="amount" type="xsd:int"/>
</wsdl:message>
@@ -177,6 +185,21 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. -->
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="get_usertag" parameterOrder="user">
+ <wsdl:input message="tns:get_usertagRequest">
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:input>
+ <wsdl:output message="tns:get_usertagResponse">
+ <soap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
+
<wsdl:operation name="newest_bugs" parameterOrder="amount">
<wsdl:input message="tns:newest_bugsRequest">
<soap:body
@@ -258,6 +281,22 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. -->
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="get_usertag">
+ <wsdlsoap:operation soapAction="Debbugs/SOAP"/>
+ <wsdl:input name="get_tagRequest">
+ <wsdlsoap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:input>
+ <wsdl:output name="get_tagResponse">
+ <wsdlsoap:body
+ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+ namespace="urn:Debbugs/SOAP"
+ use="encoded"/>
+ </wsdl:output>
+ </wsdl:operation>
+
<wsdl:operation name="newest_bugs">
<wsdlsoap:operation soapAction="Debbugs/SOAP"/>
<wsdl:input name="newest_bugsRequest">
diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index ca4d73c..35e4124 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -46,8 +46,12 @@
;; used, although configured on the GNU bug tracker. If no severity
;; is given, all bugs are selected.
-;; There is also the pseudo severity "tagged", which selects locally
-;; tagged bugs.
+;; There is also the pseudo severity "tagged". When it is used, the
+;; function will ask for user tags (a comma separated list), and shows
+;; just the bugs which are tagged with them. In general, user tags
+;; shall be strings denoting to subprojects of the package, like
+;; "cedet" or "tramp" of the package "emacs. If no user tag is given,
+;; locally tagged bugs are shown.
;; If a prefix is given to the command, more search parameters are
;; asked for, like packages (also a comma separated list, "emacs" is
@@ -135,6 +139,10 @@
(const "tagged"))
:version "24.1")
+(defconst debbugs-gnu-all-severities
+ "*List of all possible severities."
+ (mapcar 'cadr (cdr (get 'debbugs-gnu-default-severities 'custom-type))))
+
(defcustom debbugs-gnu-default-packages '("emacs")
"*The list of packages to be searched for."
;; <http://debbugs.gnu.org/Packages.html>
@@ -151,6 +159,10 @@
(const "woodchuck"))
:version "24.1")
+(defconst debbugs-gnu-all-packages
+ "*List of all possible package names."
+ (mapcar 'cadr (cdr (get 'debbugs-gnu-default-packages 'custom-type))))
+
(defcustom debbugs-gnu-default-hits-per-page 500
"*The number of bugs shown per page."
:group 'debbugs-gnu
@@ -281,20 +293,15 @@ marked as \"client-side filter\"."
(setq
severities
(completing-read-multiple
- "Enter severities: "
- (mapcar
- 'cadr (cdr (get 'debbugs-gnu-default-severities 'custom-type)))
- nil t
+ "Enter severities: " debbugs-gnu-all-severities nil t
(mapconcat 'identity debbugs-gnu-default-severities ","))))
((equal key "package")
(setq
packages
(completing-read-multiple
- "Enter packages: "
- (mapcar
- 'cadr (cdr (get 'debbugs-gnu-default-packages 'custom-type)))
- nil t (mapconcat 'identity debbugs-gnu-default-packages ","))))
+ "Enter packages: " debbugs-gnu-all-packages nil t
+ (mapconcat 'identity debbugs-gnu-default-packages ","))))
((equal key "archive")
;; We simplify, by assuming just archived bugs are requested.
@@ -382,26 +389,28 @@ marked as \"client-side filter\"."
debbugs-gnu-current-filter nil)))
;;;###autoload
-(defun debbugs-gnu (severities &optional packages archivedp suppress)
+(defun debbugs-gnu (severities &optional packages archivedp suppress usertags)
"List all outstanding Emacs bugs."
(interactive
- (let (archivedp)
+ (let (severities archivedp)
(list
- (completing-read-multiple
- "Severities: "
- (mapcar 'cadr (cdr (get 'debbugs-gnu-default-severities 'custom-type)))
- nil t (mapconcat 'identity debbugs-gnu-default-severities ","))
- ;; The optional parameters are asked only when there is a prefix.
+ (setq severities
+ (completing-read-multiple
+ "Severities: " debbugs-gnu-all-severities nil t
+ (mapconcat 'identity debbugs-gnu-default-severities ",")))
+ ;; The next parameters are asked only when there is a prefix.
(if current-prefix-arg
(completing-read-multiple
- "Packages: "
- (mapcar 'cadr (cdr (get 'debbugs-gnu-default-packages 'custom-type)))
- nil t (mapconcat 'identity debbugs-gnu-default-packages ","))
+ "Packages: " debbugs-gnu-all-packages nil t
+ (mapconcat 'identity debbugs-gnu-default-packages ","))
debbugs-gnu-default-packages)
(when current-prefix-arg
(setq archivedp (y-or-n-p "Show archived bugs?")))
(when (and current-prefix-arg (not archivedp))
- (y-or-n-p "Suppress unwanted bugs?")))))
+ (y-or-n-p "Suppress unwanted bugs?"))
+ ;; This one must be asked for severity "tagged".
+ (when (member "tagged" severities)
+ (split-string (read-string "User tag(s): ") "," t)))))
;; Initialize variables.
(when (and (file-exists-p debbugs-gnu-persistency-file)
@@ -420,6 +429,9 @@ marked as \"client-side filter\"."
(add-to-list 'debbugs-gnu-current-query (cons 'package package))))
(when archivedp
(add-to-list 'debbugs-gnu-current-query '(archive . "1")))
+ (dolist (usertag (if (consp usertags) usertags (list usertags)))
+ (when (not (zerop (length usertag)))
+ (add-to-list 'debbugs-gnu-current-query (cons 'usertag usertag))))
(unwind-protect
(let ((hits debbugs-gnu-default-hits-per-page)
@@ -482,9 +494,12 @@ marked as \"client-side filter\"."
(tagged (when (member '(severity . "tagged") query)
(copy-sequence debbugs-gnu-local-tags)))
(phrase (assoc 'phrase query))
- args)
- ;; Compile query arguments.
- (unless query
+ usertags args)
+ ;; Compile query and usertags arguments.
+ (dolist (elt query)
+ (when (equal (car elt) 'usertag)
+ (add-to-list 'usertags (cdr elt))))
+ (unless (or query usertags)
(dolist (elt debbugs-gnu-default-packages)
(setq args (append args (list :package elt)))))
(dolist (elt query)
@@ -505,20 +520,28 @@ marked as \"client-side filter\"."
(list (intern (concat ":" (symbol-name (car elt))))
(cdr elt)))))))
- (cond
- ;; If the query contains only the pseudo-severity "tagged", we
- ;; return just the local tagged bugs.
- ((and tagged (not (memq :severity args)))
- (sort tagged '<))
- ;; A full text query.
- (phrase
- (append
- (mapcar
- (lambda (x) (cdr (assoc "id" x)))
- (apply 'debbugs-search-est args))
- tagged))
- ;; Otherwise, we retrieve the bugs from the server.
- (t (sort (append (apply 'debbugs-get-bugs args) tagged) '<)))))
+ (sort
+ (cond
+ ;; If the query contains only the pseudo-severity "tagged", we
+ ;; return just the local tagged bugs.
+ ((and tagged (not usertags) (not (memq :severity args))) tagged)
+ ;; A full text query.
+ (phrase
+ (append
+ (mapcar
+ (lambda (x) (cdr (assoc "id" x)))
+ (apply 'debbugs-search-est args))
+ tagged))
+ ;; User tags.
+ (usertags
+ (let (result)
+ (dolist (elt packages result)
+ (setq result
+ (append result (apply 'debbugs-get-usertag elt usertags))))))
+ ;; Otherwise, we retrieve the bugs from the server.
+ (t (append (apply 'debbugs-get-bugs args) tagged)))
+ ;; Sort function.
+ '<)))
(defvar debbugs-gnu-current-widget nil)
(defvar debbugs-gnu-current-limit nil)
@@ -527,13 +550,16 @@ marked as \"client-side filter\"."
(defun debbugs-gnu-show-reports (widget)
"Show bug reports as given in WIDGET property :bug-ids."
+ ;; The tabulated mode sets several local variables. We must get rid
+ ;; of them.
+ (when (get-buffer (widget-get widget :buffer-name))
+ (kill-buffer (widget-get widget :buffer-name)))
(pop-to-buffer (get-buffer-create (widget-get widget :buffer-name)))
(debbugs-gnu-mode)
(let ((inhibit-read-only t)
(debbugs-port "gnu.org"))
(erase-buffer)
- (set (make-local-variable 'debbugs-gnu-current-widget)
- widget)
+ (set (make-local-variable 'debbugs-gnu-current-widget) widget)
(dolist (status (apply 'debbugs-get-status (widget-get widget :bug-ids)))
(let* ((id (cdr (assq 'id status)))
@@ -930,13 +956,19 @@ Subject fields."
(defun debbugs-gnu-current-status ()
(get-text-property (line-beginning-position) 'tabulated-list-id))
-(defun debbugs-gnu-display-status (status)
- "Display the status of the report on the current line."
- (interactive (list (debbugs-gnu-current-status)))
+(defun debbugs-gnu-current-query ()
+ (widget-get debbugs-gnu-current-widget :query))
+
+(defun debbugs-gnu-display-status (query status)
+ "Display the query and status of the report on the current line."
+ (interactive (list (debbugs-gnu-current-query)
+ (debbugs-gnu-current-status)))
(pop-to-buffer "*Bug Status*")
(erase-buffer)
- (pp status (current-buffer))
- (goto-char (point-min)))
+ (when query (pp query (current-buffer)))
+ (when status (pp status (current-buffer)))
+ (goto-char (point-min))
+ (special-mode))
(defun debbugs-gnu-select-report ()
"Select the report on the current line."
diff --git a/debbugs.el b/debbugs.el
index ad8c810..adb0ce4 100644
--- a/debbugs.el
+++ b/debbugs.el
@@ -27,8 +27,7 @@
;; This package provides some basic functions to access a debbugs SOAP
;; server (see <http://wiki.debian.org/DebbugsSoapInterface>).
-;; The SOAP functions "get_usertag" and "get_versions" are not
-;; implemented (yet).
+;; The SOAP function "get_versions" is not implemented (yet).
;;; Code:
@@ -274,7 +273,7 @@ Example:
\(debbugs-get-status 10)
- => ;; Attributes with empty values are not show
+ => ;; Attributes with empty values are not shown
\(\(\(bug_num . 10)
\(source . \"unknown\")
\(date . 1203606305.0)
@@ -321,6 +320,46 @@ Example:
(cdr (assoc 'value x))))
object))))
+(defun debbugs-get-usertag (user &rest tags)
+ "Return a list of bug numbers which are tagged by USER.
+
+USER, a string, is either the email address of the user who has
+applied a user tag, or a pseudo-user like \"emacs\". Usually,
+pseudo-users are package names.
+
+TAGS is a list of strings applied as user tags. The returning
+bug numbers list is filtered for these tags.
+
+If TAGS is nil, no bug numbers will be returned but a list of
+existing tags for USER.
+
+Example:
+
+ \(debbugs-get-usertag \"emacs\")
+
+ => (\"www\" \"solaris\" \"ls-lisp\" \"cygwin\")
+
+ \(debbugs-get-usertag \"emacs\" \"www\" \"cygwin\")
+
+ => (807 1223 5637)"
+ (when (stringp user)
+ (let ((object
+ (car (soap-invoke debbugs-wsdl debbugs-port "get_usertag" user)))
+ result)
+ (if (null tags)
+ ;; Return the list of existing tags.
+ (mapcar
+ (lambda (x) (symbol-name (car x)))
+ object)
+
+ ;; Return bug numbers.
+ (mapcar
+ (lambda (x)
+ (when (member (symbol-name (car x)) tags)
+ (setq result (append (cdr x) result))))
+ object)
+ (sort result '<)))))
+
(defun debbugs-get-bug-log (bug-number)
"Return a list of messages related to BUG-NUMBER.
- [elpa] externals/debbugs c3826d1 134/311: Add *.info and dir to debbugs, (continued)
- [elpa] externals/debbugs c3826d1 134/311: Add *.info and dir to debbugs, Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 9d44129 136/311: Grammar fixes in debbugs manuals, Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 4e3b14c 152/311: Update branch directory, Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 5447e7b 158/311: * debbugs-gnu.el (debbugs-gnu-fix-patch): Further patch path fixups., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 19bd860 105/311: * debbugs-gnu.el : Require wid-edit.el., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 234c1d0 058/311: * debbugs-gnu.el (debbugs-gnu-default-severities), Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs cc9e0a0 075/311: Upgrade package version to 0.3., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 10f4c37 090/311: Clear up the current limit when narrowing., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs f4a0a4b 091/311: Adapt copyright year., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs e4c3368 092/311: (debbugs-gnu-default-packages): Add "fm" to the choices., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 74b2e16 093/311: * Debbugs.wsdl: Add get_usertag specification.,
Stefan Monnier <=
- [elpa] externals/debbugs 2e4ea48 098/311: * debbugs-gnu.el (debbugs-gnu-usertags): Rename argument to USERS, Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs d80d972 099/311: * debbugs.el:, Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 7693594 101/311: Fix the copyright section to point out that it's not part of Emacs., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 294b51c 102/311: Don't explicitly bind mouse-1., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 9896d90 103/311: Revert the previous copyright change., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 6a96eb7 109/311: * debbugs-gnu.el (debbugs-gnu-default-packages): Add packages., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 9668e1f 110/311: Fix typo., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 799bc0e 111/311: * debbugs-org.el: New file., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs d710aff 114/311: * debbugs-org.el (debbugs-org-show-reports): Add a minor mode header line., Stefan Monnier, 2020/11/29
- [elpa] externals/debbugs 99fd49a 115/311: * debbugs-gnu.el (debbugs-gnu): Handle SUPPRESS properly., Stefan Monnier, 2020/11/29