emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106107: * dirtrack.el (dirtrack): Su


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106107: * dirtrack.el (dirtrack): Support shell buffers with path
Date: Mon, 17 Oct 2011 21:48:28 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106107
author: Ryan Barrett <address@hidden>
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Mon 2011-10-17 21:48:28 +0200
message:
  * dirtrack.el (dirtrack): Support shell buffers with path
  prefixes, e.g. tramp-based remote shells.  (Bug#9647)
modified:
  lisp/ChangeLog
  lisp/dirtrack.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-17 17:40:27 +0000
+++ b/lisp/ChangeLog    2011-10-17 19:48:28 +0000
@@ -1,3 +1,8 @@
+2011-10-17  Ryan Barrett <address@hidden>  (tiny change)
+
+       * dirtrack.el (dirtrack): Support shell buffers with path
+       prefixes, e.g. tramp-based remote shells.  (Bug#9647)
+
 2011-10-17  Teodor Zlatanov  <address@hidden>
 
        * json.el: Bump version to 1.3 and note change in History.

=== modified file 'lisp/dirtrack.el'
--- a/lisp/dirtrack.el  2011-04-19 13:44:55 +0000
+++ b/lisp/dirtrack.el  2011-10-17 19:48:28 +0000
@@ -227,7 +227,7 @@
 function `dirtrack-debug-mode' to turn on debugging output."
   (unless (or (null dirtrack-mode)
               (eq (point) (point-min)))     ; no output?
-    (let (prompt-path
+    (let (prompt-path orig-prompt-path
          (current-dir default-directory)
          (dirtrack-regexp    (nth 0 dirtrack-list))
          (match-num          (nth 1 dirtrack-list)))
@@ -243,8 +243,9 @@
           (if (not (> (length prompt-path) 0))
               (dirtrack-debug-message "Match is empty string")
             ;; Transform prompts into canonical forms
-            (setq prompt-path (funcall dirtrack-directory-function
-                                       prompt-path)
+            (setq orig-prompt-path (funcall dirtrack-directory-function
+                                            prompt-path)
+                  prompt-path (shell-prefixed-directory-name orig-prompt-path)
                   current-dir (funcall dirtrack-canonicalize-function
                                        current-dir))
             (dirtrack-debug-message
@@ -257,8 +258,9 @@
               ;; It's possible that Emacs will think the directory
               ;; won't exist (eg, rlogin buffers)
               (if (file-accessible-directory-p prompt-path)
-                  ;; Change directory
-                  (and (shell-process-cd prompt-path)
+                  ;; Change directory. shell-process-cd adds the prefix, so we
+                  ;; need to give it the original (un-prefixed) path.
+                  (and (shell-process-cd orig-prompt-path)
                        (run-hooks 'dirtrack-directory-change-hook)
                        (dirtrack-debug-message
                         (format "Changing directory to %s" prompt-path)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]