-
Notifications
You must be signed in to change notification settings - Fork 10
Fix getting remote port #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tramp-file-name-host returns hostname without the hash-port part
| (when (s-contains-p "#" hostname) | ||
| (string-to-number (replace-regexp-in-string "\\`.*#" "" hostname))))) | ||
| (let ((port (tramp-file-name-port (tramp-dissect-file-name (pythonic-aliased-path default-directory))))) | ||
| (if (stringp port) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What else can it be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emacs 25 returns tramp-file-name-port as a number, and emacs 26 returns it as a string. This little piece makes them compatible. I probably should add a comment in the code, because it looks indeed not clear
|
Sorry, it was pending for too long! |
|
Added a comment to explain |
| (when (s-contains-p "#" hostname) | ||
| (string-to-number (replace-regexp-in-string "\\`.*#" "" hostname))))) | ||
| (let ((port (tramp-file-name-port (tramp-dissect-file-name (pythonic-aliased-path default-directory))))) | ||
| ;; In Emacs 25, `tramp-file-name-port' returns number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
Great! Thanks! |
See #5