branch: externals/detached commit 1604a7b5b8a593eb2c29222e9898bfe3f1348ebe Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Make detached-buffer-session public --- detached-compile.el | 4 ++-- detached-eshell.el | 8 ++++---- detached-list.el | 2 +- detached-shell.el | 4 ++-- detached-vterm.el | 4 ++-- detached.el | 20 ++++++++++---------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/detached-compile.el b/detached-compile.el index e19ac4a882..825459bd55 100644 --- a/detached-compile.el +++ b/detached-compile.el @@ -76,7 +76,7 @@ Optionally EDIT-COMMAND." (defun detached-compile-kill () "Kill a 'detached' session." (interactive) - (detached-kill-session detached--buffer-session)) + (detached-kill-session detached-buffer-session)) ;;;;; Functions @@ -98,7 +98,7 @@ Optionally EDIT-COMMAND." "Run in `compilation-start-hook' if `detached-enabled'." (when detached-enabled (setq-local default-directory (detached--session-working-directory detached-current-session)) - (setq detached--buffer-session detached-current-session) + (setq detached-buffer-session detached-current-session) (setq compile-command (detached--session-command detached-current-session)) (setq compilation-arguments nil) (detached-compile--replace-modesetter) diff --git a/detached-eshell.el b/detached-eshell.el index 7612bf2e2e..29248dcc5e 100644 --- a/detached-eshell.el +++ b/detached-eshell.el @@ -53,7 +53,7 @@ (detached-session-start-command session :type 'list))) (advice-remove #'eshell-external-command #'detached-eshell-external-command) - (setq detached--buffer-session session) + (setq detached-buffer-session session) (setq detached-enabled nil) (apply orig-fun `(,(seq-first command) ,(seq-rest command))))) @@ -92,7 +92,7 @@ If prefix-argument directly DETACH from the session." (overlay-put (make-overlay begin end) 'invisible t) (overlay-put (make-overlay end end) 'before-string "[attached]") (insert " ")) - (setq detached--buffer-session session) + (setq detached-buffer-session session) (call-interactively #'eshell-send-input)) (detached-open-session session)))) @@ -116,9 +116,9 @@ If prefix-argument directly DETACH from the session." (cl-defmethod detached--detach-session ((_mode (derived-mode eshell-mode))) "Detach from session when MODE is `eshell-mode'." - (when-let ((active-session (detached-session-active-p detached--buffer-session)) + (when-let ((active-session (detached-session-active-p detached-buffer-session)) (dtach-process (detached-eshell--get-dtach-process))) - (setq detached--buffer-session nil) + (setq detached-buffer-session nil) (process-send-string dtach-process detached--dtach-detach-character))) diff --git a/detached-list.el b/detached-list.el index 6310eee9cf..5b406bdc05 100644 --- a/detached-list.el +++ b/detached-list.el @@ -749,7 +749,7 @@ If prefix-argument is provided unmark instead of mark." (seq-find (lambda (buffer) (with-current-buffer buffer - (when-let ((buffer-session detached--buffer-session) + (when-let ((buffer-session detached-buffer-session) (buffer-session-id (detached-session-id buffer-session))) (eq buffer-session-id id)))) (buffer-list)))) diff --git a/detached-shell.el b/detached-shell.el index c080b87c5b..8e0f44773e 100644 --- a/detached-shell.el +++ b/detached-shell.el @@ -79,7 +79,7 @@ cluttering the `comint-history' with dtach commands." (cl-letf ((detached-current-session session) (comint-input-sender #'detached-shell--attach-input-sender) ((symbol-function 'comint-add-to-input-history) (lambda (_) t))) - (setq detached--buffer-session session) + (setq detached-buffer-session session) (let ((kill-ring nil)) (comint-kill-input)) (insert "[attached]") @@ -113,7 +113,7 @@ cluttering the `comint-history' with dtach commands." (detached-create-session (substring-no-properties string))) (command (detached-session-start-command session :type 'string))) - (setq detached--buffer-session session) + (setq detached-buffer-session session) (comint-simple-send proc command)))) (defun detached-shell--comint-read-input-ring-advice (orig-fun &rest args) diff --git a/detached-vterm.el b/detached-vterm.el index 5c5b89eef7..c62fb8f1f0 100644 --- a/detached-vterm.el +++ b/detached-vterm.el @@ -64,7 +64,7 @@ Optionally DETACH from it." (vterm-send-C-a) (vterm-send-C-k) (process-send-string vterm--process command) - (setq detached--buffer-session detached-current-session) + (setq detached-buffer-session detached-current-session) (vterm-send-C-e) (vterm-send-return))) @@ -83,7 +83,7 @@ Optionally DETACH from it." (command (detached-session-attach-command session :type 'string))) - (setq detached--buffer-session session) + (setq detached-buffer-session session) (process-send-string vterm--process command) (vterm-send-return))) diff --git a/detached.el b/detached.el index 7c9fe5905b..cec91828ea 100644 --- a/detached.el +++ b/detached.el @@ -334,7 +334,7 @@ This version is encoded as [package-version].[revision].") (defvar detached--db-watch nil "A descriptor to the `detached-db-directory'.") -(defvar-local detached--buffer-session nil +(defvar-local detached-buffer-session nil "The `detached-session' session in current buffer.") (defvar detached-current-session nil @@ -458,7 +458,7 @@ The session is compiled by opening its output and enabling (run-hooks 'detached-compile-session-hooks) (detached-log-mode) (compilation-minor-mode) - (setq detached--buffer-session session) + (setq detached-buffer-session session) (setq-local font-lock-defaults '(compilation-mode-font-lock-keywords t))) (font-lock-mode) (read-only-mode) @@ -600,7 +600,7 @@ Optionally DELETE the session if prefix-argument is provided." (insert (detached-session-output session)) (setq-local default-directory (detached--session-working-directory session)) (detached-log-mode)) - (setq detached--buffer-session session) + (setq detached-buffer-session session) (goto-char (point-max))) (select-window (display-buffer buffer-name detached-open-session-display-buffer-action))) @@ -650,11 +650,11 @@ Optionally DELETE the session if prefix-argument is provided." (defun detached-detach-session () "Detach from session in current buffer. -This command is only activated if `detached--buffer-session' is an +This command is only activated if `detached-buffer-session' is an active session. For sessions created with `detached-compile' or `detached-shell-command', the command will also kill the window." (interactive) - (if-let ((has-session (detached-session-p detached--buffer-session))) + (if-let ((has-session (detached-session-p detached-buffer-session))) (detached--detach-session major-mode) (message "No detached-session found in buffer."))) @@ -731,7 +731,7 @@ Optionally SUPPRESS-OUTPUT." (setq detached-enabled nil) (funcall #'async-shell-command command buffer) (with-current-buffer buffer - (setq detached--buffer-session detached-current-session)))))) + (setq detached-buffer-session detached-current-session)))))) (defun detached-start-detached-session (session) "Start SESSION in detached mode." @@ -907,7 +907,7 @@ This function uses the `notifications' library." (funcall #'async-shell-command command buffer) (with-current-buffer buffer (setq-local default-directory (detached--session-working-directory session)) - (setq detached--buffer-session detached-current-session))))) + (setq detached-buffer-session detached-current-session))))) ;;;;; Public session functions @@ -1164,7 +1164,7 @@ This function uses the `notifications' library." (cl-defgeneric detached--get-session (_mode) "Return session." - detached--buffer-session) + detached-buffer-session) (cl-defgeneric detached--shell-command (entity &optional concat) "Return shell command for ENTITY optionally CONCAT.") @@ -1477,9 +1477,9 @@ Optionally make the path LOCAL to host." (defun detached--detach-from-comint-process () "Detach from the underlying `comint' process." - (when-let ((active-session (detached-session-active-p detached--buffer-session)) + (when-let ((active-session (detached-session-active-p detached-buffer-session)) (dtach-process (get-buffer-process (current-buffer)))) - (setq detached--buffer-session nil) + (setq detached-buffer-session nil) (comint-simple-send dtach-process detached--dtach-detach-character))) (defun detached--quit-session-buffer ()