aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBasil L. Contovounesios <contovob@tcd.ie>2018-01-21 17:41:43 +0000
committerBasil L. Contovounesios <contovob@tcd.ie>2018-01-21 17:41:43 +0000
commit92b4223f8cfc7bddbe976a94af0901ef438a4ff2 (patch)
treebdc8bbe97c27f1b95a34f682e4e21c0fc658c347
parent9488c03726464e4bd0ed0b448d203c5c7f8c212f (diff)
Use get-window-with-predicate
-rw-r--r--sx-question-list.el2
-rw-r--r--sx-question-mode.el10
2 files changed, 6 insertions, 6 deletions
diff --git a/sx-question-list.el b/sx-question-list.el
index ea91045..32451ed 100644
--- a/sx-question-list.el
+++ b/sx-question-list.el
@@ -525,7 +525,7 @@ that may currently be there."
(interactive "p")
(sx-question-list-next n)
(sx-question-mode--display
- (tabulated-list-get-id)
+ (tabulated-list-get-id)
(sx-question-list--create-question-window)))
(defun sx-question-list--create-question-window ()
diff --git a/sx-question-mode.el b/sx-question-mode.el
index 4263f6e..b73afef 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -53,11 +53,11 @@ Common values for this variable are `pop-to-buffer' and `switch-to-buffer'."
(defun sx-question-mode--get-window ()
"Return a window displaying a question, or nil."
- (car-safe
- (cl-member-if
- (lambda (x) (with-selected-window x
- (derived-mode-p 'sx-question-mode)))
- (window-list nil 'never nil))))
+ (get-window-with-predicate
+ (lambda (win)
+ (with-selected-window win
+ (derived-mode-p 'sx-question-mode)))
+ 'never))
(defun sx-question-mode--display (data &optional window)
"Display question given by DATA on WINDOW.