]> code.delx.au - gnu-emacs-elpa/commitdiff
multishell - recognize homedir tramp paths, and update docstring.
authorKen Manheimer <ken.manheimer@gmail.com>
Sat, 16 Jan 2016 18:44:48 +0000 (13:44 -0500)
committerKen Manheimer <ken.manheimer@gmail.com>
Sat, 16 Jan 2016 18:44:48 +0000 (13:44 -0500)
My original path stuff, with name after the path, inadvertently
prevented addressing the user's homedir by requiring a trailing
slash. Both the premise and the (also inadvertent) excessive residue of
that broke the homedir syntax. Fixed!

multishell.el

index f32a9801bc79efd1e9f68fae25614daa480cab7c..bb713db97a00a8e3edfb2401b3c3b4c65cb6c817 100644 (file)
@@ -216,10 +216,10 @@ the buffer name. Otherwise, the host, domain, or path is used.
 
 For example:
 
-* Use '/ssh:example.net:/' for a shell buffer on example.net named
-  \"example.net\".
-* '\#ex/ssh:example.net|sudo:root@example.net:/' for a root shell on 
-  example.net named \"#ex\".
+* Use '/ssh:example.net:' for a shell buffer in your homedir on
+  example.net; the buffer will be named \"example.net\".
+* '\#ex/ssh:example.net|sudo:root@example.net:/etc' for a root shell 
+  in /etc on example.net named \"#ex\".
 
 You can change the startup path for a shell buffer by editing it
 at the completion prompt. The new path will be preserved in
@@ -399,15 +399,12 @@ besides the string before the initial '/' slash.
 Return them as a list (name dir), with dir nil if none given."
   (let (name (path "") dir)
     (cond ((string= path-ish "") (setq dir multishell-primary-name))
-          ((string-match "^\\*\\([^/]*\\)\\(/.*/\\)\\(.*\\)\\*" path-ish)
+          ((string-match "^\\*\\([^/]*\\)\\(/.*\\)\\*" path-ish)
            ;; We have a path, use it
-           (let ((overt-name (match-string 1 path-ish))
-                 (overt-path (match-string 2 path-ish))
-                 (trailing-name (match-string 3 path-ish)))
+           (let ((overt-name (match-string 1 path-ish)))
+             (setq path (match-string 2 path-ish))
              (if (string= overt-name "") (setq overt-name nil))
-             (if (string= overt-path "") (setq overt-path nil))
-             (if (string= trailing-name "") (setq trailing-name nil))
-             (setq path (concat overt-path trailing-name))
+             (if (string= path "") (setq path nil))
              (setq name
                    (multishell-bracket-asterisks
                     (or overt-name
@@ -416,7 +413,6 @@ Return them as a list (name dir), with dir nil if none given."
                               (or (tramp-file-name-host vec)
                                   (tramp-file-name-domain vec)
                                   (tramp-file-name-localname vec)
-                                  trailing-name
                                   system-name))
                           (multishell-unbracket-asterisks
                            multishell-primary-name)))))))