+ (shell (current-buffer))))
+
+(defun multishell-homedir-shorthand-p (dirpath)
+ "t if dirpath is an unexpanded remote homedir spec."
+ ;; Workaround to recognize tramp-style homedir shorthand, "...:" and "...:~".
+ (let ((localname (file-remote-p dirpath 'localname)))
+ (and localname
+ (or
+ ;; No directory path and no connection to expand homedir:
+ (string= localname "")
+ ;; Original path doesn't equal expanded homedir:
+ (save-match-data
+ (not (string-match (concat (regexp-quote localname) "/?$")
+ dirpath)))))))
+;; (assert (multishell-homedir-shorthand-p "/ssh:myhost.net:")
+;; (assert (not (multishell-homedir-shorthand-p "/home/klm")))
+;; (assert (not (multishell-homedir-shorthand-p "/ssh:myhost.net:/home/me")))