emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/detached 640ad8a8dd 07/22: Remove the need for detached


From: ELPA Syncer
Subject: [elpa] externals/detached 640ad8a8dd 07/22: Remove the need for detached-shell-history-file
Date: Mon, 30 May 2022 10:57:30 -0400 (EDT)

branch: externals/detached
commit 640ad8a8ddcd1cdc841a2dda197bbc7fe2c6c202
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Remove the need for detached-shell-history-file
---
 detached-shell.el | 19 +++++--------------
 detached.el       |  2 --
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/detached-shell.el b/detached-shell.el
index 62a420a450..fc4864051c 100644
--- a/detached-shell.el
+++ b/detached-shell.el
@@ -37,11 +37,6 @@
   :group 'detached
   :type 'plist)
 
-(defcustom detached-shell-history-file nil
-  "File to store history."
-  :type 'string
-  :group 'detached)
-
 ;;;; Functions
 
 (defun detached-shell-select-session ()
@@ -109,13 +104,13 @@ cluttering the comint-history with dtach commands."
    (let* ((history-file (cond ((string= shell--start-prog "bash") 
"~/.bash_history")
                               ((string= shell--start-prog "ksh") 
"~/.sh_history")
                               ((string= shell--start-prog "zsh") 
"~/.zsh_history")
-                              (t nil)))
-          (comint-input-ring-file-name
+                              (t nil))))
+     (setq comint-input-ring-file-name
            (if history-file
                (concat
                 (file-remote-p default-directory)
                 history-file)
-             comint-input-ring-file-name)))
+             comint-input-ring-file-name))
      (apply orig-fun args)
      (advice-remove 'comint-read-input-ring 
#'detached-shell--comint-read-input-ring-advice))))
 
@@ -123,16 +118,12 @@ cluttering the comint-history with dtach commands."
   "Save `shell' history."
   (with-connection-local-variables
    (unless (string-prefix-p detached--shell-command-buffer (buffer-name))
-     (let* ((inhibit-message t)
-            (comint-input-ring-file-name
-             (concat
-              (file-remote-p default-directory)
-              detached-shell-history-file)))
+     (let* ((inhibit-message t))
        (comint-write-input-ring)))))
 
 ;;;###autoload
 (defun detached-shell-override-history (orig-fun &rest args)
-  "Override history to read `detached-shell-history-file' in ORIG-FUN with 
ARGS.
+  "Override history in ORIG-FUN with ARGS.
 
 This function also makes sure that the HISTFILE is disabled for local shells."
   (cl-letf (((getenv "HISTFILE") ""))
diff --git a/detached.el b/detached.el
index f225c48896..045ee462f0 100644
--- a/detached.el
+++ b/detached.el
@@ -184,8 +184,6 @@ Valid values are: create, new and attach")
   "Variable to specify the origin of the session.")
 (defvar detached-session-action nil
   "A property list of actions for a session.")
-;; TODO Consider removing `detached-shell-command-history' if the new
-;; history override solution works.
 (defvar detached-shell-command-history nil
   "History of commands run with `detached-shell-command'.")
 (defvar detached-local-session nil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]