summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRyan Barrett <emacs@ryanb.org>2011-10-17 21:48:28 +0200
committerMichael Albinus <michael.albinus@gmx.de>2011-10-17 21:48:28 +0200
commit87e478b3c1180f9e73396c2fa7c4db55da155489 (patch)
tree1cb20fd84963c9beed852bb0bbc7dd6c1fd9bd8a /lisp
parentf2ff9e88941024ca1ca03f8ea1404536bc3c1475 (diff)
downloademacs-87e478b3c1180f9e73396c2fa7c4db55da155489.tar.gz
* dirtrack.el (dirtrack): Support shell buffers with path
prefixes, e.g. tramp-based remote shells. (Bug#9647)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/dirtrack.el12
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8034cebf0e5..471b1219c19 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-17 Ryan Barrett <emacs@ryanb.org> (tiny change)
+
+ * dirtrack.el (dirtrack): Support shell buffers with path
+ prefixes, e.g. tramp-based remote shells. (Bug#9647)
+
2011-10-17 Teodor Zlatanov <tzz@lifelogs.com>
* json.el: Bump version to 1.3 and note change in History.
diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el
index c3dfc747772..23a05816a2d 100644
--- a/lisp/dirtrack.el
+++ b/lisp/dirtrack.el
@@ -227,7 +227,7 @@ If directory tracking does not seem to be working, you can use the
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 @@ function `dirtrack-debug-mode' to turn on debugging output."
(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 @@ function `dirtrack-debug-mode' to turn on debugging output."
;; 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)))