- (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.
+ '<)))