[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/cider 012e3fe71f 14/15: Make TRAMP functionality work when
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/cider 012e3fe71f 14/15: Make TRAMP functionality work when using non-standard ports |
Date: |
Fri, 18 Aug 2023 06:59:23 -0400 (EDT) |
branch: elpa/cider
commit 012e3fe71fef324856db74d26a29b239c3eceb88
Author: vemv <vemv@users.noreply.github.com>
Commit: vemv <vemv@users.noreply.github.com>
Make TRAMP functionality work when using non-standard ports
---
CHANGELOG.md | 1 +
cider-common.el | 8 +++++---
test/cider-common-tests.el | 8 +++++++-
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 530f7ca036..efd32c4c1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,7 @@
- Recompute namespace info on each fighweel-main recompilation.
- Fix the `xref-find-definitions` CIDER backend to return correct filenames.
- Fix the `cider-xref-fn-deps` buttons to direct to the right file.
+- Make TRAMP functionality work when using non-standard ports.
### Changes
diff --git a/cider-common.el b/cider-common.el
index 90a7382a5d..4225a5434b 100644
--- a/cider-common.el
+++ b/cider-common.el
@@ -226,8 +226,8 @@ create a valid path."
(match-string 1 filename)
filename)))
-(defun cider-make-tramp-prefix (method user host)
- "Constructs a Tramp file prefix from METHOD, USER, HOST.
+(defun cider-make-tramp-prefix (method user host &optional port)
+ "Constructs a Tramp file prefix from METHOD, USER, HOST, PORT.
It originated from Tramp's `tramp-make-tramp-file-name'. The original be
forced to make full file name with `with-parsed-tramp-file-name', not providing
prefix only option."
@@ -240,6 +240,8 @@ prefix only option."
(if (string-match tramp-ipv6-regexp host)
(concat tramp-prefix-ipv6-format host
tramp-postfix-ipv6-format)
host))
+ (when port
+ (concat "#" port))
tramp-postfix-host-format))
(defun cider-tramp-prefix (&optional buffer)
@@ -253,7 +255,7 @@ if BUFFER is local."
(when (tramp-tramp-file-p name)
(with-parsed-tramp-file-name name v
(with-no-warnings
- (cider-make-tramp-prefix v-method v-user v-host))))))
+ (cider-make-tramp-prefix v-method v-user v-host v-port))))))
(defun cider--client-tramp-filename (name &optional buffer)
"Return the tramp filename for path NAME relative to BUFFER.
diff --git a/test/cider-common-tests.el b/test/cider-common-tests.el
index b918811b72..92df2bbe71 100644
--- a/test/cider-common-tests.el
+++ b/test/cider-common-tests.el
@@ -68,9 +68,15 @@
(describe "cider-make-tramp-prefix"
(it "returns tramp-prefix only"
- ;;; The third parameter is a host. It must contains a port number.
+ ;;; The third parameter is a host.
(expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#22")
:to-equal "/ssh:cider-devs@192.168.50.9#22:")
+ (expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9")
+ :to-equal "/ssh:cider-devs@192.168.50.9#22:")
+ (expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9"
"12345")
+ :to-equal "/ssh:cider-devs@192.168.50.9#12345:")
+ (expect (cider-make-tramp-prefix "ssh" "cider-devs" "192.168.50.9#12345")
+ :to-equal "/ssh:cider-devs@192.168.50.9#12345:")
;;; These two cases are for using ssh config alias.
(expect (cider-make-tramp-prefix "ssh" nil "test.cider.com")
:to-equal "/ssh:test.cider.com:")
- [nongnu] elpa/cider 856a35cf97 15/15: Don't lose the CIDER session over TRAMP files, (continued)
- [nongnu] elpa/cider 856a35cf97 15/15: Don't lose the CIDER session over TRAMP files, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider f3f7d83bb1 02/15: Use `it` more, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider f14c8de037 12/15: Describe `cider-locate-running-nrepl-ports`, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 1f426a4ac8 03/15: Settle on `*tests.el` naming, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 093f79cf09 11/15: Check `.nrepl-port`-like files for liveness, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider ff98bc7df2 05/15: Bump some copyright years, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 74472b120b 06/15: Cover `cider-format-connection-params`, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 34f1bfc377 09/15: Bump the injected Piggieback to 0.5.3, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 363b8e9eb2 10/15: Recompute namespace info on each fighweel-main recompilation, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 9e4bce60d9 13/15: Add a Dockerfile for TRAMP development purposes, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 012e3fe71f 14/15: Make TRAMP functionality work when using non-standard ports,
ELPA Syncer <=
- [nongnu] elpa/cider 60aaf2cf44 01/15: Remove unused `provide`s in tests, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider aa516693bd 07/15: Run test suite on Emacs 29, ELPA Syncer, 2023/08/18
- [nongnu] elpa/cider 9d1c3cd203 08/15: fix `cider-format-connection-params` edge case for Emacs 29, ELPA Syncer, 2023/08/18