aboutsummaryrefslogtreecommitdiff
path: root/sx-question-mode.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-01 01:00:06 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-01 01:00:06 +0000
commitbf56eba935f73c1803ea9964671a36bccb4efa21 (patch)
tree214c240a1b554586c01f00c6f8a93c77d0394dbc /sx-question-mode.el
parent570a41fbc7e7ff6f842d6bb809bc36c457784ebf (diff)
Define and use sx-question-mode-display-buffer-function
Diffstat (limited to 'sx-question-mode.el')
-rw-r--r--sx-question-mode.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/sx-question-mode.el b/sx-question-mode.el
index 01a980a..6423ad8 100644
--- a/sx-question-mode.el
+++ b/sx-question-mode.el
@@ -30,6 +30,14 @@
;;; Displaying a question
+(defcustom sx-question-mode-display-buffer-function #'switch-to-buffer
+ "Function used to display the question buffer.
+Called, for instance, when hitting \\<sx-question-list-mode-map>`\\[sx-question-list-display-question]' on an entry in the
+question list.
+This is not used when navigating the question list with `\\[sx-question-list-view-next]."
+ :type 'function
+ :group 'sx-question-mode)
+
(defvar sx-question-mode--window nil
"Window where the content of questions is displayed.")
@@ -71,7 +79,8 @@ If WINDOW is given, use that to display the buffer."
;; No window, but the buffer is already being displayed somewhere.
((get-buffer-window sx-question-mode--buffer 'visible))
;; Neither, so we create the window.
- (t (switch-to-buffer sx-question-mode--buffer)))
+ (t (funcall sx-question-mode-display-buffer-function
+ sx-question-mode--buffer)))
sx-question-mode--buffer)