Skip to content

Conversation

@valignatev
Copy link
Contributor

See #5

tramp-file-name-host returns hostname without the hash-port part
@valignatev valignatev mentioned this pull request Jul 29, 2018
(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)
Copy link
Contributor

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?

Copy link
Contributor Author

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

@proofit404
Copy link
Contributor

Sorry, it was pending for too long!

@valignatev
Copy link
Contributor Author

Added a comment to explain stringp check

(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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@proofit404 proofit404 merged commit 4eb5ad0 into pythonic-emacs:master Aug 8, 2018
@proofit404
Copy link
Contributor

Great! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants