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

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

[elpa] externals/detached 7f70f00340: Rename remote/local to remotehost/


From: ELPA Syncer
Subject: [elpa] externals/detached 7f70f00340: Rename remote/local to remotehost/localhost
Date: Mon, 7 Nov 2022 13:57:32 -0500 (EST)

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

    Rename remote/local to remotehost/localhost
    
    Avoid confusion with local property of a session by clarifying
    remotehost/localhost when referenced to the host property.
---
 detached-consult.el   |  4 ++--
 detached-list.el      |  4 ++--
 detached.el           | 14 +++++++-------
 test/detached-test.el | 24 ++++++++++++------------
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/detached-consult.el b/detached-consult.el
index 0022163036..ebbcf8da97 100644
--- a/detached-consult.el
+++ b/detached-consult.el
@@ -158,7 +158,7 @@ See `consult-multi' for a description of the source values."
                (mapcar #'car
                        (seq-filter
                         (lambda (x)
-                          (eq 'local (cdr (detached--session-host (cdr x)))))
+                          (eq 'localhost (cdr (detached--session-host (cdr 
x)))))
                         (detached-session-candidates 
(detached-get-sessions)))))
             "Local host `detached' sessions as a source for `consult'."))
 
@@ -173,7 +173,7 @@ See `consult-multi' for a description of the source values."
                (mapcar #'car
                        (seq-filter
                         (lambda (x)
-                          (eq 'remote (cdr (detached--session-host (cdr x)))))
+                          (eq 'remotehost (cdr (detached--session-host (cdr 
x)))))
                         (detached-session-candidates 
(detached-get-sessions))))))
   "Remote host `detached' sessions as a source for `consult'.")
 
diff --git a/detached-list.el b/detached-list.el
index ba6ab5e357..5dac696a22 100644
--- a/detached-list.el
+++ b/detached-list.el
@@ -457,9 +457,9 @@ Optionally TOGGLE-SUPPRESS-OUTPUT."
   (interactive)
   (detached-list-narrow-sessions
    `(,@detached-list--narrow-criteria
-     ("Local" .
+     ("Localhost" .
       ,(lambda (sessions)
-         (seq-filter #'detached--local-session-p sessions))))))
+         (seq-filter #'detached--localhost-session-p sessions))))))
 
 (defun detached-list-narrow-remote ()
   "Narrow to remote sessions."
diff --git a/detached.el b/detached.el
index 5496d87a23..1d7a43e7ae 100644
--- a/detached.el
+++ b/detached.el
@@ -245,11 +245,11 @@ Valid values are: create, new and attach")
 (defvar detached-session-annotation nil
   "An annotation string.")
 
-(defconst detached-session-version "0.9.2.0"
+(defconst detached-session-version "0.9.2.1"
   "The version of `detached-session'.
 This version is encoded as [package-version].[revision].")
 
-(defconst detached-minimum-session-version "0.9.2.0"
+(defconst detached-minimum-session-version "0.9.2.1"
   "The version of `detached-session' that the package is compatible with.")
 
 ;;;;; Faces
@@ -1097,17 +1097,17 @@ Optionally CONCAT the command return command into a 
string."
 
 (defun detached--remote-session-p (session)
   "Return t if SESSION is a remote session."
-  (eq 'remote
+  (eq 'remotehost
       (cdr (detached--session-host session))))
 
-(defun detached--local-session-p (session)
+(defun detached--localhost-session-p (session)
   "Return t if SESSION is a local session."
-  (eq 'local
+  (eq 'localhost
       (cdr (detached--session-host session))))
 
 (defun detached--session-accessible-p (session)
   "Return t if SESSION is accessible."
-  (or (detached--local-session-p session)
+  (or (detached--localhost-session-p session)
       (file-remote-p (detached--session-directory session) nil t)))
 
 (defun detached--watched-session-directory-p (directory)
@@ -1537,7 +1537,7 @@ If SESSION is degraded fallback to a command that doesn't 
rely on tee."
   (let ((remote
          (and (file-remote-p default-directory)
               (not detached-local-session))))
-    `(,(if remote (file-remote-p default-directory 'host) (system-name)) . 
,(if remote 'remote 'local))))
+    `(,(if remote (file-remote-p default-directory 'host) (system-name)) . 
,(if remote 'remotehost 'localhost))))
 
 (defun detached--update-session-time (session &optional approximate)
   "Update SESSION's time property.
diff --git a/test/detached-test.el b/test/detached-test.el
index 513eb721ea..169da977ec 100644
--- a/test/detached-test.el
+++ b/test/detached-test.el
@@ -137,20 +137,20 @@
 
 (ert-deftest detached-test-host ()
   (cl-letf (((symbol-function #'system-name) (lambda () "localhost")))
-    (should (equal '("localhost" . local) (detached--host))))
+    (should (equal '("localhost" . localhost) (detached--host))))
   (let ((default-directory "/ssh:remotehost:/home/user/git"))
-    (should (equal '("remotehost" . remote) (detached--host)))))
+    (should (equal '("remotehost" . remotehost) (detached--host)))))
 
 (ert-deftest detached-test-session-active-p ()
   (detached-test--with-temp-database
-   (let ((session (detached-test--create-session :command "foo" :host '("bar" 
. local))))
+   (let ((session (detached-test--create-session :command "foo" :host '("bar" 
. localhost))))
      (should (eq 'active (detached--determine-session-state session)))
      (detached-test--change-session-state session 'deactivate)
      (should (eq 'inactive (detached--determine-session-state session))))))
 
 (ert-deftest detached-test-session-dead-p ()
   (detached-test--with-temp-database
-   (let ((session (detached-test--create-session :command "foo" :host '("bar" 
. local))))
+   (let ((session (detached-test--create-session :command "foo" :host '("bar" 
. localhost))))
      (should (not (detached--session-missing-p session)))
      (detached-test--change-session-state session 'deactivate)
      (should (not (detached--session-missing-p session)))
@@ -159,10 +159,10 @@
 
 (ert-deftest detached-test-cleanup-host-sessions ()
   (detached-test--with-temp-database
-   (cl-letf* ((session1 (detached-test--create-session :command "foo" :host 
'("remotehost" . remote)))
-              (session2 (detached-test--create-session :command "bar" :host 
'("localhost" . local)))
-              (session3 (detached-test--create-session :command "baz" :host 
'("localhost" . local)))
-              (host '("localhost" . local))
+   (cl-letf* ((session1 (detached-test--create-session :command "foo" :host 
'("remotehost" . remotehost)))
+              (session2 (detached-test--create-session :command "bar" :host 
'("localhost" . localhost)))
+              (session3 (detached-test--create-session :command "baz" :host 
'("localhost" . localhost)))
+              (host '("localhost" . localhost))
               ((symbol-function #'detached--host) (lambda () host)))
      ;; One inactive, one missing, one active
      (detached-test--change-session-state session1 'deactivate)
@@ -187,20 +187,20 @@
 
 (ert-deftest detached-test-db-insert-session ()
   (detached-test--with-temp-database
-   (let* ((session (detached-test--create-session :command "foo" :host 
'("localhost" . local))))
+   (let* ((session (detached-test--create-session :command "foo" :host 
'("localhost" . localhost))))
      (should (equal (detached--db-get-sessions) `(,session))))))
 
 (ert-deftest detached-test-db-remove-session ()
   (detached-test--with-temp-database
-   (let* ((session1 (detached-test--create-session :command "foo" :host 
'("host" . local)))
-          (session2 (detached-test--create-session :command "bar" :host 
'("host" . local))))
+   (let* ((session1 (detached-test--create-session :command "foo" :host 
'("host" . localhost)))
+          (session2 (detached-test--create-session :command "bar" :host 
'("host" . localhost))))
      (should (seq-set-equal-p `(,session1 ,session2) 
(detached--db-get-sessions)))
      (detached--db-remove-entry session1)
      (should (seq-set-equal-p `(,session2) (detached--db-get-sessions))))))
 
 (ert-deftest detached-test-db-update-session ()
   (detached-test--with-temp-database
-   (let* ((session (detached-test--create-session :command "foo" :host 
'("host" . local)))
+   (let* ((session (detached-test--create-session :command "foo" :host 
'("host" . localhost)))
           (id (detached--session-id session))
           (copy))
      (setq copy (copy-detached-session session))



reply via email to

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