From 95a44ae08bca795b34971b3dfa63c1d44b99f5ce Mon Sep 17 00:00:00 2001 From: Nathaniel Nicandro Date: Tue, 23 Oct 2018 20:16:25 -0500 Subject: [PATCH] jupyter-repl-propagate-client: Update documentation --- jupyter-repl.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/jupyter-repl.el b/jupyter-repl.el index 2ba2deb..0967116 100644 --- a/jupyter-repl.el +++ b/jupyter-repl.el @@ -2707,7 +2707,24 @@ If CLIENT is a buffer or the name of a buffer, use the (defun jupyter-repl-propagate-client (win-or-buffer &rest args) "Propagate the `jupyter-current-client' to other buffers. -Only intended to be added as advice to `switch-to-buffer', +WIN-OR-BUFFER is either a window that will display the buffer +that should be checked or the buffer itself. In the case that +WIN-OR-BUFFER is a window, the first element of ARGS is assumed +to be the buffer to check. + +If the checked buffer is not in `jupyter-repl-interaction-mode' +and has the same `major-mode' as the `jupyter-current-client's +language mode, set `jupyter-current-client' in the checked buffer +to the same value as the `jupyter-current-client' of the +`current-buffer'. + +If the `current-buffer' is not in +`jupyter-repl-interaction-mode', use the first buffer returned by +`jupyter-repl-available-repl-buffers' for the checked buffer's +`major-mode' as the buffer from which to propagate its value of +`jupyter-current-client'. + +NOTE: Only intended to be added as advice to `switch-to-buffer', `display-buffer', or `set-window-buffer'." (let* ((other-buffer (if (or (null win-or-buffer) (windowp win-or-buffer))